A motion sensor alarm watches a room with a PIR sensor and sounds a buzzer when something warm moves in front of it. You can build one in about an hour with three parts: a PIR motion sensor to notice people, a small computer to decide, and a buzzer and a light to raise the alarm. This guide builds that alarm on the MakerBuddy board with two no-code rules. One rule beeps and flashes red while there is movement. The other turns the buzzer off and shows green when the room is quiet.
You will also find where to put the sensor, how to arm it, four upgrades and a test checklist. This is a learning build, a burglar alarm project for a desk or classroom, not real home security.
How a motion sensor alarm works
Every security alarm system has the same three jobs. Wikipedia's article on security alarms (opens in a new tab) names the parts: sensors detect an intruder, a control panel reads the sensors and tracks whether the system is armed, and alerting devices such as sirens show that something is wrong. Your room alarm has the same three parts, only smaller.
| Job | In a home security system | In your room alarm |
|---|---|---|
| Notice | Several sensors, such as motion detectors | One PIR motion sensor (HC-SR501) |
| Decide | A control panel with a keypad | The ESP32 on the MakerBuddy board, running two rules |
| Warn | A siren, a strobe light, a call to a monitoring centre | The buzzer and the colour light |
- Job
- Notice
- In a home security system
- Several sensors, such as motion detectors
- In your room alarm
- One PIR motion sensor (HC-SR501)
- Job
- Decide
- In a home security system
- A control panel with a keypad
- In your room alarm
- The ESP32 on the MakerBuddy board, running two rules
- Job
- Warn
- In a home security system
- A siren, a strobe light, a call to a monitoring centre
- In your room alarm
- The buzzer and the colour light
PIR stands for passive infrared. Anything warm, including you, gives off infrared light that eyes cannot see. The PIR takes no pictures. It notices when the pattern of warmth in front of it changes, and switches its output pin on. Adafruit's PIR overview (opens in a new tab) says PIRs are almost always used to detect whether a person has moved in or out of range. Our guide to how a PIR motion sensor works, its range and its settings explains the inside of the sensor in detail.

Parts list for the room security alarm
Everything below is part of the MakerBuddy IoT Kit V1.0. The board comes in purple or green; both colours are the same board.
| Part | Where it goes | Its job | Needed? |
|---|---|---|---|
| HC-SR501 PIR motion sensor | Plug-in socket marked 18 (GPIO 18) | Notices a warm body moving | Yes |
| Buzzer | Built into the board (GPIO 4) | Beeps while the alarm is on | Yes |
| Colour light (RGB) | Built into the board | Red for alarm, green for all clear | Yes |
| A laptop, iPhone or iPad | On the same 2.4 GHz Wi-Fi as the board | Creates the rules, arms and disarms | Yes |
| 1602 text screen | Plug-in socket (I2C) | Shows a message that stays after the alarm | Upgrade |
| Light sensor (LDR) | Built into the board (GPIO 35) | Makes a night-only alarm | Upgrade |
| HC-SR04 distance sensor | Plug-in socket (trig 15, echo 2) | Double-checks a doorway | Upgrade |
- Part
- HC-SR501 PIR motion sensor
- Where it goes
- Plug-in socket marked 18 (GPIO 18)
- Its job
- Notices a warm body moving
- Needed?
- Yes
- Part
- Buzzer
- Where it goes
- Built into the board (GPIO 4)
- Its job
- Beeps while the alarm is on
- Needed?
- Yes
- Part
- Colour light (RGB)
- Where it goes
- Built into the board
- Its job
- Red for alarm, green for all clear
- Needed?
- Yes
- Part
- A laptop, iPhone or iPad
- Where it goes
- On the same 2.4 GHz Wi-Fi as the board
- Its job
- Creates the rules, arms and disarms
- Needed?
- Yes
- Part
- 1602 text screen
- Where it goes
- Plug-in socket (I2C)
- Its job
- Shows a message that stays after the alarm
- Needed?
- Upgrade
- Part
- Light sensor (LDR)
- Where it goes
- Built into the board (GPIO 35)
- Its job
- Makes a night-only alarm
- Needed?
- Upgrade
- Part
- HC-SR04 distance sensor
- Where it goes
- Plug-in socket (trig 15, echo 2)
- Its job
- Double-checks a doorway
- Needed?
- Upgrade
You also need a micro-USB cable and a 5 V USB charger. On a laptop, use Chrome, Edge or Firefox with the free MakerBuddy extension, or Safari on a Mac. On an Android phone, use the free MakerBuddy app from Google Play.
The kit's buzzer plays one tone. It is a beeper, not a siren. Why some buzzers play tunes and others only beep is explained in active vs passive buzzers and how to tell them apart.
Plan the alarm before you build it
Plan on paper first: write what should happen in each situation, then turn each line into a rule.
IF motion is true THEN flash red and beep, again and again (Rule 1: Intruder)
IF motion is false THEN buzzer off, light green (Rule 2: AllClear)Why two rules? A MakerBuddy rule has no ELSE box. "Otherwise, stop the alarm" has to be its own rule with the opposite test. Week 28's gas alarm uses the same pair, an alarm rule and an all-clear rule, in Smart Safety Systems. The guide to if-then statements explained with real sensors shows the same idea with other sensors.
Both rules use the Condition loop mode. A Condition rule watches its sensor test and runs while the test is true. It needs the test to stay true for 0.3 seconds before it starts. When the test turns false, it finishes the round it is in, then stops. These rules run on the board itself, so the alarm keeps working after you close the dashboard. The rules section of the technical details explains this in full.

