Introduction:
If you are interested to build a Line Follower robot with an Arduino here is how to do it.
You will need two wheels, two continuous servos as the motor, infra red sensor array, An Arduino board, and some other components that are pictured below:
Schematics
Here is the schematics for the robot. It’s the best to make the circuit in steps as shown below. When you are finished with the servo circuit you can load the ‘servo test’ provided in the code section.
Code
Here are the source codes for your robot. Set up the servos first and use the Servo test code to test to see if you have done everything right. If everything works, connect the Infra red sensor board and upload Line follower code.
When you have the line follower code you can also open the serial monitor of the Arduino program (set the speed to 115200) and watch the sensor output. If everything works fine you can see an output similar to this:
00011000
0
The first line indicates the value that is read from the sensors (left to right represent sensor 1 to sensor 8 respectively ).
Second line print the assigned line position. If the line goes under the sensors 1 the line position will read 7 and in case the line is at the center it will read 0 and finally if line goes under sensor 1, line position will read -7.
List of Components
Wheels:
2 x Servohjul [SRVT-01], 96:-/st of two
http://www.hobbytronik.se/product_info.php/products_id/35
Support Wheel
1 x Stödkula, metall, 9.5 mm [BCP-02] , 24:- / piece
http://www.hobbytronik.se/product_info.php/products_id/152
Sensors:
1 x Multipel reflektsensor, analog [QTR-8A] 104:-/board
http://www.hobbytronik.se/product_info.php/products_id/172
OR
1 x QTR-8A Reflect. Sensor Array [POL-0960] 109:/board
http://www.lawicel-shop.se/shop/
Motors:
2 x Parallax Cont. Rotation Servo [900-00008] , 109:-/each
http://www.lawicel-shop.se/
OR
2 x Servo 360° [41003767] , 149:-/each
http://www.electrokit.se/
Arduino:
1 x Arduino Duemilanove (2009) [ARD-2009] ,
http://www.lawicel-shop.se/
OR
1 x Arduino UNO utvecklingskort (MEGA328) [12200024] ,
http://www.electrokit.se/
Pin headers:
1 x Stiftlist rak 2.54 mm 1×40 pol brytbar [Nr 41001167] , 8:-/each
http://www.electrokit.se
Battery holder:
1 x Battery tray 6 x AAA, 2.035 UM-4 LR03, 30:-/each
http://www.elfa.se
Batteries:
1 x AAA/LR03 [32-6312-10] , 30:-/pack
http://www.elfa.se
Battery snap:
1 x Battery holder 6LR61/9 V 100 mm, BS-IR [42-001-50] , 9.5:-/each
http://www.elfa.se
Prototyping board:
1 x Laboratory strip board [] , :-/each
http://www.elfa.se
DC jack
1 x DC-adapter jack [] , :-/each
http://www.elfa.se
Black Tape:
1 x Svart tejp [36-1975] 29:-/st
http://www.clasohlson.se/
Presentation
You can View or Download find the slides for the first presentation (and the second one) of this robot @ Valand School of fine arts by me as a guest lecture:
Keep me updated about what you do !
Leave a Reply