Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: oltion28 on June 04, 2012, 08:14:57 AM
-
Hello there,
I have a project at my university, and i have to build a line follower robot with arduino, and for sensors i have to use photoresitors. How can i modify the photoresistors to detect a line. And i also want to know the program to upload on the arduino board.
Its is urgent because I have not enough time!
-
I'm not clear why you would want to modify the photoresistor.
I assume your line is a different color than the background - and if you point the photoresistor at the line it will give you a different reading over the line vs. off the line - and that is the information you need to make the line follower work. If you have two photoresistors, you can straddle the line. If you have only one, you can follow one edge of the line.
-
I've heard to attach led to the photoresistor, and i don't know how to do this. :(
And where i can find the code to program it ?
Tank you
-
OK, watch a little of this video:
Two Wheel Lego Mindstorms NXT Balancing Robot at LTU (http://www.youtube.com/watch?v=u82w9CpHc0o#)
See the red spot shining on the table in front of the robot? That's from the LED. The LED lights up a spot on the surface and a photoresistor would be mounted right next to it and would react to the amount of reflected light. The two are not really connected together electrically except to share a common power source. In fact, you want to keep them somewhat separated by something that the light doesn't shine through so that the photoresistor only reacts to the light reflected from the surface - glue them both to opposite sides of a piece of cardboard.
The LED will be connected to power and ground (+ and -) through a resistor to limit the current to the LED.
The photo resistor will be hooked up like shown here: http://www.societyofrobots.com/schematics_photoresistor.shtml (http://www.societyofrobots.com/schematics_photoresistor.shtml)
You may be able to find some code if you google. Otherwise you will have to write it yourself. I assume that the point of the homework assignment is to get you to write code - right?
-
no the main point is electronic, and so i want to get the code of programming almost done :D. Thank you very much for your reply, it was helpful. :)