Worked example: build the alarm with two no-code rules
Step 1: plug in the sensor and let it settle
- 1
Unplug the USB cable. Plug the PIR into the three-pin socket marked 18. It fits only one way, so never force it.
- 2
Plug the USB cable back in and open the dashboard.
- 3
Wait one full minute before you test anything. The HC-SR501 datasheet (opens in a new tab) says the module needs about a minute after power-on and may switch its output on up to three times while it settles.
- 4
Sit still and watch the Motion Sensor card. It should show None. Wave your hand: it should change to Motion within about 3 seconds.
Week 13, Security Sensing teaches this part, and its Try It demo lets you practise in the browser before you touch the hardware.
Step 2: set the two knobs on the back of the PIR
The HC-SR501 has two small knobs. In class, ask your teacher before you turn them.
- Time knob: sets how long the PIR output stays on after it sees movement. The datasheet's adjustment notes give about 5 seconds fully anticlockwise and about 300 seconds fully clockwise. Start with it fully anticlockwise, so tests are quick.
- Sensitivity knob: sets how far it reaches, about 3 metres anticlockwise to about 7 metres clockwise, according to the same HC-SR501 datasheet (opens in a new tab). Start in the middle.
Leave the trigger jumper on H. On H, every movement restarts the timer, so the output stays on while someone keeps moving.
The time knob decides how long your alarm rings, because the rules keep beeping while the PIR output is on.
Step 3: Rule 1, the Intruder alarm
Open the Rule Engine tab and create a rule:
- Name:
Intruder - Loop Mode: Condition
- Sensor: Motion Sensor, Operator: Equal to (==), Threshold: True
Add four steps:
| Step | Action | Delay (ms) | Why |
|---|---|---|---|
| 1 | RGB Red | 0 | The light turns red at once |
| 2 | Buzzer On | 500 | Beep for half a second |
| 3 | Buzzer Off | 0 | Stop the beep |
| 4 | RGB Off | 500 | Dark and quiet for half a second |
- Step
- 1
- Action
- RGB Red
- Delay (ms)
- 0
- Why
- The light turns red at once
- Step
- 2
- Action
- Buzzer On
- Delay (ms)
- 500
- Why
- Beep for half a second
- Step
- 3
- Action
- Buzzer Off
- Delay (ms)
- 0
- Why
- Stop the beep
- Step
- 4
- Action
- RGB Off
- Delay (ms)
- 500
- Why
- Dark and quiet for half a second
Save Rule. One round takes 1 second. While motion is still true at the end of a round, the rule runs it again, so the alarm flashes and beeps once a second.
The round ends quiet on purpose. In a rule, Buzzer On keeps the buzzer on until a Buzzer Off step, as the automation rules documentation notes. Ending every round quiet means the alarm cannot get stuck beeping when the rule stops.
Step 4: Rule 2, the AllClear rule
Create a second rule:
- Name:
AllClear - Loop Mode: Condition
- Sensor: Motion Sensor, Operator: Equal to (==), Threshold: False
| Step | Action | Delay (ms) | Why |
|---|---|---|---|
| 1 | Buzzer Off | 0 | A safety net: the buzzer is always silenced |
| 2 | RGB Green | 500 | Green means armed and quiet |
- Step
- 1
- Action
- Buzzer Off
- Delay (ms)
- 0
- Why
- A safety net: the buzzer is always silenced
- Step
- 2
- Action
- RGB Green
- Delay (ms)
- 500
- Why
- Green means armed and quiet
Save Rule. While nobody moves, this rule runs every half second and keeps the light green.
Keep its wait short. When someone walks in, AllClear finishes its round and holds the colour light until its wait ends, so a 5-second wait could delay your alarm by 5 seconds.
Step 5: predict, then walk in
Predict what will happen before you test it. With the time knob fully anticlockwise, the timings come out like this:
| Time | What happens |
|---|---|
| 0 s | You walk across the sensor's view. The PIR output switches on |
| 0 to 1 s | The board reads the motion sensor, once a second |
| 0.3 to 1.8 s | The 0.3-second check passes, AllClear finishes its last wait, and Intruder starts: red and beeping |
| While you move | The output stays on, so the alarm keeps beeping once a second |
| About 5 s after you stop | The PIR output switches off |
| Up to 2.3 s later | The board sees False, Intruder finishes its round, AllClear turns the light green |
- Time
- 0 s
- What happens
- You walk across the sensor's view. The PIR output switches on
- Time
- 0 to 1 s
- What happens
- The board reads the motion sensor, once a second
- Time
- 0.3 to 1.8 s
- What happens
- The 0.3-second check passes, AllClear finishes its last wait, and Intruder starts: red and beeping
- Time
- While you move
- What happens
- The output stays on, so the alarm keeps beeping once a second
- Time
- About 5 s after you stop
- What happens
- The PIR output switches off
- Time
- Up to 2.3 s later
- What happens
- The board sees False, Intruder finishes its round, AllClear turns the light green
The 1-second read, the 0.3-second check and the finish-the-round behaviour come from the rules section of the technical details. The 5-second figure assumes the datasheet's shortest on-time, so time your own sensor.
Where to put the sensor in a room
A PIR notices people walking across its view far more easily than people walking straight towards it. The HC-SR501 datasheet (opens in a new tab) says that walking straight at it can leave the sensor "insensitive or does not work", and asks you to mount it so people pass from side to side.
| Situation | What the datasheet gives | What to do |
|---|---|---|
| How far it sees | Within 7 m; the knob sets about 3 m to 7 m | A bedroom or classroom, not a sports hall |
| How wide it sees | Under 120 degrees (page 1), at most 110 degrees (page 4) | Aim it across the room, not at a wall |
| Hot rooms | Range gets slightly shorter at 30 to 32 °C | Expect less range in a hot summer room |
| Lights and moving air | Can cause false signals | Keep it away from lamps, heaters, fans and vents |
- Situation
- How far it sees
- What the datasheet gives
- Within 7 m; the knob sets about 3 m to 7 m
- What to do
- A bedroom or classroom, not a sports hall
- Situation
- How wide it sees
- What the datasheet gives
- Under 120 degrees (page 1), at most 110 degrees (page 4)
- What to do
- Aim it across the room, not at a wall
- Situation
- Hot rooms
- What the datasheet gives
- Range gets slightly shorter at 30 to 32 °C
- What to do
- Expect less range in a hot summer room
- Situation
- Lights and moving air
- What the datasheet gives
- Can cause false signals
- What to do
- Keep it away from lamps, heaters, fans and vents
All four rows come from the HC-SR501 datasheet (opens in a new tab), which disagrees with itself on the angle, so test your own room.
The best spot is a side wall or shelf near the door, looking across the doorway, so anyone who enters crosses its zones. Avoid facing the door from across the room, sitting above a heater or fan, or pointing at a sunny window. Adafruit (opens in a new tab) adds that PIRs are sometimes set off by pets, so keep the cat out of the test.

