My first milestone was connecting and controlling the servo with the Raspberry Pi. Initially, I read the pin-out diagram upside down, so my servo connection did not work. I also found out that my servo was broken, so I had to get another one. Also, my Raspberry Pi’s 5V pin was not enough to power the servo, so I had to get a breakout board and an external battery. Eventually I connected my servo with a breadboard and the breakout board. The breakout board connected to the breadboard to power the servo and the servo connected to the Raspberry Pi to be controlled.
The next step was connecting the servo to the lock. First, I dremelled off a piece of a piece of the lock shaft to make room for the servo. Then, to connect the servo to the shaft, I dremelled a servo attachment to have a slot for the shaft and to fit in the lock. Then I glued the attachment to the shaft and servo and the servo to the outside of the lock.
Then I needed to build a python script to control the servo. To control the servo, the Raspberry Pi uses PWM, or pulse width modulation. This eseentially sends signals from digital devices at At first I used RPI.GPIO for PWM, but I found out that it twitched the servo and made it heat up. Then I switched to pigpio, which did not twitch the servo. To test the servo, I used a script I found in a guide, which made a gui to control servo angle. Using this, I found how far I needed to move the servo to open and close the lock.