Micro:bit Physical computing guides:
No. 2: PIR motion sensors
Connecting a PIR motion sensor to a micro:bit
Instructions on how to attach a PIR motion sensor to a BBC micro:bit.
What you will need
Instructions on how to attach a PIR motion sensor to a BBC micro:bit.
What you will need
- BBC micro:bit
- Micro USB cable
- Battery pack with 2 x AAA batteries
- 1 x PIR motion sensor
- 3 x Crocodile clip leads
PIR motion sensor
Wiring instructions
- Disconnect the micro:bit from your computer and disconnect the battery pack.
- Using the crocodile clips, connect the positive (+) pin of the sensor to the 3V pin, the negative (-) pin of the sensor to GND, and the signal pin of the sensor to Pin 0 on the BBC micro:bit.
Programming your PIR
Copy the below:
Programming your PIR
Copy the below:
Testing your code
Testing your code
- Download your program to your micro:bit.
- Reconnect your battery and run your program.