LINUS: the Line Following Robot

by badarsworkshop in Circuits > Robots

4585 Views, 24 Favorites, 0 Comments

LINUS: the Line Following Robot

54deddb72f7cc6b736000075.jpeg
DSC05651.JPG
DSC05650.JPG

This is my attempt at a line following robot. I basically upgraded it as i went so i am just going to give and overview of the build and allow you to use your thinking. I used Lego as the base and then made my own sensor array. The first sensor array had 8 sensors but i realized that only 4 were being used so i made another with only four sensors. At first used the Arduino Uno and then upgraded to standalone Arduino.

Downloads

Parts Required

New Bitmap Image.jpg
DSC05352.JPG
DSC05419.JPG
DSC05426.JPG
DSC05428.JPG
DSC05436.JPG

These are the parts i used

2 x 6 V 310 RPM Geared Motors
1 x Lego Base
2 x Lego Tyres
1 x Atmega 328
1 x Vero Board
4 x IR Led
4 x Phototransistors
1 x 28 Pin IC Base
1 x 9 V Battery
1 x 9 V Battery Clip
1 x Arduino Motor Shield 
(I used the one i made myself)
https://www.instructables.com/id/Arduino-L298-Motor-Shield/
2 x Slide Switch
1 x IR Receiver
1 x Crystal Oscilator 16 Mhz
1 x Tactile Switch
2 x 2 AA Battery Holder
Indicator Leds
Resistors (10 k and 220 Ohm)
Jumper Wire
Male Header Strip
Heat Shrink Tube
Zip Ties
Double Side Tape
Female header Strip
Some instrument to program you micro controller. I used USPasp

Basic tools and some skills are also required

 

Motor Assembly

DSC05430.JPG
DSC05427.JPG
DSC05449.JPG
The first thing to do is to get your motor assembly done. For that i glued the two motors together and then to the Lego chassis. To my convenience they were compatible making my job much easier.  BTW. In the last picture i removed one of the motors as it got damaged and i had to wait for the replacement to arrive. 

Sensor Array

DSC05662.JPG
phototrans.jpg
DSC05447.JPG
DSC05432.JPG
DSC05434.JPG
DSC05439.JPG
DSC05644.JPG
For the sensor array i used a vero and made my circuit on it. The pictures are of my first attempt but the final version is built the same way, just smaller. The schematic is repeated for every pair of sensor. 

Add Batteries

DSC05534.JPG
DSC05536.JPG
Next is to attach the two battery holder and the 9 V battery. I first used an arduino to test it out but you could go directly to the circuit. 

Make the Circuit

DSC05561.JPG
Atmega168PinMap2.png
Lm7805-pinout-diagram.gif
DSC05664.JPG
IR-pinout.jpg
For the main circuit i used the Atmega 328 with arduino boatloader. I made it so that the same motor shield was used and with headers i made it removable. Other connections such as connection to sensor array etc were alse with headers to make it removable. The circuit is straight forward. Just the standalone arduino with 4 connections to the motor shield. 

Finalizing the Hardware

DSC05640.JPG
DSC05648.JPG
Next i assembled every thing. The circuit board was was screwed to the chassis and so was the sensor array. After testing i added the IR receiver and the mode switch. 

Programming

arduino_logo.jpg
Upload the program. It is very basic and easily understandable. The robot is also remotely controlled by a tv remote. For that you will need to fund the exact codes of the button you choose for each function. You will also have to install the IR Library. Download and paste in the libraries folder. Then you will wire the sensor to the arduino and upload the code. Use serial monitor to note down the codes. 

if(in == <Hex value>){<code>}  
    else if(in == <Hex value> ){<code>}
    else if(in == <Hex value>){<code>}
    else if(in == <Hex value>){<code>}
    else if(in == <Hex value>){<code>}

Then in this basic code add you hex value and the response is already added. Next for the line following i used a basic analog value but if you use the arduino and along with serial read you can set exact values for your own track. 

Conclusion

The robot turned out pretty good. 
Please vote for me if you liked my instructable. 
I will add a video shortly
Thanks for viewing