Whether you want to deter intruders or just get notified when someone enters a room, a motion sensor alarm is a useful home security project. With an Arduino microcontroller, a passive infrared (PIR) motion sensor, and a few other components, you can build your own alarm that detects movement and sounds an audible warning. Best of all, it requires minimal soldering and can be assembled in under 10 minutes.

What You'll Need

To build the motion sensor alarm, you'll need the following parts:

Optional components include an LED to visually indicate motion detection and a switch to arm/disarm the alarm.

Circuit Design

The circuit for the motion sensor alarm only requires connecting four components:

The PIR sensor acts as an input, while the buzzer is an output. No coding or soldering is required other than plugging components into the breadboard!

Adjusting Settings

The PIR sensor has two adjustable controls:

For most applications, medium sensitivity and a 1-second delay will suffice. Test with different settings to fit your needs.

Uploading the Code

With the circuit complete, upload this simple Arduino sketch:

```cpp
const int pirPin = 2; // PIR Out pin
const int buzzer = 3; // Buzzer pin

void setup() {
pinMode(pirPin, INPUT);
pinMode(buzzer, OUTPUT);
}

void loop() {
if (digitalRead(pirPin) == HIGH) {
digitalWrite(buzzer, HIGH); // Sound alarm
delay(1000); // Delay 1 second
digitalWrite(buzzer, LOW); // Stop alarm
}
}
```

This initializes the pins, reads the PIR sensor pin, and triggers the buzzer for 1 second when motion is detected. Adjust the delay as needed.

Testing and Usage

Once programmed, power up the Arduino and move around in front of the PIR sensor. The buzzer should sound each time you are detected!

Position the sensor facing a door or area you want to monitor. Adjust the sensitivity and delay as needed to avoid false alarms.

The alarm will sound continuously for 1 second whenever motion is detected. To disable it, simply unplug the battery or flip the power switch.

And that's it! With just a few components and no soldering, you now have a working motion sensor alarm for your home security.

Going Further

To take this project further:

With the power of Arduino, there are many possibilities for customizing and enhancing this motion sensing alarm to fit your needs!