About: I am a DIY hobbyist by passion and a Power Engineer by profession. Most of my works are related to Solar Energy and Arduino.

[ Play Video ]

In this project I will discuss how you can make a cheap wireless home security system.Though during starting of this project the main objective was only for security alarm but later I found this device can be used to solve several problems.These are the few practical problems which I have faced in the past :

1. Few years ago my friend's new bike was stolen from the parking premises of our apartment.

2. Mangoes are stolen from our garden.

3. One of my friend always worried for his new born baby when sleeping on a bed but no one is there to monitor him.

By modifying few things in my device you can solve all these problems very easily.

My device uses a PIR motion sensor to detect the human motion and this information is transmitted without wire by using a RF transmitter-receiver module to give some sort of alert.I choose a RF module for wire less communication because compared to the existing wireless systems like blue tooth,XBee or WiFi ,it is user friendly and very cheap.You can get it from eBay @ less than $ 2.

You could use IR, but that has a limited range and can only work within a line of sight of the receiver.But using the cheap RF module we can communicate within the range of around 100m.

At the end I will give you few tips to reduce the power consumption.

I divide the entire project in to 3 major parts;

1.TRANSMITTER : To sense the human motion and transmit the data to receiver

2. RECEIVER : Receive the data from transmitter and activate alarm system and camera or sending a sms etc

3.SOFTWARE : That operates the entire hardware used in this project.

You can see my new instructable ARDUINO MPPT SOLAR CHARGE CONTROLLER (version-3.0)


1. ARDUINO UNO/ARDUINO MINI/ARDUINO NANO or similar board (Tx) ( Amazon )

2. ARDUINO UNO /ARDUINO MINI/ARDUINO NANO or similar board (Rx) ( Amazon )

3. RF Transmitter and Receiver Module (433 MHZ) ( Amazon )

4. PIR sensor ( Amazon )

4. 9V battery ( 2 nos) and connectors

5. Buzzer ( Amazon )

6. LED ( Amazon )

7. Resistor -220 ohm ( Amazon )

8. Bread Board ( Amazon )

9. Jumper Wires ( Amazon )

10. perforated Board ( Amazon )

11. Header connectors ( Amazon )

12.Switches ( Amazon )

13. Project Enclosure

14. Black Paper

15. Scotch Mounting Pad ( Amazon )


1.Hobby Knife ( Amazon )

2.Glue Gun ( Amazon )

3.Soldering Iron ( Amazon )

4.Wire cutter /Stripper ( Amazon )

5.Tin Snips ( Amazon )


The transmitter is consists of

1. PIR sensor to detect the human motion

2.Arduino to process the data from PIR sensor

3. RF transmitter to transmit the data to the receiver

Passive infrared sensors work by measuring incoming infrared from human or animal. They do not emit energy themselves, which is why they are called "passive". Humans and animals both release infrared energy. Passive infrared sensors(sometimes called pyro electric detectors) detect this energy and give a signal to the ARDUINO.

For working of the PIR sensor you can click here

For transmitter I used a Arduino Nano board to reduced the cost. Of course your Arduino Uno also works fine.You can also use a Arduino mini Pro which cheaper than nano.As now I do not have a FTDI module to program the mini board I choose the nano board.

Before going to make the entire transmitter module check the PIR sensor and have a fun.

Connect the PIR sensor

PIR Pin Arduino Pin

vcc -----> 5v

GND . ......> GND

Out ........> D2

You can also refer the fritzing schematic.

Before uploading the code set the correct board and serial port in the Arduino IDE. Then upload the sketch given bellow.

In the software part I attached the pics for setting the board and serial port .Just check it.

When there is motion in front of the sensor the LED will glow.You can see the message also by opening your serial monitor.

Step 3: Connect the RF Transmitter

In the previous step you confirmed that your PIR sensor is working fine.Now lets add the RF transmitter to the board.

The RF transmitter has 3 pins( VCC, GND, and Data).

Connect the VCC pin to the 5V pin of the Arduino board that you are using (In my case it is Nano).

Connect the GND to the GND of the Arduino board.

Connect the data pin to the pin number 12 of the Arduino board.


The Receiver is consists of

1. RF Receiver module to receive data from transmitter

2. Arduino to process the data from RF Tx and give an out put (alarm,sms,email etc)

3. Out Put : buzzer

Connect the VCC pin to the 5V pin of the Arduino board that you are using (In my case it is Uno).

Connect the GND to the GND of the Arduino board.

Connect the data pin to the pin number 12 of the Arduino board.

Refer the above schematics for connection


The software is wholly depends on a virtual wire library.So first download it. Click here to download.

