Recently, I attended a robotic workshop from Technophilia institute, Mumbai. The workshop covered modules of microcontroller programming. While learning about IR(Infra Red) standards, I understood the idea of an obstacle detector bot. I bought 2 obstacle detectors and the ATMEGA16 microcontroller from the institute and made my bot:
Building materials are:
1. Two DC-motors
2. Two wheels
3. ATMEGA16 microcontroller
4. IR obstacle detectors
5. 12V lead-acid battery
Steps followed:
1. This time, I needed a stronger body than the nokia box since I had to mount the PCB(Printed Circuit Board) as well as the obstacle detctors on it. So I made one using ply-wood.
2. Then, I fixed 2 DC motors in the body and one supporting wheel in a same way as I have done previously in my movement bot.
3. In the next step, The microcontroller PCB and the obstacle detectors got their place and my bot was ready. This process took a one and half day.
4. The next part was vital but very easy and less time consuming and that was to program my robot. Using a software called WinAVR I programmed the IC ATMEGA16 to work as an obstacle detector.
Functioning:
1. The IR obstacle detector mounted on my bot has a transmitter and a receiver.
2. It has one IC which continuously sends logical 1 to transmitter pin. This causes the transmitter to emit infra-red rays in forward direction. The IR ways travel upto a certain distance and then die off.
3. If any obstacle comes within that distance the rays are reflected and are received by the transmitter.
4. When the transmitter receives waves, Logical 1 appears at that pin. My job is to detect this 'Logical 1' at regualr intervals.
5. When my program founds that IR rays have reached the transmitter, it orders the bot to turn. i.e. I move one motor backward and the other in forward direction.
It's a simple if_else structure within an infinte while loop.
while(1)
{
if('Logical 1 is detected')
Order the bot to turn
else
Order the bot to go straight.
}
6. The second obstacle detector on the right is used to control the direction of the turn. If 'Logical 1' is detected at receivers of both detectors, imply that there is an obstacle to the right as well as in the front. In such a case, I order my bot to turn to the left instead of right.
De-merits:
1. Only those obstacles can be detected which are in front of the transmitter since IR rays travel in nearly straight forward direction.
------------------------------------------------------------------------------------
Thanks to all for helping. Programming is done is language C.
0 comments:
Post a Comment