OpenBox is an open source box that contains open source electronics. Oh, and it automatically opens when you knock on it.
Materials
- 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
- thread
- 1 breadboard
Instructions
Code
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.
Troubleshooting
- 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.
Experiment further
- 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.