Example Code for micro:bit-Smart Corridor Light
This article offers example code for building a Smart Corridor Light using micro:bit, detailing hardware and software requirements, connection diagrams, and sample programs to help DIY enthusiasts easily integrate sensors and create a functional light setup.
Hardware Preparation
![]() |
![]() |
![]() |
|---|---|---|
| BOS0009 Sound Sensor | BOS0004 Ambient Light Sensor | BOS0017 LED Module |
![]() |
![]() |
![]() |
| BOS0029 Logic Not Module | BOS0027 Logic And Module | BOS0031 Duration Module(0-6s) |
![]() |
![]() |
![]() |
| BOS0035 Mainboard-3IO | MBT0039 micro:bit | BOS0040 micro:bit BOSON expansion board |
Wiring Diagram
Non-programming Project
Connection Diagram:

Programming Project
Connection Diagram:

Result
Video Demo
| Non-programming | Programming |
|---|---|
![]() |
![]() |
Additional Information
Flowchart:

Was this article helpful?











