Example Code for micro:bit-Burglar Alarm for Art Gallery

This article guides you through setting up a burglar alarm system for art galleries using the micro:bit, featuring hardware components like tilt and touch sensors, and software programming with MakeCode and Mind+. By following the provided wiring diagrams and sample code, you can ensure security by alerting with a buzzer when exhibits are touched or tilted.

Hardware Preparation

bos0005 bos0020 bos0008
BOS0005 Tilt Sensor Buzzer Module Touch Sensor
BOS0035 bos0028 bos0040
BOS0035 Mainboard-3IO BOS0028 Logic OR module BOS0040 micro:bit BOSON Expansion Board
MBT0039
MBT0039 micro:bit

Software Preparation

MakeCode, Mind+

Wiring Diagram

Non-programming Project

Connection 3

Programming Project

Connection 2

Other Preparation Work

micro:bit and its expansion board will be used in programming projects.

Result

When someone touches the exhibit or the exhibit is tilted, the buzzer makes sound to alarm.

Additional Information

Program Flowchart:

Flowchart 2

Was this article helpful?

TOP