Automatic Home surveillance system using arduino(simple and cheap)

The goal of my project is to achieve Automatic home surveillance system without any manual interference. In general other surveillance system it is necessary to power ON TV and camera receiver every time. And also it needs to any user input to view who is standing out side. But in my project both are not necessary because it automatically control power of TV and camera receiver and my project doesn’t need any user input. We can install camera output into our casual home TV itself.The operation of my project is that when some one press the calling bell in transmitter section in outside door that signal send to receiver section using wireless data transmission. receiver section sounds the buzzer for let us know some one pressing calling bell outside then Receiver section checks whether TV is ON or OFF.

If TV is OFF then the receiver section turn ON the TV and change the TV source of input to in which the wireless camera receiver is connected . now the the TV shows who is standing outside the door. If we know that person then we will open the door . That time transmitter sense door is opening and send that data to receiver. so receiver change the TV source to previous source of input.and Turn OFF the TV input to previous position.

Automatic Home surveillance system using arduino(simple and cheap)

If the TV is ON that means the receiver sense that we watching TV. At that time some one press the calling button.Then the receiver section sounds the buzzer and then receiver simply change the TV source of input to where the camera receiver source of input is connected.now the TV show who is standing outside.If we know the person when we open the door then receiver get door opening signal from the transmitter.so receiver change the TV source of input to what we previously watched.

watch the video to better understanding of this project working and it will be useful.

Step 1: Block diagram of the project:

This project has two sections :

  • Receiver section
  • Transmitter section

Both transmitter and receiver section of this project circuit diagrams available in following step. now lets us see the function of each block in block diagram.

RECEIVER SECTION:

The heart of the receiver section is Arduino uno board. The arduino control other modules in the in receiver section:

  • IR remote control unit
  • relay module
  • status led
  • RF434 receiver module
  • LDR module
  • buzzer
  • wireless camera receiver.
  • The IR remote unit is used to control the TV using Arduino.This controlling of TV is done by using arduino programming. IR led should pointing towards TV ir receiver that means where you pointing your Tv remote to control TV.

The relay module is used to ON or OFF the wireless camera receiver power.

The status led is used to indicate the surveillance mode is ON or OFF.

if surveillance mode is ON the red led will glow.That means door is closed. door sensor data will send to receiver from transmitter using wireless data transfer.

if surveillance mode is OFF the blue led will glow.That means door is opened. door sensor data will send to receiver from transmitter using wireless data transfer.

The RF434 receiver module is used to receive the data from the RF434 transmitter module in transmitter section of this project.

The LDR module in the receiver section is used to detect whether TV is ON or OFF by arduino.

The buzzer is used to produce sound when some on press calling button outside. when some one press the calling button outside in surveillance mode then the arduino sounds the buzzer for few seconds.

The wireless camera receiver module is used to receive the wireless camera signal in the transmitter section of this project. it is powered by 9v adopter . adopter supply given through relay module to camera receiver. and camera receiver output is connected with TV’s AV3 port using AV cable.The TV dth connection for watching TV channels is connected in AV2 port of TV. (IF YOUR TV HAS ONLY TWO AV PORTS THAT IS LIKE AV1 AND AV2 THEN CONNECT THE TV CHANNEL DTH SETUP BOX CONNECTION TO AV1 AND WIRELESS CAMERA RECEIVER TO AV2 PORT OF YOUR TV )

 

TRANSMITTER SECTION:

The transmission section doesn’t have any micro controller. It has bellow section:

  • battery
  • RF434 transmitter
  • wireless camera
  • door sensor

The battery is used to power the wireless camera and RF434 transmitter module. we can use 9v battery to power the both. or use the 9v power supply adapter to power the both components.

RF434 transmitter module is used to transmit to receiver the data like door sensor status and calling bell status . and how to connect door sensor and calling bell switch to RF434 transmitter module circuit diagram given in the following steps.

wireless camera is used to capture the live video of outside door and transmit to camera receiver in side door.

Door sensors are just two wires to indicate that whether door is closed or open.

Step 2: Read the remote button code to control TV

At first we are going to read the remote buttons code using IRremote library file of arduino. So we can help arduino to control our TV automatically in main program which available in next step. use the IRremote library file in arduino software. if you don’t have IRremote library download from the attachment bellow.

After downloading it extract it and add it in the libraries folder of arduino software

Now take the IR receiver shown in above image (THIS IR RECEIVER IS FOR ONLY THIS STEP ALONE NOT FOR PROJECT)

  • CONNECT THE IR RECEIVER GND TO ARDUINO PIN 10
  • CONNECT THE IR RECEIVER Vs TO ARDUINO PIN 9
  • CONNECT THE IR RECEIVER OUT TO ARDUINO DIGITAL PIN 11

Then copy the code bellow and paste it arduino software and compile and upload it.then open serial monitor

Now take your TV remote and find the buttons indicated in red name in above image in your TVremote

The buttons selected for this project.

  • power button – on or off your tv
  • source of input button- to show list of input sources available in your tv(example: TV,AV1,AV2,AV3,VGA,.etc)
  • selection up button – to move selection up in the input source list in your TV by previous button pressing .
  • selection down button – to move selection down in the input source list in your TV.
  • ok button – to select the source input in your tv. like enter button.

find these button in your TV remote control by using image above shown

and press it one another one pointing towards the IR receiver connected in the arduino

Then the hex code for that button will be show in the serial monitor (example:40BFFA05)

Note down the which code is for which button in your remote for main program use in next step.

once you all done you are ready to move next step.

#include<IRremote.h>

int power_pin = 9;

int ground_pin = 10;

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

pinMode(power_pin,OUTPUT);

pinMode(ground_pin,OUTPUT);