After downloading extract the folder and then place it in the Arduino library folder.

Software for Transmitter:

Before going to upload the sketch to the transmitter board, you have to set few things in the IDE

1.Board -> Arduino Nano (what board you have used)

2.Serial Port -> COM XX (check the com port in which your device is connected )

See the above picture for clear understanding.

After setting the above things,down the code wireless_tx and upload it.

Software for Receiver :

Similar to the above set the following for receiver board

1.Board -> Arduino UNO (what board you have used)

2.Serial Port -> COM XX (check the com port in which your device is connected)

See the above picture for clear understanding.

After setting the above things,down the code wireless_rx and upload it.

Note : The tone generation code is taken from MAKE PROJECTS


After uploading the code to both transmitter and receiver board ,now it is time to check whether every thing works correctly or not.

Remove the Usb cable from both the board

Provide external power (battery ) to the both the board.( positive terminal goes to Vin )

Then shake your hand in front of the PIR sensor.

If the buzzer in the receiver board starts to make noise then every thing works fine.

Now it is time to make a portable device for practical use.In the next two steps I will show you how to make a beautiful gadget for your home security.


Cut header connectors for arduino nano (15 pins 2nos ),PIR sensor (3 pins),RF transmitter (3 pins) and Power (2 pins).I used a tin snips to cut the header.

Solder the header according to the schematic.

Place the arduino nano board over the header and connect jumper wires to PIR sensor and RF transmitter.

Prepare the Enclosure

Make a circular hole in the enclosure to insert the PIR sensor.

Glue it to the surrounding in such a way that it will fix perfectly.

Make a rectangular hole to insert the power switch and glue it.

Wrap a color paper (black) on the front surface of the enclosure.I made this to hide everything inside the enclosure.

It also gives a better look to the device.

Place everything inside

I used scotch mounting pad to fix the perforated board and battery inside the enclosure.

Switch on the switch to check the power.


Bind the mini bread board and arduino uno by a rubber band

Place the RF receiver module on the bread board

Connect everything by jumper wires as per schematics

Prepare the Enclosure :

Mark a circle and rectangle on the front side of the enclosure.

Cut the marked portion.

Insert buzzer in the circular hole and switch in the rectangular hole.Then glue them.

Place every thing inside.I uses scotch mounting pad to hold the battery and board firmly.

After making the both modules,place the transmitter module to the location where you want to protect.I kept it at our parking place.The receiver module should be placed inside your room.

Step 9: How to Increase the Range

The range without antennae is very limited. Putting an antenna on only the TX or RX will greatly extend your range, but putting one on each will extend it even farther. Most of the people think the tiny spiral copper wire on the module is an antenna but in reality it is an inductor.

If you look carefully in to the RF transmitter and receiver module there is no external antenna included. A small hole "ANT" is provided in the module to solder an external antenna.

How to Calculate Antenna Length :

The way to calculate the antenna length is to divide the speed of light by the frequency to calculate the wavelength, and divide that by 4 to get a quarter length.

In my case the frequency is 433Mhz

Speed of the light is 3x10^8 m/s

Wavelength = Speed of light (c) / Frequency (f)

= ( 3x10^8) / (433x10^6)

= 0.69284 m

Antenna length = Wavelength /4

=0.69284/4 = 0.1732 m =17.32 cm or 6.82 inch

From the above calculation it comes out to about 17.3 cm or 6.8 inches. Just cut a piece of wire 6.8 inches long and solder it into that hole marked with ANT, on each module. putting the wires on there makes a great difference.


During the uploading of code,the board is powered by USB cable but when ever you want to use it in the real world,you need an external power is usually impractical to run long power cables out to the sensor’s location.So for external power supply battery is the best option I think.There are several types of battery exist in the market.So choose according to your choice.In this project I used 9V battery.A high capacity battery pack can be used for longer life.

Connecting a 9V battery directly to the arduino board is some what tricky.Connect the positive terminal of the battery to the Vin pin of the arduino and negative terminal of the battery to the GND pin of the arduino. After connecting the battery, I measured the voltage across 5v and GND pin it is 4.97v which is safe for our operation.

How many days you can run your system by using a 9V battery ? Hardly 2 to 3 days.The main power consuming element in the board is led for power indication and the voltage regulator.So how can you run this system for a month or year by using a smaller battery pack ??All these possible by using some additional hardware and software.

Power Optimization

Your module will run when the voltage level is sufficient. When the voltage in the pack drops below a certain threshold, the sensor system shuts down, even though there is still some remaining “juice” in the battery cells.

This little juice can be successfully extracted by using a boost converter.

If your transmitter module is exposed to sunlight then I think you are lucky.How ??

