0% found this document useful (0 votes)
107 views11 pages

Srishti 2012 Electronics Section

Ankit Garg from IIT Roorkee created a scared bot using an Atmega 16 microcontroller, L298D motor driver, IR sensors, and DC motors. The bot uses the IR sensors to detect obstacles and determine its movement direction. It can follow a path, collect clothes, or gather reports by moving in the direction determined by the sensor readings. The code uses the sensor input to set a direction flag and control the motor driver accordingly.

Uploaded by

Mohit Sahu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views11 pages

Srishti 2012 Electronics Section

Ankit Garg from IIT Roorkee created a scared bot using an Atmega 16 microcontroller, L298D motor driver, IR sensors, and DC motors. The bot uses the IR sensors to detect obstacles and determine its movement direction. It can follow a path, collect clothes, or gather reports by moving in the direction determined by the sensor readings. The code uses the sensor input to set a direction flag and control the motor driver accordingly.

Uploaded by

Mohit Sahu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Srishti 2012

Electronics Section

SCARED BOT

Made by :-

Ankit Garg ECE (2nd Year ) , IIT Roorkee

Components used :1) Atmega 16 2) L298d motor driver 3) IR sensors 4) DC motors

1. Atmega 16

Small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Digital IO is the most fundamental mode of connecting a MCU(microcontroller) to external world. The interface is done using what is called a port. A port is the point where data internal to MCU chip comes out . They are present in form of PINS of the IC. Most of the PINs are dedicated to this function and other pins are used for power supply,clock

source and other peripherals.Configuration of pins of MCU.

2. Motor Driver (L298D)


DC motors can be directly controlled with a MCU. We can start it ,stop it, or make it go either in clockwise or anticlockwise direction. But MCUs PORT are not powerful enough to drive DC motors directly so we need some kind of drivers. Pin configuration of L298D motor driver:

Using H-bridge concept we control motor direction

3. IR sensors

Sensors to detect obstacle ,colour ,motion.

4. Dc motors
For rotating wheels in a specific direction ,motors are used .

Avr Programming

PCB (Printed circuit board)

back

PORTD

PORTC center

right

left Motor driver

Code for Scared Bot


#include<avr/io.h> #include<util/delay.h> int l,c,r,p,f; void read_sensor() { if(bit_is_set(PINC,1)) { r=1; } else

{ r=0; } if(bit_is_set(PINC,2)) { c=1; } else { c=0; } if(bit_is_set(PINC,6)) { l=1; } else { l=0; } if(bit_is_set(PINC,7)) { p=1; } else { p=0; } } void find_f() { if( l==1 && { f=0; return; } if( l==0 && { f=0; return; } if( l==0 && { f=1; return; } if( l==0 && { f=1; return; } if( l==1 && { f=-1; return;

c==0 && r==1)

c==0 && r==0)

c==0 && r==1)

c==1 && r==1)

c==0 && r==0)

} if( l==1 && c==1 && r==0) { f=-1; return; } if( l==1 && c==1 && r==1) { f=5; return; } else { f=10; return; } } void move11() { PORTD=0b00110101; } void move10() { PORTD=0b00110111; } void move01() { PORTD=0b00111101; } void move00() { PORTD=0b00111111; }

int main(void) { DDRC=0X00; DDRD=0XFF; while(1) { read_sensor(); find_f();

if(p==1) { switch(f) { case 5: move00(); break; case 0: move11(); break; case 1: move10(); break; case -1:move01();

break; case 10: move00(); break; default : move11(); } } else { move00(); } }

Uses: 1) As a path guider for persons strange to locations. 2) For cloth collection in our hostels. 3) For collecting daily reports in offices. Can be further converted to line maze follower by simple changes in coding . Can be used in stores to carry goods from one place to another . By using different types of sensors ,we can make it such that it can move in our desired direction .

Acknowledgement: I have gained a lot of knowledge in this well managed and the most interesting section. I thank to all seniors for helping me to make such a good robot using microcontroller.

You might also like