Sie sind auf Seite 1von 12

A Prototype Vehicle with Full Automatic Control

Submitted by:

Binod Shah (0914011),


Siddharth Jha (0914027),
Under the guidance of: Prof. J. Mehedi
Electronics and Communication Engineering Dept.
NIT Silchar.

Neeket Agarwal (0914022),


Shahzad Karim (0914093)

ABSTRACT
In this project, we have designed and implemented an autonomous vehicle(Follower)
which follows the path directed by a manually controlled vehicle (Leader) using intervehicle wireless data transfer and infrared sensors. In this model, we investigated the
operations of IR sensor, astable mode of 555 timer, 434Mhz RF transceiver,
microcontroller ATMEGA16 and L293D.
As a 2nd part of the project work we will use these concepts with concepts of image
processing technology using Matlab for understanding the environment the moving
according to these informations obtained after image processing.

INTRODUCTION

India witnessed one road accident every minute in 2011 which claimed one life every 3.7 minutes, one of the
highest in the world. 4 out of every 5 such accidents are due to the drivers fault. These 4 out of 5 accidents can
be eliminated by removing the driver and putting a computer in its place which controls the car. This would
reduce the number of accidents to a great extent.

Also, as this vehicle would be controlled by a set of rules defined in the algorithm so the traffic rules would be
strictly followed and traffic jams could be reduced.

So as a part of reduction of accidents and improvement of traffic in India, this project is taken up in which we design and
implement a prototype vehicle with full automatic control.

THEORY
The Phases of the project:

Phase I:

An autonomous vehicle(Follower) will follow the path directed by a manually controlled vehicle
(Leader) using inter-vehicle wireless data transfer and infrared sensors.

Phase II:

The Autonomous vehicle is mounted with specific sensors, cameras and wireless modules and
pre-programmed to move from one point to another along a presumed path without any human
intervention or control, avoiding obstacles in its path.

Phase I:
The prototype consists of two vehicles: The follower (autonomous vehicle)
& The leader (manually controlled)
The major components used in The Follower are:

ATMEGA 16L
L293D (Motor driver)
434 Mhz RF receiver
IR transmitter
555 Timer circuit
DC Motors

The major components used in the Receiver are:

ATMEGA 16L
IR Sensor
434Mhz RF transmitter
Remote control
DC Motors

The ATMEGA 16L is an 8 bit microcontroller used to take in inputs from sensors compare the input with the predefined
values in the program, performs arithmetic and logical operations on the data and sends an output to its output ports. It
consists of 4 I/O ports and 16 KB of flash memory.
In the follower the Atmega takes in 2 bits of input from close proximity IR sensors installed at the front of the vehicle, 1
bit of input from the RF receiver and processes it using the following program.
#include <avr/io.h>
#define HALF 550//550
#define FULL 1800 //1100
#define RHALF 524//510
#define RFULL 1628
#define DL 12 //7
#define DLS 6 //6
#define DLSS 2
#define RDL 12 //7-2
#define RDLS 6
#define RDLSS 2
void config_timer1()
{
//Configure TIMER1
TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|(1<<WGM11);
//NON Inverted PWM
TCCR1B|=(1<<WGM13)|(1<<WGM12)|(1<<CS11); //PRESCALER=8 MODE 14(FAST PWM)
ICR1=290;
OCR1A=190;
DDRD|=(1<<PD5); //PWM Pins as Out
}
void config_iopins()
{
DDRC=0xff;
DDRD=0xff;
PORTC=0x00;
DDRB=0b11111000;
PORTB=0b00011000;
PORTD=0b00000000;

}
void delay(int j)
{
while(j)
j--;
}
void ready_to_start()
{
//intialize sequence
PORTC=0b00000001;
delay(20000);
PORTC=0b00000000;
delay(20000);
PORTC=0b00000001;
delay(20000);
PORTC=0b00000000;
delay(20000);
PORTC=0b00000001;
PORTC=0b00000000;
}
int too_close()
{
if(bit_is_clear(PINB,2))
return 1;
else
return 0;
}
int path_clr()
{
if(bit_is_clear(PINB,1))
return 0;
else
return 1;
}
int found()
{
if(bit_is_clear(PINB,0))
{
return 1;
}
else
{
return 0;
}
}
void led_on()
{
PORTC|=0b00000001;
}
void led_off()
{
PORTC&=0b11111100;
}

void r_left()
{
PORTC&=0b11000011;
PORTC|=0b00100100;
}
void r_right()
{
PORTC&=0b11000011;
PORTC|=0b00011000;
}
void str()
{
PORTC&=0b11000011;
PORTC|=0b00010100;
}
void stop()
{
PORTC|=0b00111100;
}
void backwards()
{
PORTC&=0b11000011;
PORTC|=0b00101000;
}
void main()
{
config_iopins();
ready_to_start();
delay(20000);
int i=0,flag=1,r=0;
int k=50;
while(1)
{
xy:
led_off();
while(too_close())
backwards();
while (found() && path_clr() && !too_close())
{
led_on();
while(k && found() && path_clr() && !too_close() )
{
str();
k--;
}
stop();
delay(50); //350
k=50;
}
led_off();
if(( !(path_clr())) )
stop();
else if ( !(found()) && path_clr() )

{
if(r==0)
{
if(flag==1)
{
for(i=0;i<HALF;i++)
{
r_left();
delay(DL);
stop();
delay(DLSS);
if(found())
{
r=0;
flag=1;
goto xy;
}
}
for(i=0;i<RHALF;i++)
{
r_right();
delay(DL);
stop();
delay(DLSS);
if(found())
{
stop();
r=0;
flag=1;
goto xy;
}
}
} //end of initial search
for(i=0;i<RFULL;i++)
{
r_right();
delay(DL);
stop();
delay(DLSS);
if(found())
{
stop();
r=1;
flag=1;
goto xy;
}
}
for(i=0;i<FULL;i++)
{
r_left();
delay(DL);
stop();
delay(DLSS);

if(found())
{
stop();
r=1;
flag=1;
goto xy;
}
else
r=1;
}
flag=0;
} //end of left search
if(r==1)
{
if(flag==1)
{
for(i=0;i<RHALF;i++)
{
//delay(RDLS);
r_right();
delay(RDL);
stop();
delay(RDLSS);
if(found())
{
stop();
r=1 ;
flag=1;
goto xy;
}
}
for(i=0;i<HALF;i++)
{
//delay(DLS);
r_left();
delay(DL);
stop();
delay(DLSS);
if(found())
{
stop();
r=1 ;
flag=1;
goto xy;
}
}
}
flag=0;
for(i=0;i<FULL;i++)
{
//delay(DLS);
r_left();

delay(DL);
stop();
delay(DLSS);
if(found())
{
stop();
r=0 ;
flag=1;
goto xy;
}
}
for(i=0;i<RFULL;i++)
{
//delay(RDLS);
r_right();
delay(RDL);
stop();
delay(RDLSS);
if(found())
{
stop();
r=0 ;
flag=1;
goto xy;
}
else
r=0;
}
} //end of right search
}
}
}
Using the above mentioned program the Atmega gives outputs through 4 bits to the motor driver L293D. This l293D
drives the DC motors.
In the leader the Atmega just takes in Input from the IR sensor. If the received input is high then it sends an
acknowledgment signal to the follower through the 434 Mhz RF transceiver.
For this the following program is used in the leader.
#include <avr/io.h>
int detect()
{
if(bit_is_clear(PINA,0) || bit_is_clear(PINA,1) || bit_is_clear(PINA,2) || bit_is_clear(PINA,3) || bit_is_clear(PINA,4) )
return 1;
else
return 0;
}
void delay(int i)
{
while(i)
i--;
}

void led_on()
{
PORTD=0b00000001;
}
void led_off()
{
PORTD=0b00000000;
}
void tx_on()
{
PORTB=0xff;
}
void tx_off()
{
PORTB=0x00;
}
void initialize()
{
DDRD=0b00000011;
DDRA=0x00;
DDRB=0xff;
led_on();
delay(1000);
led_off();
delay(500);
led_on();
delay(1000);
led_off();
delay(1000);
}
void main()
{
initialize();
while(1)
{
if(detect())
{ tx_on(); led_on(); delay(50);}
else
{tx_off(); delay(20);led_off();}
}
}

Block diagrams of circuits used in the two vehicles

Present Areas of work


We have successfully implemented the phase I and hav started our study for the phase II of the project

Work taken up in PHASE II

Sensing the environment using image processing techniques.


Using that information for processing and understanding the environment.
Moving from one point to another using this estimate of the environment.
There are three types of image processing transformations:
o Image to image transformation
o Image to information transformations
o Information to image transformation
Our project work involves study and implementation of Image to information transformations.
Image to information transformations can be described by the following relation:
Image In Information (Data) Out
Our Image processing interest involves the following for the project:
Image Statistics
Image Analysis (Image Segmentation, Feature extraction, pattern recognition)
Computer Aided Detection and Diagnosis

Future areas of work to be taken up

Using the images from camera we would process the data using Image processing toolbox in Matlab.
This image will be processed for present location detection, obstacle detection and accordingly the signals for
the movement of the vehicle are generated depending on these data.
These movement signals will then be transmitted to the vehicle through RF transciever as used in the 1st phase.

Das könnte Ihnen auch gefallen