Arduino Robot won't follow line

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
benforta
 
Posts: 37
Joined: Wed Dec 25, 2013 10:34 am

Arduino Robot won't follow line

Post by benforta »

Hi, I bought the Arduino Robot for my son, and basic functionality doesn't seem to work. As an example, the line following project won't follow lines. The sensor array works, each sensor has an LED that is lit when above white and is off when about black, so if I move the robot manually along the track the sensors do correctly sense the line. But the app itself never runs. No matter what the sensors sense, Robot.isActionDone() always returns true within a few milliseconds and the line following stops. Has anyone actually gotten this to work?

--- Ben

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Arduino Robot won't follow line

Post by Franklin97355 »

Could we see the code? Please use

Code: Select all

 tags to keep the code readable.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino Robot won't follow line

Post by adafruit_support_bill »

Looking at the LineFollow code in the Robot Library, it looks like Line Follow mode exits when it does not detect a line anymore. It could be that your line is not dark or wide enough.

User avatar
benforta
 
Posts: 37
Joined: Wed Dec 25, 2013 10:34 am

Re: Arduino Robot won't follow line

Post by benforta »

Thanks for the reply.

Yep, I thought that, too. So now I am using black electrical tape on white poster paper, the line is as dark as it can be. The sensor array is seeing the line properly and correctly distinguishing between black and white, the sensors each have a red LED above them, and they are lighting correctly as I move the bot over the paper crossing the line. If the sensors correctly see the black line, then it has to be dark enough and properly in contrast.

Any other ideas?

--- Ben

User avatar
benforta
 
Posts: 37
Joined: Wed Dec 25, 2013 10:34 am

Re: Arduino Robot won't follow line

Post by benforta »

franklin97355 wrote:Could we see the code? Please use

Code: Select all

 tags to keep the code readable.[/quote]

The code is the example that comes with the Arduino IDE, it's the Line Follow example under Robot, Control. Code is beign used as is.

Thanks.

--- Ben

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino Robot won't follow line

Post by adafruit_support_bill »

So now I am using black electrical tape on white poster paper,
That should be more than sufficient for the line detector.

I don't have one of these robots on-hand to test with yet & the code comments are all in Italian. These examples were developed by the Arduino team and you might be able to get a quicker answer over at the Arduino forums: http://forum.arduino.cc/ .

terryajackson
 
Posts: 1
Joined: Fri Jun 06, 2014 1:51 am

Re: Arduino Robot won't follow line

Post by terryajackson »

My Arduino bot won't follow a line with either of the published line following sketches. Here is what I learned. I combined elements of two of the examples supplied by Arduino, the IRarray test and the motor control test, to make my own line follower sketch. I found that as soon as I turned a motor on, the IR sensor function quit working. Without powering down, I loaded the IRarray sketch and found it no longer worked, even though the LED's coupled to the sensors still responded.. When I pressed the lower board reset button, it began working again. It looks like you cannot activate the motors and still get data back from the IR sensors. I think we need a response from Arduino. The Arduino forum has many entries about line following not working.

User avatar
maldieve
 
Posts: 1
Joined: Sat Mar 28, 2015 7:05 am

Re: Arduino Robot won't follow line

Post by maldieve »

I have exactly the same problem, has this issue been addressed ?

@terryajackson - would it be possible for you too share the code you used for debugging ?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”