Test checklist: prove your alarm works
A Wikipedia summary of a US Department of Justice estimate (opens in a new tab) says that 94% to 98% of alarm calls to police are false alarms. The same article says system reliability and user error cause most false alarms. An alarm nobody trusts is useless, so test yours properly. Do each test, write down what happened and tick it only when it passes.
| No. | Test | How | Pass when |
|---|---|---|---|
| 1 | Warm-up | Power on, wait 60 s without moving | No alarm after the first minute |
| 2 | Quiet room | Leave the room still for 2 minutes | The light stays green, no beeps |
| 3 | Walk in | Walk across the doorway at normal speed | Red and beeping within about 2 seconds |
| 4 | Alarm stops | Stand still out of view | Green again within about 10 seconds |
| 5 | Straight approach | Walk slowly straight at the sensor from 4 m | Note the distance where it triggers |
| 6 | Range | Cross the room at 1 m, 3 m and 5 m | Note the farthest that works |
| 7 | Slow creep | Cross the view very slowly | Note whether it notices you |
| 8 | Dashboard closed | Close the dashboard, walk in | It still beeps: rules run on the board |
| 9 | Power cut | Unplug, plug back in, wait a minute, walk in | It beeps again: rules are saved on the board |
| 10 | Disarm | Stop the Intruder rule, walk in | No alarm |
- No.
- 1
- Test
- Warm-up
- How
- Power on, wait 60 s without moving
- Pass when
- No alarm after the first minute
- No.
- 2
- Test
- Quiet room
- How
- Leave the room still for 2 minutes
- Pass when
- The light stays green, no beeps
- No.
- 3
- Test
- Walk in
- How
- Walk across the doorway at normal speed
- Pass when
- Red and beeping within about 2 seconds
- No.
- 4
- Test
- Alarm stops
- How
- Stand still out of view
- Pass when
- Green again within about 10 seconds
- No.
- 5
- Test
- Straight approach
- How
- Walk slowly straight at the sensor from 4 m
- Pass when
- Note the distance where it triggers
- No.
- 6
- Test
- Range
- How
- Cross the room at 1 m, 3 m and 5 m
- Pass when
- Note the farthest that works
- No.
- 7
- Test
- Slow creep
- How
- Cross the view very slowly
- Pass when
- Note whether it notices you
- No.
- 8
- Test
- Dashboard closed
- How
- Close the dashboard, walk in
- Pass when
- It still beeps: rules run on the board
- No.
- 9
- Test
- Power cut
- How
- Unplug, plug back in, wait a minute, walk in
- Pass when
- It beeps again: rules are saved on the board
- No.
- 10
- Test
- Disarm
- How
- Stop the Intruder rule, walk in
- Pass when
- No alarm
Tests 5 to 7 echo the Red Light, Green Light challenge from Week 13. Write the results down: they show the alarm's weak spots.
How to arm and disarm the alarm
A real alarm has a keypad. Yours has the Rule Engine tab.
- To disarm: press Stop on the Intruder rule. The alarm stops watching. A stopped rule stays stopped after a power cut, until someone starts it again.
- To arm: press Start on the Intruder rule. On firmware 2.10, Start sends a Condition rule back to watching, and it runs once motion is true.
- Leave AllClear running all the time. Pressing Stop never switches outputs off, so if you stop Intruder in the middle of a beep, the buzzer could stay on. AllClear switches it off as soon as nobody is moving.
While a rule watches, the dashboard locks the cards for the parts it uses, so you cannot fight the rules by hand. AllClear also uses the buzzer and the colour light, so their cards stay locked while it runs, even after you stop Intruder.
The exit-delay problem
Real alarms give you time to leave after you arm them. This one does not: press Start in the room and it sees you walk out. Arm it from outside the door instead, on an iPhone, iPad or laptop on the same Wi-Fi. The board also has no clock, so it cannot arm itself at 10 pm; the night-only upgrade uses darkness instead.
Four upgrades for your burglar alarm project
Each upgrade changes the tests or adds a step. AllClear must always be the exact opposite of Intruder. Otherwise there will be moments when neither rule runs, or when both do.
Night-only alarm with the light sensor
Cover the light sensor with your hand and read the Light Level card, for example 15. Read it again in normal light, for example 70. Pick a number between them, such as 30.
- Intruder: Motion Sensor equal to True, then tick Add a second sensor, choose AND, and add Light Level (LDR) less than 30.
- AllClear: Motion Sensor equal to False, OR Light Level (LDR) at least (>=) 30.
The opposite of "motion AND dark" is "no motion OR bright". That swap is De Morgan's law, and the guide to visual programming for hardware and how no-code rules teach real logic works through it. Week 27, Range Logic and Multiple Sensors is the lesson for two-sensor rules.
Double-check the doorway with the distance sensor
Aim the HC-SR04 across the doorway, like an invisible tripwire. Read the Distance card with nobody there, for example 90 cm. Someone in the doorway will read less, so pick a number clearly below it, such as 70.
- Intruder: Motion Sensor equal to True AND Distance (HC-SR04) less than 70.
- AllClear: Motion Sensor equal to False OR Distance (HC-SR04) at least 70.
Now both sensors must agree. Wikipedia's article on motion detectors (opens in a new tab) describes dual-technology sensors that work the same way: both must trip together, which lowers the chance of a false alarm. The downside: fool either sensor and the alarm stays quiet. The HC-SR04 measures 2 cm to 400 cm, according to its datasheet (opens in a new tab), and the guide to how an ultrasonic sensor measures distance with sound covers it.
A message that stays on the screen
Plug in the 1602 text screen and add a fifth step to Intruder: LCD Display, Custom Text, line 1 INTRUDER ALERT, line 2 Check the room. Both fit the screen's 16 columns.
The message stays after the alarm stops, so you know it went off while you were out. A screen step shows no Delay box, but the dashboard still gives a new step a 1-second wait, so the beat can slow to one beep every 2 seconds. Time one round to check. To clear the message, stop Intruder, then choose Default on the LCD card. With no clock, the board cannot say when it happened, so keep a logbook, like the Intruder Alert idea in the MakerBuddy project idea library. Week 19, Visual Output teaches the screen.
Silent alarm
Delete the buzzer steps from Intruder and keep the red flashing. You see that someone came in, and they never know.
| Version | Extra part | Intruder test | AllClear test | What it teaches |
|---|---|---|---|---|
| Basic alarm | None | Motion = True | Motion = False | Condition rules, clean-up steps |
| Night-only | Light sensor (built in) | Motion = True AND Light < 30 | Motion = False OR Light >= 30 | AND, OR and opposites |
| Doorway double-check | HC-SR04 | Motion = True AND Distance < 70 | Motion = False OR Distance >= 70 | Two sensors agreeing, false alarms |
| Message alarm | 1602 text screen | Motion = True | Motion = False | Memory of an event |
| Silent alarm | None | Motion = True | Motion = False | Designing for the user |
- Version
- Basic alarm
- Extra part
- None
- Intruder test
- Motion = True
- AllClear test
- Motion = False
- What it teaches
- Condition rules, clean-up steps
- Version
- Night-only
- Extra part
- Light sensor (built in)
- Intruder test
- Motion = True AND Light < 30
- AllClear test
- Motion = False OR Light >= 30
- What it teaches
- AND, OR and opposites
- Version
- Doorway double-check
- Extra part
- HC-SR04
- Intruder test
- Motion = True AND Distance < 70
- AllClear test
- Motion = False OR Distance >= 70
- What it teaches
- Two sensors agreeing, false alarms
- Version
- Message alarm
- Extra part
- 1602 text screen
- Intruder test
- Motion = True
- AllClear test
- Motion = False
- What it teaches
- Memory of an event
- Version
- Silent alarm
- Extra part
- None
- Intruder test
- Motion = True
- AllClear test
- Motion = False
- What it teaches
- Designing for the user
Room alarm vs a real security alarm system
| Feature | Home security alarm system | MakerBuddy room alarm |
|---|---|---|
| Sensors | Several: doors, windows, motion | One PIR, plus optional extras |
| Arming | A keypad with a code | The Rule Engine tab on a trusted device |
| Warning | A loud siren and often a call to a monitoring centre | A one-tone buzzer and a colour light |
| Memory | An event log with times | No clock, so no times; an optional screen message |
| Security of its own | Protected controls | The board's local web connection has no password |
| Power | Usually its own supply | 5 V USB: unplug it and it stops |
- Feature
- Sensors
- Home security alarm system
- Several: doors, windows, motion
- MakerBuddy room alarm
- One PIR, plus optional extras
- Feature
- Arming
- Home security alarm system
- A keypad with a code
- MakerBuddy room alarm
- The Rule Engine tab on a trusted device
- Feature
- Warning
- Home security alarm system
- A loud siren and often a call to a monitoring centre
- MakerBuddy room alarm
- A one-tone buzzer and a colour light
- Feature
- Memory
- Home security alarm system
- An event log with times
- MakerBuddy room alarm
- No clock, so no times; an optional screen message
- Feature
- Security of its own
- Home security alarm system
- Protected controls
- MakerBuddy room alarm
- The board's local web connection has no password
- Feature
- Power
- Home security alarm system
- Usually its own supply
- MakerBuddy room alarm
- 5 V USB: unplug it and it stops
The left column follows the parts in Wikipedia's security alarm article (opens in a new tab). The no-password row matters most: anyone on the same Wi-Fi could open the dashboard and stop your alarm. Use the board only on a Wi-Fi network you trust and never open it to the internet, as the security notes in the technical details explain. Treat the alarm as a model of how real ones think, never as protection for a home, a shop or a person.
Common mistakes and how to fix them
The alarm goes off by itself just after power-on
- Symptom: one or two beeps in the first minute, with nobody there.
- Cause: the PIR's warm-up. The HC-SR501 datasheet (opens in a new tab) allows up to three outputs in the first minute. Rules are saved on the board and start watching at power-on.
- Fix: stop Intruder before you unplug the board. After power-on, wait a minute, then start it again.
The buzzer will not stop
- Symptom: a steady tone that keeps going after everyone has left.
- Cause: a round that ends with Buzzer On, or an AllClear rule that is stopped or missing its Buzzer Off step.
- Fix: make Buzzer Off the third step of Intruder and the first step of AllClear, and keep AllClear running.
The light gets stuck or flickers between red and green
- Symptom: after an upgrade, the light stays on one colour, or red and green fight each other.
- Cause: the two tests are not exact opposites. If Intruder uses Motion = True AND dark but AllClear only uses Motion = False, then movement in bright light matches neither rule, and the light keeps whatever it showed last. If the tests overlap, both rules run at once and fight.
- Fix: write AllClear as the exact opposite of Intruder, swapping AND for OR and each comparison for its opposite.
It beeps when nobody is there
- Symptom: alarms in an empty room, often on sunny afternoons.
- Cause: warm air from a heater, a fan or a vent, or sunlight moving across the floor. The HC-SR501 datasheet (opens in a new tab) warns about lights near the lens and moving air.
- Fix: move the sensor, turn the sensitivity down a little, or add the doorway double-check.
The alarm starts late or keeps ringing for minutes
- Symptom: a long wait before the alarm, or a long tail after.
- Cause: a long Delay in AllClear holds up the red light, and a time knob turned far clockwise keeps the PIR output on for up to about 300 seconds.
- Fix: keep AllClear's wait at 500 ms or less, and turn the time knob anticlockwise.
Use the alarm in class or at a science fair
The build fits one 45 to 60 minute lesson for students aged 10 and up. Week 13 introduces the sensor, Week 26, Sensor-Based Control introduces Condition rules, and Week 28 adds the alarm and all-clear pattern.
| Minutes | Activity |
|---|---|
| 0 to 10 | Plug in the PIR, wait out the warm-up, read the card |
| 10 to 25 | Plan both rules on paper, then build them |
| 25 to 45 | Work through the test checklist in pairs |
| 45 to 60 | Placement challenge: protect the classroom door, then share results |
- Minutes
- 0 to 10
- Activity
- Plug in the PIR, wait out the warm-up, read the card
- Minutes
- 10 to 25
- Activity
- Plan both rules on paper, then build them
- Minutes
- 25 to 45
- Activity
- Work through the test checklist in pairs
- Minutes
- 45 to 60
- Activity
- Placement challenge: protect the classroom door, then share results
For a science fair, turn tests 5 to 7 into an experiment. Hypothesis: if a person crosses the sensor's view instead of walking straight at it, the alarm triggers from farther away. Change only the walking direction and measure the trigger distance five times each. More ideas with hypotheses are in electronics science fair projects with sensor ideas, and the pillar list of ESP32 and Arduino project ideas for students has more builds that use the same sensor.
Want to write the alarm in Arduino code instead of rules? The guide to motion sensors with Arduino or ESP32, wiring and code covers that. Uploading your own sketch replaces the MakerBuddy firmware, and the rules with it, until you put the firmware back. The PIR, the buzzer and the colour light all come in the MakerBuddy IoT Kit, and more builds are on the MakerBuddy blog.
FAQ
What is a motion sensor alarm?
A motion sensor alarm sounds a warning when something moves in the area it watches. Most use a PIR sensor, which notices the infrared warmth of a moving person or animal, and a small computer that switches on a buzzer, siren or light.
What are the three main components of an alarm system?
Sensors, a control panel and alerting devices. The sensors notice an intruder, the control panel decides and tracks whether the system is armed, and alerting devices such as a siren raise the alarm. Keypads for arming and disarming are often counted too.
What is a PIR on an alarm?
On an alarm, a PIR is the motion detector. PIR means passive infrared: it senses the warmth that people give off and sends nothing out itself. When that warmth moves across its view, it tells the alarm panel.
How far can a PIR motion sensor alarm detect?
The HC-SR501 in the MakerBuddy kit reaches up to 7 metres, and its sensitivity knob sets about 3 to 7 metres, according to its HC-SR501 datasheet (opens in a new tab). Real range is shorter when people walk straight at the sensor, move very slowly or the room is hot. Test your own room with the checklist above.
Can a pet set off a PIR alarm?
Yes. A cat or dog is warm and moves, so a PIR sees it like a person, and Adafruit's PIR overview (opens in a new tab) notes that pets sometimes set PIRs off. Keep pets out of the protected room, or add a second sensor that must agree.
What is a laser security alarm?
A laser or light-beam alarm shines a beam across a doorway onto a detector. When an intruder breaks the beam, the detector notices the change and sounds the alarm. Science World's burglar alarm activity (opens in a new tab) describes real alarms working this way. A PIR needs no beam, because it senses body warmth across a whole room.
Can I build a motion sensor alarm without coding?
Yes. On the MakerBuddy board you build it from two Condition rules in the browser dashboard: one that beeps and flashes red while Motion Sensor equals True, and one that turns the buzzer off and shows green while it equals False. The rules run on the board, so the alarm works with the dashboard closed.
Can the alarm send a notification to my phone?
Not by itself. The board cannot send email or app notifications. The Motion Email Alert idea in the MakerBuddy project library uses a small program on a computer that reads the motion sensor from the board and sends the email. Readings stay on your local network, and the board needs no account.
Sources
- HC-SR501 PIR motion sensor datasheet (Electrokit copy) (opens in a new tab): within 7 m, sensitivity knob about 3–7 m, under 120 degrees (page 1) and at most 110 degrees (page 4), time knob about 5–300 s, H and L trigger modes, one-minute warm-up with 0–3 outputs, best detection when people pass from side to side, shorter range at 30–32 °C, lights and moving air as interference.
- Adafruit, PIR Motion Sensor overview (opens in a new tab): PIRs detect whether a person has moved in or out of range; sometimes set off by house pets.
- Wikipedia, Security alarm (opens in a new tab): sensors, control panel tracking arm and disarm status, keypads, alerting devices and monitoring stations; the US Department of Justice estimate that 94% to 98% of alarm calls to law enforcement are false; reliability and user error as the main causes.
- Wikipedia, Motion detector (opens in a new tab): dual-technology sensors combine PIR and microwave and must both trip, lowering false alarms at the cost of missing intruders who fool one sensor.
- Elecfreaks, HC-SR04 ultrasonic ranging module datasheet (SparkFun copy) (opens in a new tab): 2 cm to 400 cm range.
- Science World, Burglar Alarm activity (opens in a new tab): real burglar alarms triggered when an intruder breaks a light or laser beam.




