Extremely Simple Line Following Robot With Arduino
by CallMeSwal in Circuits > Arduino
21830 Views, 21 Favorites, 0 Comments
Extremely Simple Line Following Robot With Arduino
![Simple Arduino Line Follower](/proxy/?url=https://content.instructables.com/F93/GJGA/HWWNLM7P/F93GJGAHWWNLM7P.jpg&filename=Simple Arduino Line Follower)
In this Instructable, we are going to build a simple generic line following arduinobot. There will be a lot of room for creativity in this Instructable.
The robot, in this tutorial, is powered off of 4 AA batteries and is able to follow black electrical tape off a white surface.
Parts
![PHOTO_20140624_182633.jpg](/proxy/?url=https://content.instructables.com/FYH/3ZHD/HWS3RHHP/FYH3ZHDHWS3RHHP.jpg&filename=PHOTO_20140624_182633.jpg)
1 Arduino Uno or compatible
2 Parallax QTI sensors
http://learn.parallax.com/KickStart/555-27401
2 Solarbotics GM9 Motors or compatible
https://solarbotics.com/product/gm9/
2 Solarbotics GM10 Wheels or compatible
https://solarbotics.com/product/gm10w/
2 VEX motor controllers or compatible
http://www.vexrobotics.com/276-2193.html
Breadboard, wires, etc
Scrap plexiglass to make chassis out of
Building the Physical Part of the Line Follower
![PHOTO_20140624_191730.jpg](/proxy/?url=https://content.instructables.com/F88/RQH4/HWS3RSGG/F88RQH4HWS3RSGG.jpg&filename=PHOTO_20140624_191730.jpg)
![PHOTO_20140624_193101.jpg](/proxy/?url=https://content.instructables.com/F76/OP5H/HWS3RSFE/F76OP5HHWS3RSFE.jpg&filename=PHOTO_20140624_193101.jpg)
![2014-06-25 20.00.52.jpg](/proxy/?url=https://content.instructables.com/FK3/08Q1/HWWNLMFO/FK308Q1HWWNLMFO.jpg&filename=2014-06-25 20.00.52.jpg)
![2014-06-25 20.01.08.jpg](/proxy/?url=https://content.instructables.com/FTU/0H3F/HWWNLMGE/FTU0H3FHWWNLMGE.jpg&filename=2014-06-25 20.01.08.jpg)
You have a lot of room for creativity when building the robot. You simply have to follow three guidelines to ensure the robot will work with the code we will write later.
Firstly, the two QTI sensors must be placed side by side.
Secondly, the QTI sensors must be placed in front or inline with the wheels. The robot will not follow the line well, if the QTI sensors are behind the wheels.
Thirdly, the majority of the weight must be between the motorized wheels. This is to ensure the robot is not affected by weight when turning. If you are building a simple line follower, it is very likely that the battery holder will be the heaviest part of the robot. It is recommended to place the battery pack between the wheels.
The rest of the design is up to your imagination. You can incorporate extra components, like LEDs and buzzers.
I made a simple 4x6x1in U channel, out of plexiglass, on which I mounted all of the parts.
Wiring the Line Follower
![electric diagram.PNG](/proxy/?url=https://content.instructables.com/FZN/G76U/HWTBJFB0/FZNG76UHWTBJFB0.png&filename=electric diagram.PNG)
![Wiring the Line Follower](/proxy/?url=https://content.instructables.com/F85/L5WX/HWWNKGTD/F85L5WXHWWNKGTD.jpg&filename=Wiring the Line Follower)
So now its time to wire up all the components together.
Here is the diagram of the line following circuit. Just attach the components as you see in the diagram.
If you have any trouble watch the video where I explain how to wire up the circuit.
Coding the Line Follower
![Screenshot 2014-06-24 20.56.52.png](/proxy/?url=https://content.instructables.com/F0E/SWVM/HWTBJBF9/F0ESWVMHWTBJBF9.png&filename=Screenshot 2014-06-24 20.56.52.png)
Attached is the line following code for the robot. Download it and load it onto your arduino.
Any line in the code that has a comment you might have to modify. This will only happen if the ports you connected your QTI sensors and motor controllers too are different than the ports they are connected with in the schematic. For example, in my schematic the left motor controller is connected to pin 10. If yours is connected to a different pin than you will have to change the values of certain variables in the code.
If for any reason you cannot download the attached file you can also download it at this link:
https://github.com/mso797/Simple-Arduino-Line-Follower/blob/master/Line%20Follower%20Arduino%20Code
Downloads
Test Out Your Robot
So now you should have a working line follower. Put fresh batteries in the battery holder and place the robot over a piece of black electrical tape. For convenience I would recommend adding an on-switch. The robot should reach the end tape and then stop.
From here you can go in a lot of directions with the robot. If you do happen to do anything interesting with your robot post a link.