Example Code for micro:bit-Smart Fan with Distance Sensing
This article guides you through setting up a micro:bit smart fan with distance sensing, including hardware preparation, wiring diagrams, and step-by-step coding instructions using Mind+ and MakeCode platforms.
Hardware Preparation
![]() |
![]() |
|---|---|
| BOS0045 Ultrasonic Distance Sensor | BOS0021 Fan Module |
![]() |
![]() |
| MBT0039 micro:bit | BOS0040 micro:bit BOSON Expansion Board |
Software Preparation
Mind+ and MakeCode graphical programming platforms.
Wiring Diagram
Connection Diagram:

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

Was this article helpful?