Serial.begin(9600);

irrecv.enableIRIn(); // Start the receiver

digitalWrite(power_pin,HIGH);

digitalWrite(ground_pin,LOW);

}

void loop() {

if (irrecv.decode(&results)) {

Serial.println(results.value, HEX);

irrecv.resume(); // Receive the next value

}

}

Step 3: Program the surveillance system code to the arduino:

Once you read the remote button hex codes then now this is time to put main program code into arduino.

The bellow program is arduino program for this project automatic surveillance system. upload the bellow code to arduino.

before uploading the code put the your tv remote buttons hex code in corresponding position showed in the program using command line.and one more change is needed in program for adopt your remote for that follow the step given in between the code in multicommand line

#include<IRremote.h>

IRsend irsend;

int rf_data = 8;

int rf_input = 9;

int rf_power = 10;

int rf_ground = 11;

int red_led = 6;

int blue_led = 7;

int buzzer = 4;

int relay = 13;

int power = 14;

int ground = 16;

int state = 0;

void setup(){

pinMode(rf_data,INPUT);

pinMode(rf_input,INPUT);

pinMode(rf_power,OUTPUT);

pinMode(rf_ground,OUTPUT);

pinMode(red_led,OUTPUT);

pinMode(blue_led,OUTPUT);

pinMode(buzzer,OUTPUT);

pinMode(relay,OUTPUT);

pinMode(power,OUTPUT);

pinMode(ground,OUTPUT);

digitalWrite(rf_power,HIGH);

digitalWrite(rf_ground,LOW);

digitalWrite(power,HIGH);

digitalWrite(ground,LOW);

Serial.begin(9600);

}

void loop(){

int rf_state = digitalRead(rf_data);

if(rf_state == HIGH){

digitalWrite(blue_led,HIGH);

digitalWrite(red_led,LOW);

digitalWrite(buzzer,LOW);

digitalWrite(relay,LOW);

if (state == 1){

irsend.sendNEC(0x40BF28D7,67);// put your TV remote source of input button hex code in underlined area.

/*Another important thing in this project is to find the length of the hex code that is present in underlined number in the code:irsend.sendNEC(0x40BF28D7,67); The 67 is length of my tv remote hex code.This value differ based on the remote. To find this length value in your remote.simply connect the ir receiver as shown in the previous step to arduino. Then add the IR remote library to the arduino software. open the arduino software and goto file->examlpes->IRremote-> IRrecvDump . a code will be open upload the code to arduino and open serial monitor.Then press any one button of your TV remote pointing towards the IR receiver connected with arduino. then a length of values showed in the serial monitor. In that you can see that the RAW(value) .in that bracket near the RAW has value. That is the length of the hex code of your TV remote. example:RAW(67). note down the value and replace your TV remote length value instead of 67 in this code all place.Then you all done in code. you are ready to design circuit*/

delay(10);

irsend.sendNEC(0x40BFFA05,67);// put your TV remote selection up button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BFD22D,67);// put your TV remote OK button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BF48B7,67);// put your TV remote power button hex code in underlined area.

state = 0;

}

else if (state == 2){

irsend.sendNEC(0x40BF28D7,67);// put your TV remote source of input button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BFFA05,67);// put your TV remote selection up button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BFD22D,67);// put your TV remote OK button hex code in underlined area.

delay(10);

state = 0;

}

}

else if(rf_state==LOW){

digitalWrite(red_led,HIGH);

digitalWrite(blue_led,LOW);

int calling_button = digitalRead(rf_input);

if(calling_button == LOW){

digitalWrite(relay,HIGH);

digitalWrite(buzzer,HIGH);

delay(1000);

digitalWrite(buzzer,LOW);

int ldr = analogRead(A1);

if(ldr < 200){

irsend.sendNEC(0x40BF48B7,67); // put your TV remote power button hex code in underlined area.

delay(8500);

irsend.sendNEC(0x40BF28D7,67);// put your TV remote source of input button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BF2AD5,67);// put your TV remote selection down button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BFD22D,67);// put your TV remote OK button hex code in underlined area.

state = 1;

}else if(ldr >=200){

irsend.sendNEC(0x40BF28D7,67);// put your TV remote source of input button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BF2AD5,67);// put your TV remote selection down button hex code in underlined area.

delay(10);

irsend.sendNEC(0x40BFD22D,67);// put your TV remote OK button hex code in underlined area.

state = 2;

}

}

}

}

Automatic Home surveillance system using arduino(simple and cheap) Schematic

Step 4: Circuit diagram for receiver section

The first image is to show connection between the arduino and buzzer.

The second image is to show connection between the arduino and IR remote control unit.

The third image is to show connection between the arduino and LDR module.

The fourth image is to show connection between the arduino and Relay module.

The fifth image is to show connection between the arduino and RF434 receiver module.

The sixth image is to show connection between the arduino and status led module.

note:In some circuit diagram images the power supply and ground pins are connected with arduino IO pins connect the same circuit because those arduino pins programmed to act as power supply for that module.

special connection:

The wireless camera receiver module is used to receive the wireless camera signal which is in the transmitter section of this project. it is powered by 9v adopter . adopter supply given through relay module to camera receiver(it is shown in image 4). and camera receiver output is connected with TV’s AV3 port using AV cable.The TV dth connection for watching TV channels is connected in AV2 port of TV. (IF YOUR TV HAS ONLY TWO AV PORTS THAT IS LIKE AV1 AND AV2 THEN CONNECT THE TV CHANNEL DTH SETUP BOX CONNECTION TO AV1 AND WIRELESS CAMERA RECEIVER TO AV2 PORT OF YOUR TV )

 

For more detail: Automatic Home surveillance system using arduino(simple and cheap)


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top