You are on page 1of 18

Edge

Avoider
robot
BY
Nitesh Dubey
&
Parag Nikhra
B.E. 2nd Year (E.C.)
What is a Robot?
Electro-mechanical device.

Performs Various tasks.

May be human controlled or automated.

It finds it’s uses in all aspects of our life.


Basic Parts of a Robot
Mechanical system

Power supply system

Sensory devices for feedback

Sensor Data processing unit

Control system
THE EDGE AVOIDER ROBOT
(EAR)
Basic Electronics
Components in EAR
• Resistors
• Capacitors
• Inductors
• Diodes
• Microcontroler
RESISTORS  Electric current is simply the motion of
electrons from one place to another through a wire. It breaks
the current by controlling the electrons.

CAPACITORS The capacitor's function is to store


electricity, or electrical energy. The capacitor also functions as
a filter, passing alternating current (AC), and blocking direct
current (DC).
Inductors  An inductor is a passive electrical
device that stores energy in a magnetic field, typically by
combining the effects of many loops of electric current.

DIODES The diode is the simplest form of


semiconductor. You use semiconductors in a circuit to
control the flow of electrons. A diode has two terminals,
each with a high resistance to current in one direction and
low resistance to current in the opposite direction.
ATmega 16 DEVELOPMENT
BOARD
IR Sensors
H- Bridge
L293D Dual H-Bridge Motor
Driver
MICROCONTROLLER (ATmega 16)
PIN Diag…
CODE FOR EAR
#define F_CPU 12000000UL //set your clock speed
#include <avr/io.h>
#include <util/delay.h>
int move_backward=0b01110100;
int right_turn=0b10110100;
int move_fordward=0b10111000;
int left_turn=0b01111000;
int left_sensor_on=0b10000000;
int right_sensor_on=0b00000001;
int left_sensor_off=0b00000000;
int right_sensor_off=0b00000000;
int main (void)
{
DDRC = 0xFF; //Output port
DDRA = 0x00; //input port
int left_sensor = 0;
int right_sensor = 0;
while(1) //create an infinite loop
{
left_sensor = (PINA & 0b10000000);
right_sensor = (PINA & 0b00000001);
if(( left_sensor==left_sensor_off) &
(right_sensor==right_sensor_off))
{
PORTD = move_backward; //move
backward
_delay_ms(500);
PORTD=right_turn; //take a right turn
_delay_ms(500);
left_sensor = 0;
right_sensor = 0;
}
if((left_sensor==left_sensor_on) &
(right_sensor==right_sensor_on))
{
PORTD=move_fordward; //move forward
left_sensor = 0;
right_sensor = 0;
}
if((left_sensor==left_sensor_off)&
(right_sensor==right_sensor_on))
{
if (left_sensor != left_sensor_on)
{
PORTD=right_turn; //turn right
}
else while (( left_sensor==left_sensor_off) &
(right_sensor==right_sensor_off))
{
PORTD = move_backward; //move backward
_delay_ms(500);
PORTD=right_turn; //take a right turn
_delay_ms(500);
}
left_sensor = 0;
right_sensor = 0;
}
if(( left_sensor==left_sensor_on) &
(right_sensor==right_sensor_off))
{
if (right_sensor != right_sensor_on)
{
PORTD=left_turn; //turn left
}
if(( left_sensor==left_sensor_on) &
(right_sensor==right_sensor_off))
{
if (right_sensor != right_sensor_on)
{
PORTD=left_turn; //turn left
}
THANK YOU!!!!!!!!!!!!!!

You might also like