A DIY Piano Powered Lock Box project.
MATERIALS
CIRCUIT COMPONENTS
- 220 Ω resistor (x2)
- 5.1 kΩ resistor
- 5 pole MIDI socket
- DC buzzer
- Arduino UNO
- Diode
- Servo motor
LOCK MECHANISM
I made the locking mechanism out of wood and some gears. Any locking mechanism that is powered by a rotation will work for the project.
BOX
I bought the box prebuilt and made modifications for the locking mechanism and circuitry.
INSTRUCTIONS
WIRING
The wiring for the project can be seen in the fritzing diagram below.
Keep in mind the orientation of the diode when assembling the components.
CODE
You can find the arduino code needed to run the project at https://github.com/aashish1498/Music-Box.
When uploading the code to the Arduino, make sure any connection to the RX pin is disconnected, as it will cause interference.
HOW TO USE
Plug in the arduino to a power outlet, and connect your midi keyboard to the socket. The tune to lock the box is 72, 67, 64, 60 (C5, G4, E4, C4). Remember that C4 is middle C.
The tune to unlock the box is 67, 66, 63, 57, 56, 64, 68, 72 (G4, Gb4, Eb4, A3, Ab3, E4, Ab4, C5).
If you need to switch states (if the box is unlocked but the arduino thinks it is locked, or vice versa), the tune is 84, 83, 84, 83, 84, 83 (C6, B5, C6, B5, C6, B5).
You can change these tunes by changing the requiredNotesOpen, requiredNotesClose, or switchStateNotes variables in the code. Also remember to change the numberOfNotesToOpen, numberOfNotesToClose, and numberOfNotesToSwitch values too.