Example Code for micro:bit-Smart Bin
This article offers a comprehensive guide on building a micro:bit Smart Bin, complete with necessary hardware like ultrasonic sensors and LED modules, software platforms such as Mind+ and MakeCode, wiring diagrams, and sample code, aimed at enhancing your programming and electronics skills.
Hardware Preparation
![]() |
![]() |
|---|---|
| BOS0045 Ultrasonic Distance Sensor | BOS0017 LED 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?





