I began work on my first robot about two years ago. For no particular reason, I decided to begin with a line following robot and truth be told, my first attempt at building it was a complete failure. Looking back at my efforts, I believe, for a beginner, I was rather too ambitious. The circuit that I had designed had a bunch of unnecessary stuff which I then believed would give my robot an edge over the others. But it never worked and I had to start all over from scratch.

In my second attempt, I managed to get the robot on track. As delighted as I was with my first robot, it was nowhere near where I wanted it to be. I took it to a couple of competitions and not much to my surprise, it failed in both of them. I knew it was time to make some major changes in the design.

In my third attempt, (actually, it wasn’t the third, it was a revision of my second attempt) I updated the firmware and came up with a much more stable and accurate version. It performed well when tested and much to my delight, it finished first in two competitions and second in another. Though I was proud with what I had achieved, I felt that the robot was visually rather unappealing. And you’ll come to know why from its picture given above. It had wires running all over it and I had no other option but to rebuild it. A month or so later, I had the robot all ready and that is the current version of my first robot.

In this instructable I will guide you through the steps that I've followed in building the current version of my robot. It’s one of those robots which belong to the “scratch-built” category. You might find it difficult to find all the parts that I have used. So I insist you to read through the steps that I have followed, and then implement it in your own way with the parts that you've found.

This instructable requires that you are familiar with the following:
• Soldering and related equipments
• Hand tools like screwdrivers, wire cutters and strippers
• Reading schematics and connection diagrams
• C/C++ programming for AVR microcontrollers (optional)

Step 1: Gather the parts

Given below is a list of components that I have used in building this robot.

Electronic Parts
• Atmega32 microcontroller
16x2 alphanumeric LCD
• LM2576 Step-Down Voltage Regulator
L298 Motor Driver Module
Lithium-Ion Rechargeable Battery Pack 11.1V 3000mAh 2C
• 9 x IR Transmitter and Receiver pair (5mm diameter)
• 10K resistor array (9 pin)
• 2N2222 transistor (or any other npn type)
• Resistors and Capacitors
• 2 x Centre Shaft Economy Series DC Motor (100 RPM)
• Switches and Push Buttons

General Parts
• Dot Matrix Prototype PCB
• Plastic Enclosure
• Single-strand Wire
40-pin DIP socket
6 pin FRC right angle male connector
Metal Studs
Plastic Spacers
Nuts and Bolts
Ball Caster Wheel
• 2 x Motor Mounting Clamp
• 2 x Wheel (50mm diameter)
• Cables and Connectors

Tools Required
• Soldering Iron
• Screw Driver
• Wire Cutter and Stripper
• Something to cut and drill plastic

In addition to the above mentioned components, you will also require an AVR programmer and a battery charger.

