PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteSome links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Build a working wireless intruder-alert prototype with two BBC micro:bits and a 3 V PIR motion sensor. One micro:bit detects movement and broadcasts a radio message; the second receives it, displays an alert and can sound a buzzer, speaker or headphones.
Important: “Remote” means the two devices are physically separated but connected by short-range micro:bit radio. This project does not send alerts over the internet or to a phone, and it is not a certified or dependable replacement for a commercial burglar-alarm system.
As an Amazon Associate I earn from qualifying purchases.
What you will build
PIR sensor → sensor micro:bit )))) radio (((( receiver micro:bit → LED + buzzer
The transmitter sits near the area you want to monitor. Its PIR sensor produces a digital signal when it detects movement. The transmitter sends a message such as moving to a second micro:bit elsewhere nearby. The receiver shows an alert and activates an audible output.
The micro:bit radio is a device-to-device broadcast system. Its performance depends on walls, interference, orientation, batteries and transmit-power settings, so do not assume a guaranteed distance.
Popular on Amazon
- Microbit controller V2.21 is included!onboard comes with BLE, accelerometer, electronic compass, three buttons, 5 x 5 LED dot matrix, mainly used for teens' programming education.
- Specially designed this starter kit includes commonly used resistors, LEDs, sensors, LED segment display and more to get you started with 18 interesting projects at least.
- We have detailed tutorials (including an introduction, wiring diagram, test code, driver installation, Example Projects...... Step by step to explain how to use on our wiki page.
- Each sensor is packaged individually and then held in a beautiful plastic box with compartments, it must be the best kit for you, your friends, and electric newbies or hobbyists.
- All boards are well-packed after function, voltage and current testing. The kit is well packaged, with each item packed separately.
See the official micro:bit PIR movement alarm project for the original wiring and example programs.
Parts and tools
Required
- Two BBC micro:bit boards
- Two battery packs
- One PIR motion sensor designed to operate at approximately 3 V
- Three suitable connecting leads or crocodile clips
Optional
- Buzzer, speaker or headphones for the receiver
- Edge connector or breakout board for more reliable wiring
- Small screwdriver for adjusting PIR sensitivity and delay controls
- Mounting tape, a case or a small project box
For buying information, use the official micro:bit buying page. Established maker suppliers include Kitronik, Pimoroni and Adafruit PIR sensors.
Wire the PIR sensor safely
| PIR sensor label | micro:bit connection |
|---|---|
VCC, + or 3V |
3V |
GND |
GND |
S, OUT or signal |
P0 |
Power down the micro:bit before changing connections. Check the sensor’s labels and documentation: the signal must not exceed the voltage suitable for a micro:bit GPIO pin. Do not connect an unspecified or 5 V-only sensor directly to a micro:bit pin. Use an edge connector or breakout board if crocodile clips are loose or difficult to identify.
How the alarm works
A PIR sensor detects changes associated with moving warm objects. It does not identify a burglar, distinguish a person from a pet or reliably detect someone who becomes stationary. Modules vary in warm-up time, output polarity, sensitivity and how long their output remains high after movement.
Both micro:bits must use the same radio group. The group number is a filter, not a password: it is not encryption or authentication. The official example uses group 73.
Program the transmitter in MakeCode
Open MakeCode, create a micro:bit project and flash it to the micro:bit connected to the PIR sensor. In Blocks, use this logic:
- Set the radio group to
73. - Inside forever, read digital pin
P0. - If the reading is high, show a warning icon and send the string
moving. - Otherwise, clear the display and send
still. - Pause between readings.
A JavaScript version of that teaching example is:
radio.setGroup(73)
basic.forever(function () {
if (pins.digitalReadPin(DigitalPin.P0) == 1) {
basic.showIcon(IconNames.SmallDiamond)
radio.sendString("moving")
} else {
basic.clearScreen()
radio.sendString("still")
}
basic.pause(1000)
})
Use the MakeCode blocks if you are teaching beginners; the important details are the shared group, the P0 input and the exact message text.
Also popular on Amazon
- Includes the BBC Microbit V2.2 which has new speaker sensor, Built-in 25 LEDs, 2 buttons, motion sensor, buzzer, light sensor, temperature sensor, compass, radio and Bluetooth wireless features make it easy to get you started with more fun projects.
- This is an easy to use electronic board that is very versatile and can be coded many different ways. It can be integrated with other coding tools and on many platforms.
- Coding is easy with online block gui, javascript and python. Compiles to hex file, which you then copy to microbit (looks like a drive to pc)
- Box contains: 1 micro:bit v2.2, 1 USB cable, 1 battery holder, 2 AAA batteries, user guide
- Free tutorials and project ideas available on the micro:bit website. The instructions are easy to follow for a beginner to learn to code with it.
Program the receiver in MakeCode
Flash a separate program to the second micro:bit. Set its radio group to 73, then add an on radio received receivedString event:
- If the received string equals
moving, show an alert image and play a tone. - If it equals
still, clear the display or stop the alert.
radio.setGroup(73)
radio.onReceivedString(function (receivedString) {
if (receivedString == "moving") {
basic.showIcon(IconNames.Skull)
music.playTone(262, music.beat(BeatFraction.Quarter))
} else if (receivedString == "still") {
basic.clearScreen()
}
})
Audio connections differ between micro:bit revisions and accessories. If the sound output is uncertain, use the LED display as the primary indication and follow the documentation for your buzzer, speaker or headphones.
MicroPython version
MicroPython code must be used in the micro:bit Python Editor or another compatible MicroPython workflow. It will not run in the MakeCode editor. See the MicroPython documentation and the radio API reference.
Transmitter
from microbit import *
import radio
radio.config(group=73)
radio.on()
while True:
if pin0.read_digital():
display.show(Image.DIAMOND_SMALL)
radio.send('moving')
else:
display.clear()
radio.send('still')
sleep(1000)
Receiver
from microbit import *
import music
import radio
radio.config(group=73)
radio.on()
while True:
message = radio.receive()
if message:
if message == 'moving':
display.show(Image.STICKFIGURE)
music.play(["C4:4"])
if message == 'still':
display.clear()
These are the official project’s basic examples. The receiver plays a note whenever it processes a moving packet, so frequent status messages can produce repeated sounds.
Test and calibrate it
- Flash the transmitter program to one micro:bit and the receiver program to the other.
- Check that both programs use the same radio group and matching message strings.
- Connect the PIR sensor to 3 V, GND and P0.
- Power both boards from their battery packs.
- Allow the PIR module to complete its startup or warm-up period.
- Walk through the sensor’s detection area.
- Confirm that the transmitter displays a warning.
- Confirm that the receiver displays an alert and produces sound.
- Walk away and observe whether the receiver clears the alert when it receives
still. - Test the receiver from its intended position, including through the doors or walls that will separate the boards.
- Disconnect and reconnect both battery packs to check startup behaviour.
- Switch off the receiver during movement and decide how your design should respond when it is restarted.
Improve sensor placement
Face the PIR across the expected entry path rather than directly at a nearby wall. Keep it away from heaters, windows receiving direct sunlight, air-conditioning outlets and moving curtains. Mount the sensor firmly so that cable movement does not create false triggers.
If the PIR reports movement continuously, wait through its warm-up period, then adjust sensitivity and hold-time controls with the screwdriver. Check the module’s documentation and verify whether its signal is active-high or active-low.
Reduce battery use
The simple program sends either moving or still every second. That is easy to understand and helps the receiver recover its current state after a missed packet, but it uses more radio power. The official project also warns that continuous status transmission is inefficient.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsAlso popular on Amazon
- micro:bit V2: Latest version official board, a pocket-sized device allows you to get hands-on with coding and digital making
- 2 Sets of Codes: Block-based visual programming language code and Text-based Python code
- 316-Page Detailed Tutorial: Provides step-by-step guide with basic electronics and components knowledge (The download link can be found on the product box) (No paper tutorial)
- 44 Projects from Simple to Complex: Each project has schematics, wiring diagrams, complete code and detailed explanations
- 225 Items in Total: This kit includes the common components, modules and sensors available for the board
An event-only transmitter sends messages only when the sensor state changes:
from microbit import *
import radio
radio.config(group=73)
radio.on()
previous_state = 0
while True:
current_state = pin0.read_digital()
if current_state and not previous_state:
radio.send('moving')
display.show(Image.DIAMOND_SMALL)
elif not current_state and previous_state:
radio.send('clear')
display.clear()
previous_state = current_state
sleep(100)
This reduces transmissions and usually improves battery life, but a single missed moving packet can prevent the receiver from learning about the event. A practical compromise is to repeat moving periodically as a heartbeat, accepting the extra battery use.
Make the receiver latch the alarm
For a more useful alarm, make the receiver remain active after the first movement message instead of playing a sound for every packet. Add a reset action, such as pressing button A, and have the receiver stop or silence the alert only after reset. You can also add a timeout.
For multiple transmitters, use distinctive messages such as front-door:movement, garage:movement and kitchen:still. All devices still need the same radio group, but the receiver can display which sensor sent the alert.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →The radio API supports configurable groups, power, message length, queue size and transmission rate. Higher transmit power can improve communication in some situations but may reduce battery life. See the MakeCode radio reference and MicroPython radio documentation.
Choose the right detection method
| Method | Best for | Trade-off |
|---|---|---|
| PIR motion sensor | People moving through a room or corridor | Needs wiring and can react to pets, heat or airflow |
| Magnetometer and magnet | Doors, drawers, cabinets and bags | Nearby metal and magnets can affect calibration |
| Accelerometer | Tampering with a box, bag, bicycle or valuable object | Detects movement of the object, not room entry |
The official door alarm uses a magnet near the micro:bit and sends an open message when the magnetic reading changes. The tilt alarm is better for detecting movement of a protected object. The project library also includes light-alarm concepts.
Troubleshooting
The receiver does nothing
- Confirm both boards are powered and programmed.
- Confirm the group number is identical.
- Check that
movingis spelled exactly the same in both programs. - Move the boards closer and test without heavy shielding.
- Check that the PIR signal is connected to P0.
- Ensure the receiver is not trapped in a blocking alarm loop.
The PIR constantly reports movement
Wait for warm-up, adjust sensitivity and delay, check the ground connection, and move the sensor away from heaters, sunlight, air-conditioning and moving objects. Temporarily display the raw digital reading to determine whether the module’s logic is reversed.
Also popular on Amazon
- BBC Micro:bit Development Board V2.2 is included! New micro:bit with sound.
- Battery holder with On-Off switch to power the micro bit which is very convenient for controlling.
- Micro:bit is a great platform to start, you code visually via the block editor which is a way to learn JavaScript basics using blocks of code.
- Connection Diagram, Sample Code, Using Method and User Guide are provided on our wiki page.
- It has an led matrix, compass, accelerometer and a microphone, which makes it easy to reprogram as a smartwatch, logging platform, gesture controller, or an external speaker for audio.
The alarm triggers repeatedly
The transmitter may be sending moving every second and the receiver may be playing a tone for every packet. Use event-only messages, play sound only when the alarm changes from inactive to active, or add a latched alarm with a reset button.
Recommended Free Tools
There is no sound
Check whether your board revision requires an external audio device, whether the buzzer is connected correctly, whether the program reaches its tone instruction and whether the output is loud enough. Test the display independently of the audio.
Radio alerts are missed
Keep messages short, process them promptly and avoid unnecessary broadcasts. Radio packets are queued, and a full receive queue can cause incoming messages to be ignored. A heartbeat or acknowledgment scheme can improve visibility of link failures, but neither makes the system fail-safe.
Security and safety limitations
This project should be treated as a classroom, maker or educational wireless alert—not as primary security equipment.
- The radio group is not encryption, a password or authentication.
- A nearby micro:bit using the same group may receive or interfere with messages.
- The system does not contact a phone, monitoring company or emergency service.
- It has no guaranteed delivery, professional tamper detection or backup-power monitoring.
- It may fail silently if the receiver loses power or radio contact.
- Someone could remove the transmitter or battery without being detected.
- PIR sensors can miss a person who stops moving and can trigger on pets or environmental changes.
Do not rely on it as the only protection for a home, business, medication, valuables or a vulnerable person. A certified commercial alarm is the appropriate choice where dependable security matters.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Buying the right upgrade
For most beginners, the practical route is a two-board micro:bit starter bundle, two battery packs, a documented 3 V PIR sensor and a simple buzzer or speaker. An edge connector or breakout board is worthwhile if the project will remain assembled.
Choose a sensor with clearly labelled power and signal pins, a documented 3 V-compatible output, adjustable sensitivity and delay, and suitable leads. Avoid unspecified 5 V-only modules, high-current speakers connected directly to GPIO pins and mains-powered sirens. MakeCode and the official Python documentation are free; no paid coding subscription is required.
Prices vary by country, currency, shipping and whether a listing contains one board, two boards or only a sensor, so check the supplier pages on the day you buy.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

