Micro:bit Combination Lock
by fatheenahemed in Circuits > Microcontrollers
2291 Views, 5 Favorites, 0 Comments
Micro:bit Combination Lock
You'll need
1 x BBC micro:bit
1 x Buzzer
4 x Crocodile clips
1 x Copper tape (or kitchen foil)
1 x Sticky back velcro (or double sided tape)
The Alarm Circuit
How it works
The BBC micro:bit can test if a circuit is complete. We can use this to activate different bits of code.
We are going to separate the circuit into two pieces, two strips that connect to the micro:bit and one strip which connects them together when it touches.
Make the Circuit Breaker
Get the box
Because this circuit is so simple, you can use it on anything that closes! A door, a window, a fridge, a drawer, a jar, a box!
We're using a big box to make it easy to show how it all works, but get creative with your alarm system.
Open the box and attach a strip of copper tape on the inside, front lip of the lid.
Attach the Micro:bit
Close the box slightly and mark 2 points where the strip touched the front.
Attach two vertical strips of copper tape here with a fold at the end You can use Velcro, glue pads or even blue tack!
Connect to the Micro:bit
Using crocodile clips, or stripped wires, connect one side to P0 and the other to GND
Attach the Buzzer
Stick it to the box and connect the red wire to P1 and the black to GND
Code
https://makecode.microbit.org/#pub:_a09fKzctM1Rv