OpenBox is an open source box that contains open source electronics. Oh, and it automatically opens when you knock on it.
- 1 Arduino Uno board
- 1 Basic Education shield
- 1 standard servo
- 1 piezo
- 1 1M ohm resistor
- 3 jumper wires
- 1 9V battery
- 1 9V battery holder
- 1 power connector
- 1 OpenBox kit
- masking tape
- 1 breadboard
- Connect the shield to the top of your Arduino board.
- Connect the 1Mohm resistor to analog pin A0 and to GND through Arduino.
- Connect one the legs of the piezo to analogue pin 0, connect the other leg to GND in parallel with the resistor.
- Build OpenBox kit but leave the rear cover unassembled.
- Turn the servo by hand until the end. Turn it by hand to the position of 90 degrees. Fixing the rod-shaped arm along the servo.
- Tie a thread to the servo. Pull it through the hole in the middle plate and tie the other end to the lid.
- Connect the servo to D9.
- Place your Arduino inside the box. Paste the piezo to the inner wall of the box.
- Connect Arduino to the computer and load the example: File -> Examples -> Castilla -> Robots -> OpenBox. Knock on the piezo to make sure the servo moves.
- Connect the 9V battery to Arduino before you assemble the rest of the walls.
You cand find the code at: File -> Examples -> Castilla -> Robots -> OpenBox
How it works
When the piezo knock sensor detects a knock, the servo rotates and pulls the string so that the lid is lifted. It waits for a bit and theN rotates back so the lid closes. The program then restarts and you can knock once more.
- The lid does not open/close fully? Adjust the values in
write()to fix it. But first, adjust the angle of servo arm and the string to make sure it is long or short enough.
- The box does nothing when you knock? Check the reference for debugging piezo knock sensor. If it’s still not working, see the reference for debugging standard servo.
- Make a password knock by setting it to recognize only a certain knock pattern.
- Modify it so that it requires knocking to both open and close the box rather than automatically closing after it is opened.