
DIY Security Systems
A motion sensor is the heart of your security system because it’s the main device that detects movement in your home when there shouldn’t be. A motion sensor uses one or various technologies to detect movement in a particular area. If a sensor is tripped, a signal will be sent to your security system’s control panel, which connects to your monitoring center to alert you and the monitoring center of a potential threat in your home. A motion sensor alarm can be a bit expensive but it is very effective for your home security. However, if you have patience and spare time, you can opt to learn how to make a motion sensor alarm system instead.
If you are constantly scared when people sneak up behind your back or you have bad hearing and can’t hear people approaching you, building your own motion sensor alarm using Arduino Uno might be a useful thing to do.
This simple motion alarm system alerts you whenever motion is detected around you. It uses Arduino Uno to control the PIR motion sensor, LED, and the speaker. This enclosed alarm system fits in a box from a deck of cards and is powered using the USB cord for the Arduino. To program the Arduino, you can make your own sketch or use the example below. This entire project will only take you a day or two, and it is easy enough that anyone can do it.
What You’ll Need
Not many materials are required to complete how to make a motion sensor alarm system. Here’s a complete list of what you’ll need:
Materials:
- An Arduino Uno
- Parallax PIR Sensor
- PC Board
- Assorted Wire
- Small Speaker
- Solder
- Card Box (optional)
- Spray paint
- Zip Ties (optional)
- LED of your choosing
Tools
- Wire Strippers
- Small Saw
- Drill or Drill Press
- Computer or laptop and Arduino USB cable
- Soldering iron
What to do
The first step on how to make a motion sensor alarm system is to put together the motion sensor. Open the sensor and the printed circuit board. You can cut it in half since you won’t need the whole thing and could still use the other half for other projects.
Once you have the sensors out of the packages, position the three pins from the sensor into the PCB. When you have it placed on the front row, solder it to the board. Make sure to solder on the side with the metal pads, and not on the blank side.
When soldered on completely, try to look closely at the pins. Above them, you should see “VCC” “GND” and “OUT.” Plugin the +5V in the VCC while the GND should go to the ground, and the OUT should go to digital pin 7 on the Arduino.
When completed, solder the three wires directly behind where you soldered the three pins. On the base of the board, you should have 6 solder points. Turn these into 3 and connect each pin to a wire you just soldered. Ensure the wires you solder on are long enough to position the motion sensor where you want it, whether it is next to you or across the room.
The next step on how to make a motion sensor alarm system is setting up the Arduino Uno. Connect the wire of the sensor’s GND to the Arduino. Then, connect the VCC to the +5V on the Arduino while connecting the OUT to pin #7.
At this time, grab your LED and speaker. Connect the + of your speaker to pin #9 and the – to ground. Subsequently, connect the long part of the LED to pin #13 and the shorter one to the ground right next to pin #13.
For the Arduino sketch, you can make your own or copy and paste the sample below into your Arduino IDE:
/* Motion Sensor Sketch by Tommy Hill ([email protected])
VCC connected to +5V
GND connected to ground
OUT connected to digital pin 7
*/
int outpin = 7;
int led = 13;
void setup() {
pinMode(led, OUTPUT);
pinMode(outpin, INPUT);
pinMode(9, OUTPUT);
}
void loop ()
{
if (digitalRead(outpin) == LOW)
{
digitalWrite(led, LOW);
}
if (digitalRead(outpin) == HIGH)
{
digitalWrite(led, HIGH);
beep(50);
}
}
void beep(unsigned char delayms){
analogWrite(9, 20); // Almost any value can be used except 0 and 255
// experiment to get the best tone
delay(delayms); // wait for a delayms ms
analogWrite(9, 0); // 0 turns it off
delay(delayms); // wait for a delayms ms
}
Upload the sketch above to your board and plug it in your Arduino. If you have the sensor, speaker, and LED correctly connected, you should see the light and hear some buzzing. It is normal, even if there isn’t any motion. After 15 seconds after you turn it on, the PIR Sensor will calibrate and it will make the buzzer go off.
If you want something a flashier than an Arduino sitting on your desk, you won’t need much to make it look appealing. All you need is a card box and spray paint with your preferred color. Just cut all of the spaces required for your wires and things out and in. After all the necessary holes are cut, paint the box with whatever color you want to make it look pleasing. Find out more about Door Sensors.
Wrap Up
After closing your enclosure up, pat yourself on the back. You have completed the process on how to make a motion sensor alarm system. Now you’ll be more confident knowing that when someone sneaks up your property, you will be alerted by the alarm.
Motion sensors aren’t just an extra feature of a security system—they are essential. Without them, there wouldn’t be a way to detect intruders. These sensors also give you peace of mind because you know you’re property is safe and secured.