Because you can use a small solar panel to charge the battery pack.Though the amount of sunlight is a great factor but using a boost converter solved all these problems.

Step 11: Ideas to Take the Projects to a Higher Level

Though in this project I have just shown you to make some sound for alert but you can do lot of things by modifying few things in hardware and software.If you made this project successful then I think you can easily modify my device according to your requirement.

Use a relay instead of buzzer which can be used to



See the above schematics for relay connection.

Use a camera to take pictures when there is a motion and send it to your email.This can be used to monitor your sleeping baby :)

You can send sms to your mobile when there is a motion.Read the following article to get some idea.

Arduino SMS Alarm

You can read the following article to make email sending motion detector .


Hope you have enjoyed by reading my project.

Thank you for reading my article.

Suggestion are always welcome.Just comments it bellow...

Home Technology Contest

First Prize in the
Home Technology Contest

Remote Control Contest

Participated in the
Remote Control Contest

Epilog Challenge VI

Participated in the
Epilog Challenge VI

2 People Made This Project!


  • Clocks Contest

    Clocks Contest
  • Block Code Contest

    Block Code Contest
  • Baking Contest

    Baking Contest



3 years ago

Very nice project and thanks for sharing. I do have one remark. The receiver and transmitter suggested have a very poor range. Only 2-3 meters so you will need to find other solutions withe a better transmitting range


3 years ago

Can someone make an instructable on 12V car battery, couple of cameras pir sensors and recording to sd card? just the parts and how to put that together? I had many break ins and have only solar as no mains electric. Thanks.


Question 3 years ago on Introduction

But I want to buzzer on my mobile.
Please suggest how we can achieve.

Fahad Anwar
Fahad Anwar

5 years ago

Hello! can I use nrf24l01 transceiver (as it has long range) with the same configuration and coding?

Thank U.


5 years ago

Hello sir. I've made the project same as you. But the virtual wire library isn't working and i can't upload the code. So what can I do to fix it?

Thank you.


5 years ago

Hello Sir ..I've made the project in exactly the same way as it has been specified above..My PIR sensor is working and it is successfully indicating human motion by blinking LED.

But the transmitter and Receiver isn't working as the buzzer alarm isn't ringing.
Moreover there's no error in code as well and i've also installed Virtual Lib.
Please help !!


5 years ago

hi there - your instructable is pretty amazing. I have a situation where I need a customized security system, and I'm hoping this could be modified to do it.

I live in an apt, and whenever I go out, someone comes in and steals stuff. So far, my wallet, ID, banking info (which led to an ATM ripoff), and all kinds of personal items have been ripped. I have tried a cheap audio alarm, rekeying the locks, a code entry lock, but none of these have worked for me.

I have skimmed over your instructable, and from what I can see, it is the closest thing to what I need. I would like to put together something that would sense my door opening, take a picture of the offender (or a series of pictures), and email them (in real time, while it is happening) to me and to another mailbox. I would also like this proposed system to be inexpensive. Could this sytem do that ? If not could you tell me where could I go to get what I need ?


5 years ago

Hi ....
My question is can we transmitt two transmitter signals to only one reciver?????


6 years ago

Why did you not think to to generate an 'on_change' interrupt on the rising or falling edges of the PIR? Would have made battery operation a heck of a lot more practical because most of the time your Arduino could be in deep sleep. Looping constantly polling for the pin is so 1970. Also, I imagine the transmitter doesn't use much power when it isn't actually transmitting but you could further reduce your battery drain by only switching it on whilst the Arduino is awake. A typical PIR might only use 50µA so it would be fine but by removing the LEDs from the Arduino board and using the 'Lightweight low power library for Arduino.' you can get the whole lot running on a couple cells for a good few months if not longer.

Nice idea but could be much better. Have you thought of having multiple transmitters?


6 years ago

Hi, great project.
i like to ask u said that PIR motion sensor to detect the human motion right ? what about animals like cat ?


Reply 6 years ago

pir sensor also detect animal


6 years ago

we try to make smilar project and we need some help at some points.can you give us code of your project?


6 years ago

Great project! But I´m unable to download the wireless_rx_code.txt.....


6 years ago

i made it and it works great.... thanks a lot..!!!


6 years ago

what errors...? I'm not a coder.

when I run this it blocks out any other wireless devices I have.


6 years ago

Thanks for that tutorial. Can I have your email please? Mine is


6 years ago


I made this and it works great.....indoors.

but outdoors the pir sensor picks up spurious signals. I have it setup in my semi open car port at my mobile home (no direct sunlight). The idea is to detect "people only" coming into the carport.

any suggestions on how to make this work outside???