PIR Motion
PIR Motion

Parts
(1) PIR Sensor with LED Signal 555-28027
(1) Resistor – 220 Ω
Jumper wires: red, black
Schematic

Wiring

Script
# read-pir-motion
from microbit import *
pin8.set_pull(pin8.NO_PULL)
display.scroll('40-second to warm up')
display.scroll('20-seconds to warm up')
display.scroll('Ready!')
while True:
if pin8.read_digital() == 1:
display.show(Image.YES)
else:
display.show(Image.NO)
Tests
Verify that the micro:bit’s 5×5 LED matrix display shows the checkmark ✔ for around five seconds after motion is detected. With no motion, it should display an X.