My first Robot - LFR (Pronounced ‘Loafer’)
If there is anything that is considered a rite of passage among embedded hobbyists then it undoubtedly has to be the creation of a robot. A robot is not only challenging from the point of view of an embedded system designed to perform a particular function, but it also has mechanical and structural facets to it which makes it even more difficult.
But please do not assume the robots we hobbyists build would be even remotely smart and glamorous like R2D2 from Starwars or the three-laws-bound R. Daneel Olivaw from Asimov’s novels. In stead, our robots are from a much more humble origin; most of us are satisfied with simple line followers and object avoiders. Speaking of which, let me introduce you to my first robot, which I have christened, LFR - Line Following Robot - but you may call him Loafer in affection.
As the name says, this robot is programmed to follow a painted line on any plane surface using a sensing contraption. For LFR, I have used an ATmega32 - an ideal choice primarily because of its on chip debug interface. An endeavour as ambitious as robot building definitely warrants a good debug features.
For my sensor array, I have used two LDRs or Light Dependent Resistors and an LED to act as the light source which is used to shine the path of the robot. The light reflected from either side of the line is then measured and compared to decide which direction to turn the robot. The turning is achieved by using a differential drive i.e. a drive which turns the wheels independently of each other. An LM339 is used as a comparator chip and a ULQ2804A chip is used as the motor driver chip
The below schematic diagrams show how steering of the robot is achieved by using the LDR-LED sensor array. The diagrams show the cases when the robot moves in a straight line, turns left and turns right respectively. This is based on the amount of light reflected off the black painted line.
After the schematic diagrams, now here I present some actual pictures of LFR. Alas! I do not have any videos of this one. One issue which I found with LFR was that the entire circuitry along with its batteries was a bit too heavy for my motors to drive. So it moved rather sluggishly. This is one improvement which I have in mind for LFR 2.0 ;-). And in case you are wondering, for the line, I pasted some black insulation tape on my marble white floor.
So without further ado, here are some snaps of LFR. The first one is a labelled picture for the curious.
If you are curious, click here to see the ATmega32 C source code for LFR. As usual, with ATmega32, the code is extremely convenient. I used the avr-gcc toolchain to compile this and my own homemade JTAG debugger to debug my code. And yes, if you have seen the code then your guess is probably right, I have used PWM to control the speed of the motors here
. Oh and probably you might have also noticed the JTAG debugger interface on the top right hand corner of the main robot board.,
So that was all about LFR - my first robot. It does not follow any of the three laws of Asimov, but yes it is nice to build your own robot, for fun as well as learning!
I hope you enjoyed this post. Stay tuned for more! Until the next time, g’bye and take care! And please do not forget to comment if you like this post.





Recent Comments