Example Code for micro:bit-Intelligent Streetlight
This article offers comprehensive guidance on setting up an intelligent streetlight project using micro:bit, including hardware lists, wiring diagrams, and sample code to facilitate learning and practical application.
Hardware Preparation
![]() |
![]() |
![]() |
|---|---|---|
| BOS0013 Motion Sensor | BOS0004 Ambient Light Sensor | BOS0017 LED Module |
![]() |
![]() |
|
| BOS0040 micro:bit | MBT0039 micro:bit |
Software Preparation
Mind+、MakeCode
Wiring Diagram

Tip: Thresholds for the ambient light sensor and sound sensor should be adjusted according to actual environment.
Flowchart

Result
Video Demo

Was this article helpful?





