Parent-Child STEM DIY: Build an Arduino PIR Motion Alarm (2026)
Share
Looking for a simple Arduino project to build with your child? In this beginner-friendly STEM DIY project, we use an Arduino Uno, HC-SR501 PIR motion sensor, 3-pin active buzzer module and LED to make a simple motion alarm.
No soldering is required. The project mainly uses a breadboard and jumper wires, making it suitable for Arduino beginners and parent-child STEM activities. When the sensor detects movement, the Arduino activates the buzzer and turns on the LED.
Estimated time: About 30–45 minutes, depending on age and experience
Suggested age: 8+, with adult supervision
🧰 What You Need
- Arduino Uno R3 × 1
- USB cable × 1
- HC-SR501 PIR motion sensor × 1
- 3-pin active buzzer module × 1
- LED × 1
- 220Ω resistor × 1
- Breadboard × 1
- Jumper wires
This project uses a 3-pin active buzzer module, rather than a simple two-pin bare buzzer. The module used for this project is a low-level trigger type.
🔌 Wiring
Before wiring, disconnect the Arduino USB cable. After all connections are made, check the VCC, GND and signal connections and make sure there are no shorts before connecting USB power.

👀 Understanding the HC-SR501: Sensitivity and Delay Adjustments
The HC-SR501 has a white Fresnel lens, two adjustment knobs and, on many versions, an H/L trigger-mode selector.
① Sensitivity / Detection Distance
This adjustment controls the sensor's sensitivity and detection range.
Tip:
If the detection range is too large or the sensor triggers too easily, try reducing the sensitivity. If the detection range is too short, gradually increase it. Actual performance depends on the environment, installation position and the individual module.
② Time Delay
This adjustment controls approximately how long the sensor output remains active after motion is detected.
A longer delay keeps the alarm response active for longer.
③ Trigger Mode: H / L
Some HC-SR501 versions provide two trigger modes:
- H (Repeatable Trigger): the output can be retriggered while motion continues.
- L (Non-repeatable Trigger): the output remains active for the set period without restarting the timing during that period.
For beginners, we recommend keeping the module's original setting while completing the basic wiring and test first.
HC-SR501 PIR Motion Sensor
- VCC → Arduino 5V
- GND → Arduino GND
- OUT → Arduino D7
3-Pin Active Buzzer Module
- VCC → Arduino 5V
- GND → Arduino GND
- I/O / Signal → Arduino D8
External LED
- Arduino D13 → 220Ω resistor → LED long leg (positive)
- LED short leg (negative) → Arduino GND
You can also use the Arduino Uno's built-in LED on D13 instead of an external LED.

🛠️ Actual Project Build
Here is the actual project during wiring and testing. The real project photo shows how the Arduino, breadboard, PIR sensor, buzzer and LED are physically assembled.

🎥 Real Test: See the Motion Alarm in Action
After uploading the program, you can test the motion detection. When the HC-SR501 detects movement, its OUT signal goes HIGH. The Arduino then drives D8 LOW to activate the low-level-trigger buzzer, while D13 turns the LED on.
Real test video: showing the buzzer and LED response when motion is detected.
💻 Arduino Code
The following code is written for the low-level-trigger active buzzer module used in this project. When the PIR sensor outputs HIGH, the Arduino sets D8 LOW to activate the buzzer.
const int pirPin = 7;
const int buzzerPin = 8;
const int ledPin = 13;
void setup() {
pinMode(pirPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int motion = digitalRead(pirPin);
if (motion == HIGH) {
digitalWrite(buzzerPin, LOW); // Low-level trigger: ON
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(buzzerPin, HIGH); // OFF
digitalWrite(ledPin, LOW);
}
}
🔍 How Does It Work?
The HC-SR501 is a PIR (Passive Infrared) motion sensor module. It does not identify a person. Instead, it detects changes in infrared radiation in its surroundings. When a person or another heat source moves and causes an infrared change, the module outputs a signal through its OUT pin.
- The HC-SR501 detects movement.
- Its OUT pin goes HIGH.
- The Arduino detects HIGH on D7 and sets D8 LOW.
- Because the buzzer module is low-level triggered, it sounds.
- D13 also goes HIGH and the LED turns on.
⏱️ Why Can the Sensor Trigger Randomly at First?
After first power-up, the HC-SR501 normally needs a short initialization period. During roughly the first 30–60 seconds, the sensor may behave less consistently or produce false triggers. This can be normal during startup.
👨👩👧 What Can Children Learn From This STEM Project?
- Basic electronics: Learn about VCC, GND, signal connections and LED polarity.
- Arduino basics: Understand digital input and digital output.
- Sensor principles: Learn how PIR sensors detect changes in infrared radiation.
- Programming logic: Practise if / else, digitalRead() and digitalWrite().
- Troubleshooting: Learn to check power, wiring and program logic.
💡 Ideas for Further Projects
- Add an LCD to display the motion status.
- Use an ESP32-C3 to explore Wi-Fi and mobile notifications.
- Add a reed switch to build a simple door or window alert.
- Modify the program to add delays, timers or different alarm logic.
⚠️ DIY Safety Tips
- Under normal operation, this project uses low-voltage DC power and does not involve mains wiring.
- Disconnect the Arduino USB cable before wiring. Check VCC, GND and possible shorts before powering the circuit.
- Children should carry out the project with adult supervision and have the wiring checked before power is connected.
- Keep small electronic parts away from young children to reduce the risk of accidental swallowing.
- The buzzer can be loud. Do not place it close to the ears during testing.
❓ Frequently Asked Questions
Q1: Do I need an external LED?
No. The Arduino Uno already has a built-in LED on D13, which can be used as the status indicator. Add an external LED and 220Ω resistor if you want a more visible result.
Q2: Why does the buzzer turn on when the Arduino output is LOW?
The active buzzer module used in this project is a low-level-trigger design. It activates when D8 outputs LOW and turns off when D8 outputs HIGH. Other buzzer modules may use different trigger logic, so check the actual module before wiring or coding.
Q3: Does the HC-SR501 recognise a person?
No. It detects changes in infrared radiation. Movement from a person can create the infrared change that the PIR sensor detects, but the module is not performing person identification.
Q4: Why does the sensor sometimes behave strangely just after power-up?
The HC-SR501 normally needs a short initialization period. Temporary instability or false triggers during the first roughly 30–60 seconds can occur, so allow the sensor to settle before testing.
🏪 Looking for Arduino STEM DIY Components?
If you need Arduino boards, PIR sensors, buzzer modules, LEDs, breadboards or other STEM / DIY electronics components, you can visit Sun Cheong Computer on Apliu Street in Sham Shui Po, Hong Kong.
Sun Cheong Computer Co., Ltd.
G/F, 246 Apliu Street, Sham Shui Po, Kowloon, Hong Kong
WhatsApp: +852 9319 5163
Conclusion
This Arduino PIR motion alarm is a simple STEM DIY project with an immediate, visible result. From wiring the sensor to reading its input and controlling the buzzer and LED, beginners can see how an Arduino takes sensor data and turns it into an action.
For a parent-child DIY activity, the most satisfying part is seeing the result immediately: when movement is detected, the buzzer sounds and the LED lights up.