Example Code for micro:bit-Detect Metal Object

Explore how to use micro:bit to detect metal objects with example code, wiring diagrams, and setup tips. This guide covers hardware and software preparation, along with detailed instructions for both programming and non-programming connections, making it ideal for electronics beginners.

Hardware Preparation

Alligator Clip
BOS0012 Conductivity Switch Alligator Clip BOS0020 Buzzer Module
BOS0035 Mainboard-3IO MBT0039 micro:bit BOS0040 micro:bit

Tips: micro:bit and Micro:bit BOSON expansion boards are used in the programming example.

Wiring Diagram

Non-programming Sample Connection

Connection 3

Programming Sample Connection

Connection 4

Result

When the conductivity sensor detects a conductive object, the buzzer will sound.

Additional Information

Flow Chart:

Flowchart 2

Was this article helpful?

TOP