Line Follower Robot (Complete Noobie)

Hi,

I've decided to attempt to make a line following robot for a school project. I've got an Arduino Uno but was wondering whether it is necessary to buy an Ardumoto or whether I could make my own motor circuit. If so how would I go about doing this.

I was also wondering if anyone had any tips for the best way to go about it and any cool features I could add to make it stand out from others.

Thanks any help will be much appreciated,

Vicki :slight_smile:

This adafruit motor shield is better than Ardumotor IMO Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit [v2.3] : ID 1438 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits

For line tracking I recommend this sensor: CNY70.

First of all, good choice on using the Arduino UNO! :smiley:
As for the robot, you can build your own motor control circuit using a transistor (probably a MOSFET), or a motor driver chip, but I would go with a motor driver shield because of its simplicity and ease of use. If you want one for really cheap, check on ebay for a motor driver shield. An even better option would be to use servos. You don't even need to use a motor control board for those! You can get them on ebay for cheap as well. Make sure to get continuous rotation, because if they aren't, they might only be able to turn a short range. :stuck_out_tongue:

As a final word, if you choose to go with the motor shield, then use the Adafruit one. I love SparkFun, but I just have to go with Adafruit on this one. The servos would still be the best and most controllable (precise) option.
Hope your project goes well!

~Dylan

Hi MakerSpark,

I had fun with a line following project a while back! I used a L298N Dual H Bridge module, 2 geared motors (around 200 RPM), 6 TCRT5000 IR led/sensor pairs, Arduino uno and of course a base, wheels and batteries. All of these were from eBay, in order to keep the costs down. The base was from scrap plastic and the wheels were from a RC toy.

Some tips from experience:
Differential drive is probably the easiest way to go. Having the driving wheels at the back (along with the heavier pieces of the bot, like the batteries) worked better for me. At the front I had a castor and, of course the line detection sensor.

It is much simpler (from troubleshooting perspective) to have two separate power supplies (battery packs) - one for the motors and one for the Arduino and your sensors. Make sure the grounds of the two power supplies are connected.

I ended up having the spacing between the IR sensors be slightly less than the width of the line. This worked pretty well, as you can more precise detection capabilities. For example, with my 6 sensors, my dead center was when both sensors 3 and 4 were detecting the line. When just 3, or just 4 was detecting the line, I knew I was close to the ideal positioning, but not exactly there.

If you are ambitions, you may look into PID algorithms. Anyway, be prepared for some trial-and error, until you come up with a good algorithm to drive the bot. Sometimes a tiny adjustment in your constants can lead to a dramatic change in the bot behavior.

As far as cool features: you can do a maze solver, with the same hardware. you can add obstacle avoidance and make the bot go around an obstacle and continue to follow a line...

I have posted some of the code and videos from my attempt at a line follower here:
[Project 2: Arduino Line following test 3 – 42 Bots](http://I have posted some of the code and videos from my attempt at a line follower here:
Project 2: Arduino Line following test 3 – 42 Bots)

Good luck and post back with your progress!

Thank you so much, I've just ordered a L298N Dual H Bridge module from eBay and I've already made my own chassis and I've got the wheels, motors etc. I was wondering whether there is another way I can see your coding and videos (are they on youtube?) as the link doesn't seem to be working properly on my computer.

Also, would you recommend that I use a breadboard or buy some general purpose board and solder the components together.

Thanks again!