Line follower using the pic16f877

hey there....i am looking to build a line follower using the pic16f877.....i plan on using red leds and phototransistors for my sensors and also want to use the whole concept of differential drive for moving my motors using only 2 wheels. can anyone please help me.....i dont know how to start, dont know what components i will need etc....please help.....does anyone have a schematic available for such a project? please help....am desperate.....thanks a lot in advance

Replies

  • preeste
    preeste
    oh yeas....i want to also use geared motors, 5 sensors using thered leds and OP505B phototransistors.......furthermore i want to use the L293D h-bridge to control motor....can someone help me with a design for the line follower with all the above requirements......i will be so greatful......please its urgent....like i need it if its possible in the next two days maximum....thanks again
  • preeste
    preeste
    Can someone please help? 4 days and no help! 😔
  • Kaustubh Katdare
    Kaustubh Katdare
    preeste
    Can someone please help? 4 days and no help! 😔
    Replies will take some time. You will have to be bit patient!

    -The Big K-
  • John Connor
    John Connor
    look this link

    #-Link-Snipped-#

    replace the pic for the 16f877

    and configure this code in the pic


    DEFINE LOADER_USED 1
    J VAR BYTE
    SYMBOL ENAL = PORTB.0
    SYMBOL ENAR = PORTB.1
    SYMBOL LAMOT = PORTB.2
    SYMBOL LBMOT = PORTB.3
    SYMBOL RAMOT = PORTB.4
    SYMBOL RBMOT = PORTB.5
    RIR0 VAR BYTE
    RIR1 VAR BYTE
    RIR2 VAR BYTE
    RIR3 VAR BYTE
    TRISB = 0
    ADCON1 = $00
    J = 240
    INI:
    ADCIN 0,RIR0
    ADCIN 1,RIR1
    ADCIN 2,RIR2
    ADCIN 3,RIR3
    INICIO:
    IF RIR0 > J AND RIR1 > J AND RIR2 > J AND RIR3 > J THEN INI
    IF RIR0 <= J AND RIR1 <= J AND RIR2 <= J AND RIR3 <= J THEN INI
    IF RIR0 > J AND RIR1 > J AND RIR2 <= J AND RIR3 <= J THEN FORWARD
    IF RIR0 > J AND RIR1 > J AND RIR2 > J AND RIR3 > J THEN FORWARD
    IF RIR0 > J AND RIR1 <= J AND RIR2 <= J AND RIR3 <= J THEN BACK
    IF RIR0 <= J AND RIR1 > J OR RIR2 > J OR RIR3 > J THEN BACK
    IF RIR0 > J AND RIR1 > J AND RIR2 > J AND RIR3 <= J THEN LEFT
    IF RIR0 <= J AND RIR1 > J AND RIR2 > J AND RIR3 <= J THEN LEFT
    IF RIR0 > J AND RIR1 > J AND RIR2 <= J AND RIR3 > J THEN RIGHT
    IF RIR0 <= J AND RIR1 > J AND RIR2 <= J AND RIR3 > J THEN RIGHT
    IF RIR0 > J AND RIR1 <= J AND RIR2 > J AND RIR3 <= J THEN MAXLEFT
    IF RIR0 <= J AND RIR1 <= J AND RIR2 > J AND RIR3 <= J THEN MAXLEFT
    IF RIR0 > J AND RIR1 <= J AND RIR2 <= J AND RIR3 > J THEN MAXRIGHT
    IF RIR0 <= J AND RIR1 <= J AND RIR2 <= J AND RIR3 > J THEN MAXRIGHT
    goto INI
    FORWARD:
    ENAL = 1
    ENAR = 1
    LAMOT = 1
    LBMOT = 0
    RAMOT = 0
    RBMOT = 1
    GOTO INI

    BACK:
    ENAL = 1
    ENAR = 1
    LAMOT = 0
    LBMOT = 1
    RAMOT = 1
    RBMOT = 0
    GOTO INI

    LEFT:
    ENAL = 1
    ENAR = 0
    LAMOT = 1
    LBMOT = 0
    RAMOT = 1
    RBMOT = 0
    GOTO INI

    RIGHT:
    ENAL = 0
    ENAR = 1
    LAMOT = 0
    LBMOT = 1
    RAMOT = 0
    RBMOT = 1
    GOTO INI

    MAXLEFT:
    ENAL = 1
    ENAR = 1
    LAMOT = 1
    LBMOT = 0
    RAMOT = 1
    RBMOT = 0
    GOTO INI

    MAXRIGHT:
    ENAL = 1
    ENAR = 1
    LAMOT = 0
    LBMOT = 1
    RAMOT = 0
    RBMOT = 1
    GOTO INI

    END

    TAKE CARE

    ATT

    JOHN CONNOR
  • jmn
    jmn
    I am building a line follower. I use a pic16f877a to read the sensors and to control the motors. To drive the motors I use a l298, line sensors: CNY70, differential drive with tamiya gearbox.

    This is the robot if this can help you..
    pic16f690 | Flickr

    I am testing now the pcb and programming the pic. Tamiya gearbox is a good way to build the differential drive, it is cheap an fast.

You are reading an archived discussion.

Related Posts

Can any one have an idea what the exactly Ajax technology is? 😕
Sutta"Sutta na milla", "Sutta na mila" is the latest song on every teenager’s lips these days. When I heard this song for the first time, my first reaction was “Oh!...
Aaj Maa Bahut Yaad Aayi Aankhe khuli, sannata chhaya tha, Pankha jor se chal raha tha, dar bhi bada lag raha tha, Ghadi subah ke sade char baja rahi thi,...
[FONT="]Many financial experts suggest that self-help credit repair may be the most effective method in many cases to repair bad credit.There are many things that customers can do by themselves...
Hello, everybody. I am a new member of the CE Forum. I live in Rio de Janeiro-Brazil. Thanks. jkf