DIY Perimeter Alarm To Protect Your Home & Camp
Do you want to keep your home and camp safe from intruders? Well, luckily, there is an easy way to do that— by installing a perimeter alarm! Installing a perimeter alarm can help provide an extra layer of protection for your property, to make sure you and your family are safe. Here, we will explain how to build a simple DIY perimeter alarm system that will work as a warning system whenever someone or something tries to enter your property.
What You’ll Need
- 1x Arduino Uno board
- 1x proto board
- 1x breadboard
- 1x relay module
- 1x buzzer (preferably a piezo buzzer)
- Some jumper wires
Assembling the Components
The first step is to assemble the Arduino board, relay module and buzzer onto the proto board. Connect the components as per the diagram given below:
Coding The Arduino
Now that we have assembled the components, the next step is to code the Arduino. We’ll be using the Arduino IDE for this purpose. The code is given below. It is important to note that the code must be uploaded to the Arduino board in order for the alarm system to work properly.
#define PIN_RELAY 2 // Pin connected to relay
#define PIN_BUZZER 9 // Pin connected to buzzer
#define ADD_SENSOR 0x29 // Address of PIR motion sensor
int state = LOW; // Store the current state of the Sensor
Wire.begin(); // Initialize I2C communication
pinMode(PIN_RELAY, OUTPUT); // Set the pin connected to the relay as Output
pinMode(PIN_BUZZER, OUTPUT); // Set the pin connected to the buzzer as Output
Wire.requestFrom(ADD_SENSOR, 1); // Request a data from the Motion Sensor
// Read the status of the Motion Sensor
if (Wire.read() == HIGH)
digitalWrite(PIN_RELAY, HIGH); // Turn the relay on
tone(PIN_BUZZER, 500, 1000); // Make the buzzer sound for 1 second
digitalWrite(PIN_RELAY, LOW); // Turn the relay off
delay(500); // For stability
Installing the Alarm
Once the components have been assembled and the code uploaded to the Arduino board, it is time to install the alarm system. Place the Arduino board, relay module, and buzzer along the outer perimeter of your home or camp. Connect the motion sensor to the Arduino board and you’re done!
You now have a DIY perimeter alarm system to protect your home and camp. Whenever the motion sensor detects an intruder, the relay module will turn on the buzzer, giving you the warning you need to act on the threat.