How to Build Your Own Low-Cost Motion Sensor Alarm with Arduino in 10 Minutes


Building a motion sensor alarm with Arduino is an easy and inexpensive way to add security to your home or office. With just a few components, you can create a fully-functional alarm system that will detect movement and sound an alarm. In this guide, I will walk you through the entire process of assembling and coding a motion sensor alarm with Arduino in just 10 minutes.

Components Needed

To build the motion sensor alarm, you will need the following components:

Assembling the Circuit

Follow these steps to assemble the motion sensing alarm circuit:

  1. Connect the VCC pin of the PIR sensor to the 5V pin on the Arduino.

  2. Connect the GND pin of the PIR sensor to the GND pin on the Arduino.

  3. Connect the OUT pin of the PIR sensor to digital pin 2 on the Arduino.

  4. Connect the positive terminal of the buzzer to digital pin 3 on the Arduino.

  5. Connect the negative terminal of the buzzer to the GND pin on the Arduino.

  6. Insert the 9V battery into the Arduino to power it.

Coding the Arduino

With the circuit assembled, it's time to program the Arduino to activate the alarm when motion is detected:

  1. Open the Arduino IDE software on your computer.

  2. Import the Arduino tone library - This allows the buzzer to sound.

  3. Set pin 2 as the input pin from the PIR sensor.

  4. Set pin 3 as the output pin for the buzzer.

  5. Write code to detect a HIGH signal from the PIR sensor and activate the buzzer.

  6. Set the buzzer to sound in 1 second intervals to create an alarm tone.

  7. Upload the code to the Arduino Uno board.

Testing and Using the Alarm

After coding, follow these steps to test and use your DIY motion sensing alarm:

And that's it! In 10 minutes you can assemble a motion sensing alarm with Arduino. This simple project is the perfect introduction to Arduino and building security systems. With some additional sensors and code, you can expand this into a fully-featured home alarm system. The possibilities are endless!