Doorslam
Doorslam is a simple protection mechanism against people slamming a door too hard.
YOU NEED
- 1x Arduino Uno + PC
- 7x Jumper Wires
- Acceleration Sensor (in this example: MAKERFACTORY MF-4838286)
- 5V Servo Motor
- Optional: Breadboard
1. HARDWARE WIRING
Connect the pins in the following way:
ARDUINO ==> ACCELERATION SENSOR
GND ==> GND
3.3V ==> 3.3V
V4 ==> SDA
V5 ==> SCL
Using a breadboard here will make it easier later on to attach the sensor to the door. Direct connection does work just as well, though.
ARDUINO ==> SERVOMOTOR
GND ==> brown
5V ==> red
Digital 8 ==> orange
Make sure you use sufficiently long cables so you do not run into trouble later.
CINEMATICS
Attach the accelerometer to the door at least 10cm away from the rotational axis.
Connect one end of a rope to the servo and connect a cushioning object to the other end.
Create a physical setup where the servo rotating causes the cushioning object to go up/down.
I achieved this by using two screws to guide the rope but feel free to be creative.
Finalization
Upload this code to your arduino and have fun. Increase/decrease variable slamThreshold in the code to make the system more/less reactive.