Now, let’s get started shall we?
<p>I get this problem when compiling the code, could you help me deal with this one?</p>
<p>how to fix this error..</p>
<p>hi i'm amila please can you tell me the whole electronics parts which were needed to built up this robot and can you please tell me 390 inductor instead of that what we can used </p>
<p>I have a question. Say, there is a block on the track. So, the bot cant go any further, it has to turn back. How to deal with that problem?</p>
<p>You could use an ultrasonic distance sensor. You can program the bot to turn around when the distance from the bot to the block is less than a set value.</p>
And 1 question, I have an arduino module. So, any suggestion on the programming part?
okay thanks.
<p>Great instructable. So I have been working on replicating your work, but I'm stuck at the programming part, can you send me your .hex file and does the distance between IR sensor and Emitter is code dependent?(I think everything is good after calibration test)</p>
<p>send it to: jawwad.zahed@gmail.com</p>
<p>Please download the program.rar from Step 17. You will find the .hex file in it.</p>
Thanks midhun_s, but I'm unable to locate the hex file in program.rar
<p>Thank you. The distance between an emitter and its corresponding sensor is not code dependent.</p>
<p>what about <strong><em>invert</em></strong> in a track ??</p>
The answer is in step 35.
can you make this with codevisionavr? help me, im confuse with the program.
<p>I am sorry I ahven't used codevision before.</p>
<p>What are the advantages of the extra sensor in the front as compared to a IR array with sensors in a single row(without the one in the front)?</p><p>In short Does your custom sensor have any advantages over the sensor in the image below?</p>
<p>In the algorithm in step 24 you can see how the front sensor helps in determining in advance whether the robot is over a turn or over an intersection. You could do this even without the front sensor but in some cases, where the track width is more, it prevents the robot from falsely identifying a straight line for a turn.</p>
<p>I would be grateful if you could provide me the PDF file of this book to my email address. My email address is mohib.cse.bd@gmail.com. I would like to work with robotics. Thanks.</p>
<p>consider the sensor in the image has 8 pairs of IR leds but none in front.</p>
<p>There is no separate circuit for calibration. It's all done in the program. If it's the sensor array circuit that you're searching for, you can find that in <a href="http://www.instructables.com/id/Robot-Line-Follower/#step5" rel="nofollow">step 5</a>.</p>
<p>can u plzzz provide with the calibration circuit......i mean how to make.???? connections and all...............plzzzz </p>
<p>what is the minimum rating for battery current wise voltage wise and charge wise</p>
<p>i want to download the pdf of the line follower ropot</p><p>can i get help?</p>
<p>can someone pls explain to me what is the device in step 17. must it be made or can be purchased? </p>
<p>Just look for &quot;AVR Programmers&quot; and follow vendor instructions about how to program your ATMEGA32. Here's one suggestion: </p><p>https://www.sparkfun.com/products/9825</p>
<p>Should there be a Piece paper between emitter and receiver</p>
You could use heat shrink tubes instead. I've tried and it worked just fine. 5mm heat shrink tube should fit snugly on the emitter.
<p>There are four dip switches in the usbasp programmer what is their function</p>
Switch 1 turns the programmer circuit on/off.<br>Switch 2, if turned on, provides 5V supply from USB port to the target.<br>Switch 3 sets slow programming mode on/off. You will have to turn this on when you are flashing program or writing bootloader into an Atmega for the first time.<br>Switch 4 is rarely used and it allows to update the firmware on the programmer through the same 6 pin ISP used for programming.
<p>what is the use of 1st and 8th sensor? can't we make it with 7 sensors and one front sensor?it would make a byte as well</p>
Certainly. Removing one sensor might not seriously affect the performance. But that would mean you will have to consider the front sensor as one among the seven bits. I think this would make the program part a little complex as you cannot directly associate the bit positions with the physical layout of the sensors. After all, more sensors you choose, more are your possibilities of fine tuning your robot.
<p>Nice robot, very creative..... </p><p>how does the motor move from left and right... I can't see a component used to moved it from left and right... I'm not referring from the program or the sensor... thanks for advance and more power.</p>
<p>Nice robot, very creative..... </p><p>how does the motor move from left and right... I can't see a component used to moved it from left and right... I'm not referring from the program or the sensor... thanks for advance and more power.</p>
<p>Nice robot, very creative..... </p><p>how does the motor move from left and right... I can't see a component used to moved it from left and right... I'm not referring from the program or the sensor... thanks for advance and more power.</p>
<p>Nice robot, very creative..... </p><p>how does the motor move from left and right... I can't see a component used to moved it from left and right... I'm not referring from the program or the sensor... thanks for advance and more power.</p>
<p>Can you please tell me the name of the inductor used? And the distance in between the two leads? </p>
I couldn't find any information on the inductor except its value. I bought it from an online shop some long time ago.
<p>hi</p><p>could you send me the hex file of this robot? please!!!</p>
Download the program.rar file from Step 17. You will find the .hex file in it.
<p>thank you very much but i can't find it.could you send it to me.my gmail is </p><p>amin.kameli1990@gmail.com</p>
<p>I run the sonssors in bread board but it doesn't work what should i do?</p>
The fuse bits not working! But I checked my MCU fuse bit using extreme burner. Low fuse bit is 0xE1 and high is 0x99. Is it right if not tell fuse bit in extreme burner. Thank you.
<p>A great tutorial but i have a query, what changes i would have to make if i am not using mcu's adc?</p>
<p>You could use potentiometers instead of the resistors that I've used in the sensor array. Thereby you can adjust the threshold manually. You can connect pins from the sensor array directly to any port of your mcu.</p>
<p>Thanks for prompt reply...</p><p>I have aleady done that but i am confused with code.</p><p>What changes should i make in the code?</p>
<p>Read data from the sensors to any port of the mcu. This data is equivalent to the binary value obtained using the <strong>get_sensors_binary()</strong> command. You won't have to use the <strong>sensors.h</strong> library except for the <strong>count_binary() </strong>command.</p>
<p>by far the best tutorial on Line following robot that i have come across.......great work midhun </p>
Can I make this using arduino uno? if I can please give me full details. And please tell me how to contact you.<br>Thank you

About This Instructable


275 favorites


More by midhun_s: Robot - Line Follower
Add instructable to: