Pages: [1]   Go Down
Author Topic: Best sensors for detecting line?  (Read 774 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 533
Posts: 26957
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

How fast will your car be going?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 533
Posts: 26957
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 533
Posts: 26957
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: