You are on page 1of 11

EMERGENCY SERVIELLANCE CAR

Project dedicated to:PYARA

ABSTRACT

The project proposes emergency surveillance vehicle for secuirity purpose which
transmits live video using IP camera.We can monitor any place where going of
human is at risk robotic vehicle which. The project is designed to build an
Surveillance car which can be controlled remotely through Rf communication.
The project is a microcontroller based system consisting of a transmitter and
receiver unit. The transmitter unit consists of ATmega 328p microcontroller,
2-axis 2-channel joystick module for controlling car motion and camera
orientation, an ASK(amplitude shift keying) module for communication. The
receiver unit consists of a ASK reciever module, microcontroller and four wheeled
car chassis driven by four DC geared motors.An IP camera is mounted on servo
bracket which transmits live video to android or computer. The four DC motors
are drived by microcontroller through h-bridge IC. Car is moved left and right
using steering mechanism i.e actuating only two respective motors produces turn
in required direction. The camera is mounted on a servo whose angle controlled
by microcontroller depending on signal received.
Components used
1)arduino uno
2)RF 434MHz transmittermodule
3) s
4)DC geared motor
5)Acrylic sheet car chassis 4wheeled
6)Joystick module
7)9V battery
8)Li-ion recharge able batteries
9)AT mega328p
10)L293d hbridge ic
11)9g Servo motor
Reciever program
#include <VirtualWire.h>

#include <ServoTimer2.h>
int d;
int pwm;
int sortie1 = 3;
int sortie2 = 4;
int sortie3 = 6;
int sortie4 = 13;
ServoTimer2 Servo;
int s=2;
char c;
const int receive_pin = 8;
void setup()
{Serial.begin(9600);
delay(100);

Servo.attach(s);

vw_set_rx_pin(receive_pin);

vw_set_ptt_inverted(true);
vw_setup(5000);
vw_rx_start();
pinMode(sortie1, OUTPUT);
pinMode(sortie2, OUTPUT);
pinMode(sortie3, OUTPUT);
pinMode(sortie4, OUTPUT);
pinMode(s, OUTPUT);
digitalWrite(sortie1,LOW);
digitalWrite(sortie2,LOW);
digitalWrite(sortie3,LOW);
digitalWrite(sortie4,LOW);
}

void loop()
{

uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen))
{c=buf[0];
Serial.println(c);
if(buf[0]=='A'){

digitalWrite(sortie3,HIGH);
digitalWrite(sortie2,HIGH);
digitalWrite(sortie4,LOW);
digitalWrite(sortie1,LOW);
}
if(buf[0]=='5')
{
digitalWrite(sortie1,LOW);
digitalWrite(sortie4,LOW);
digitalWrite(sortie2,LOW);
digitalWrite(sortie3,LOW);
}
if(buf[0]=='B')
{
digitalWrite(sortie4,HIGH);
digitalWrite(sortie1,HIGH);
digitalWrite(sortie3,LOW);
digitalWrite(sortie2,LOW);
}
if(buf[0]=='C')
{ digitalWrite(sortie1,HIGH);
digitalWrite(sortie2,LOW);
digitalWrite(sortie3,LOW);
digitalWrite(sortie4,LOW);
}
if(buf[0]=='D')
{ digitalWrite(sortie4,HIGH);
digitalWrite(sortie3,LOW);
digitalWrite(sortie2,LOW);
digitalWrite(sortie1,LOW);
}
if(buf[0]=='E')
{ Servo.write(1000);
delay(15);
}

if(buf[0]=='0')
{ Servo.write(1400);
delay(15);
}if(buf[0]=='F')
{ Servo.write(2000);
delay(15);
}

}}
Transmitter Program

#include <VirtualWire.h>
int j = A0;
int xval;
int k = A1;
int yval;
int l= A2;
int m= A3;
int lval;
int mval;
void setup()
{Serial.begin(9600);
pinMode(j, INPUT);
pinMode(k, INPUT);
pinMode(l, INPUT);
pinMode(m, INPUT);
vw_set_tx_pin(12);
vw_setup(5000);
}

void loop()
{
xval = analogRead(j);

Serial.print(xval);
Serial.print("..");
if (xval <= 50)
{
char msg[1] = {'A'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

if(xval<=600&&xval>=490&&yval<=600&&yval>=490)
{
char msg[1] = {'5'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

xval = analogRead(j);
if (xval >= 974)
{
char msg[1] = {'B'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

yval = analogRead(k);
Serial.println(yval);
if (yval <= 50)
{
char msg[1] = {'C'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
yval = analogRead(k);
if (yval >= 974)
{
char msg[1] = {'D'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
lval = analogRead(l);
if (lval <= 50)
{
char msg[1] = {'E'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

if (lval >= 974)


{
char msg[1] = {'F'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
mval = analogRead(m);
if (mval <= 50)
{
char msg[1] = {'G'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
if (mval >= 974)
{
char msg[1] = {'H'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
if(lval<=600&&lval>=490&&mval<=600&&mval>=490)
{
char msg[1] = {'0'};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}
}

You might also like