Go Down

Topic: Best sensors for detecting line? (Read 874 times) previous topic - next topic

tombo102j

G'day guys,

Im new to the whole arduino thing and in need of a bit of help. For a school project i have a nitro rc car that i want to control itself. I have an Arduino Mega and need help with choosing what sensor is best suited for trailing a solid black line and help programming it. All i need is the single servo i have to be controlled by the line. Any help or guidance would be much appreciated!

Cheers :)

CrossRoads

Do some searches for "line follower", this is not a new concept.

How fast will your car be going?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

EmilyJane

Is the black line a requirement or can you use a white line. I ask because the contrast is normally greater for white to road than black to road.

tombo102j

Will do mate im just a bit confused as to what im looking at when it comes to programing this stuff! haha
Not very fast for the demonstration.

Well either really, i suppose using a white line will be a better choice?

CrossRoads

What you need is a light sensor, you calibrate it (take some readings on white, some on black) then turn the car back and forth a little to detect a line cross and stay near it, or if its a wider line then find the edge and get inside it, making small turns to get back when you cross the edge.

7th graders do this with Lego Mindstorm robots, is not that once you figure out your steering and get away from overcontrolling the turns.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

tombo102j

I see and i asume i can me some sort of sensor bar using LDR's?
I have made a lego mindstorms line follower before, but for this project i decided to step up to arduino for the first time.
At the moment im looking for some code to work with, and figuring out how to set this thing up.

CrossRoads

Use your lego code, break down what the code does and convert it to similar arduino language.

quick google search for arduino light sensor brings you here

http://www.arduino.cc/playground/Main/InterfacingWithHardware#light_sensor

scroll down some & do some reading to start.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up