Have you ever had your hands full of groceries, wrapped up in the freezing cold, desperate to get into the warmth of your own house? Then you may know the struggle of having to fumble for your keys or having to set down all the groceries just to unlock the door and pick them back up. That is now a thing of the past! Using two Photons, a servo and small modifications to your door lock, you can unlock and lock your door at the push of a button!
Connected to one of the Photons (we will call this the Receiver Photon) is an Adafruit 315 MHz RF Receiver. To compliment the RF receiver, an Adafruit 315 MHz, 2 button remote control was used to communicate with the receiver. The RF receiver is a latching type receiver. This means that it functions like a selector switch. When the button A on the remote is pushed, it sets the voltage of the respective pin (D2 on the receiver) to high. The nominal voltage of the output is the same voltage as the power supplied.
The supply power comes from the Vin pin on the Photon which according to the multi-meter outputs a voltage of 4.71V. When button B is pressed, it deactivates the A pin (D2) and activates the B pin (pin D3). This essentially creates an on/off switch. The output of pin D2 (Button A) is connected to pin D4 on the Photon. When Button A is pressed, D2 outputs 4.71V and D4 reads HIGH. Then once Button B is pressed, the RF receiver turns D2 off, resulting in an output of 0V and a LOW reading by pin D4 on the Photon. In the code, the Photon checks the output of pin D4 every 1000 ms (1 sec). It publishes the string "button_status" with data "on" when the D4 reads HIGH and publishes "button_status" with data "off" when pin D4 reads LOW.
The second Photon (Servo Photon) is subscribing to the the Receiver Photon for either data string. If it receives the data string "on" it will send a signal to the servo that actuates it and unlocks the door. If the Servo Photon receives the data string "off" it will actuate the opposite direction, locking the lock. It is noteworthy that the servo used in this project lacked sufficient torque to move a deadbolt. A stronger servo would be needed to apply it to a deadbolt. But this project is applicable to knob locks as they require less torque to turn. Further expansion of this project could include two servos, one for a deadbolt and one for the knob lock, with an Adafruit 4 button remote.