Retrofitted to my door lock, I present to you my Raspberry Pi door unlocker:
Although in this picture it was powered by the Pi Car mobile 1200mAh battery, it is now powered off the mains. The 4 AA batteries power the servo, which has a lifting strength of 15kg/cm. The servo pulls a piece of string to pull back the catch – opening the door.
<input id=”code_input” type=”tel” name=”enteredcode” onfocus=”clearThis(this)” autocomplete=”off” /><br />
import RPi.GPIO as GPIO
p = GPIO.PWM(3,50)
This script changes the duty cycle of the PWM being supplied to the servo (changes the servo angle), from 10.5 (rest) to 7.5 (string pulled) for 3 seconds and back to 10.5 again.