Shop OBEX P1 Docs P2 Docs Learn Events
Line follower with Photoresistors — Parallax Forums

Line follower with Photoresistors

julius.meinljulius.meinl Posts: 6
edited 2009-03-15 11:28 in Learn with BlocklyProp
Hi,

I would like to show you my line follower with Photoresistors. (It's my DIY construction so I don't know is it a good topic there blush.gif ).

9437f4461f08e6cdm.jpg

Only what you need to build this sensor are 3 photoresistors (e.g VT935G-B).

c2391c7392a63330m.jpg

The ciruit is simple:
ba370254466c31a6.jpg


My program is using RCTIME Command and copare time from 3 circiut .



 time1 VAR Word
 time2 VAR Word
 time3 VAR Word

 DO

     'first photoresistor

HIGH 15
PAUSE 3
RCTIME 15,1, time1


  'second photoresistor
HIGH 6
PAUSE 3
RCTIME 6,1, time2


  'third photoresistor
HIGH 0
PAUSE 3
RCTIME 0,1, time3


     DEBUG HOME,"time1=  ",  DEC5 time1 , "time2=  ",  DEC5 time2,"time3=  ",  DEC5 time3



IF   (time1 > time2 ) AND ( time1> time3 ) THEN
PULSOUT 13, 650 ' Left rotate
PULSOUT 12, 650
HIGH 14
ENDIF

IF ( time3 > time2 )  AND ( time3 > time1)  THEN
PULSOUT 13, 850 ' Right rotate
PULSOUT 12, 850
HIGH   1
ENDIF


IF (time2 > time1) AND ( time2> time3 )   THEN
PULSOUT 13, 850 ' Forward
PULSOUT 12, 650
HIGH    7
ENDIF


LOOP





There is a short video:

www.youtube.com/watch?v=sKapEdJaOzg


Of course It's only prototype, but I think this sensor can be use in diffrent project with boe-bot
smilewinkgrin.gif

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-03-14 20:33
    How much does the antistatic foam affect your readings? I'd think a non conductive material would make it easier to get identical results with multiple modules. Nice job.
  • HumanoidoHumanoido Posts: 5,770
    edited 2009-03-15 00:10
    Very good prototype. I like the excellent design with pure simplicity and it can use simple parts available from Parallax for the Boe-Bot. The CaS cell is commonly available. Is that conductive foam used to run the wires through? Thanks for sharing the images and code.

    humanoido
  • julius.meinljulius.meinl Posts: 6
    edited 2009-03-15 11:28
    This foam is only used to maintain the structure ( I try to built this sensor very fast, becouse it's a part of much bigger project )

    There is the same sensor but soldered to copper wire:

    78f1600b2ef1c67bm.jpg


    In this design, photoresistors have a common mass, so you don't have to conect photoresistor to Vss

    (under the robot you can see additional wire, but it's a part from diffrent projekt )
Sign In or Register to comment.