Example Code for micro:bit-Smart Streetlight
At night, when people walk under the streetlight, the sound sensor detects the sound and the LED lights up for a while and then turns off.
Hardware Preparation
![]() |
![]() |
![]() |
|---|---|---|
| BOS0009 Sound Sensor | BOS0004 Ambient Light Sensor | BOS0017 LED Module |
![]() |
![]() |
![]() |
| BOS0029 Logic "Not" Module | BOS0027 Logic "And" Module | BOS0031 Duration Module(0 to 6 second) |
![]() |
![]() |
![]() |
| BOS0035 Mainboard-3IO | MBT0039 micro:bit | BOS0040 micro:bit BOSON Expansion Board |
Software Preparation
Supports graphical programming platforms such as MakeCode, and Mind+.
Wiring Diagram
Non-programming Project
Connection Diagram:

Programming Project
Connection Diagram:

Other Preparation Work
Tip: micro:bit and its expansion board will be used in programming projects.
Result
Video Demo
| Non-programming | Programming |
|---|---|
![]() |
![]() |
Additional Information
Program Flowchart:

Was this article helpful?











