Smart Light

Create a light that will only light up when someone is in the room using a PIR sensor.

You'll need

  • 1 x Micro:bit
  • 1 x Micro USB Cable
  • 1 x Breakout Board
  • 1 x PIR Sensor
  • 1 x LED

Step 1


Connect the Micro:bit to the Breakout Board. Then connect the PIR sensor to pin 0 of the Breakout Board and the LED to pin 1 of the Breakout Board, making sure the colours of the wires match the pins on the Breakout Board.

Step 2


Go to, open up the advanced tab and click on Add Package. Type "tinker kit" into the search box and click on the package shown to add it. You should now see the Tinkercademy and OLED packages.

Step 3


In the forever block, put the following blocks. The 'If' block checks if the PIR sensor detects any movement and if it does, it turns on the LED.

Step 4


And Presto! You have your very own smart light! Now you won't have to reach for the switch for light anymore.

Code and References

Completed this tutorial?

Spread the word! Let's get this trending on social media with #letsgethacking #SmartLight