4 Replies Latest reply on May 25, 2017 12:08 AM by vandia

    Attaching Door Lock and Doorbell with Raspberry Pi



      Iam a Computer Scientist and working on a home Automation Project, pi have a camera attached when button is pressed captures the image of person at Home Entrance and matches against "Members of House" in result of facial recognition it will Open Door and if not, Android user will receive a notification (Image from entrance, Seeking permission for ALLOW/DENY ) and lock will operate accordingly



      Currently iam in the test phase so iam using:

      • Breadboard attached with GPIO Pins of Pi
      • Green LED (For YES/Open Lock)
      • Red LED (For NO/Don't open Lock)
      • 10K Resistors for LED's
      • Push Button





      I have a question as i don't have expertise in Hardware stuff, I want to Replace My LEDs with a DOOR LOCK , and instead of push button i want a DOOR BELL  can anybody tell me what alternate things i'll be needing?
      Ps Iam from Pakistan here Voltage is 220-240.

        • Re: Attaching Door Lock and Doorbell with Raspberry Pi

          Hi Umair,


          If you can control a relay then you should be able to drive any electronic bolt. So, you'll need a relay, some electronic bolt that suits your needs, and a small bit of circuitry to control the relay. There is information and the circuit diagram on how to control a relay with the Pi here, in the output circuits sections, 'Output Design Tips' tab: Raspberry Pi GPIO Explained

          Any doorbell push switch can directly replace the push-switch you have on your breadboard right now.


          Also, you may need to consider what happens if there is a power outage and the Pi is powered off. In an emergency that could be dangerous if the doors cannot open through manual means. Maybe the electronic bolts have manual key or some other override.

          Furthermore, even when the power recovers, the Pi might not if it was shut down ungracefully and the micro SD card contents could be corrupted.

          2 of 2 people found this helpful
            • Re: Attaching Door Lock and Doorbell with Raspberry Pi

              Hello Umair.

              shabaz is right that you can solve everything with relay. To make things easier a good approach to manage the high voltage can be using the PiFace DigitalPiFace Digital for the Raspberry PI that provider just a couple of relays and some useful circuitry to setup and control them using Python. To work during the development phase of your project you can use also the PiFace emulator (software only) for the Raspberry PI and connect hardware only during the testing phase.


              I know that in your country the high voltage power is 220-220V AC but if I am not wrong (I recall a memory from about 10 years ago) the doorbell and door lock works at 12 or 24 Vcc. It is anyway a high current  that require relays but I suggest to verify this to calibrate correctly the kind of power you should manage.


              Also in the case you don't plan to use a PiFace Digital shield maybe useful to use the Emulator just to test the logic of your circuitry respect the part related to relay control.



              2 of 2 people found this helpful
              • Re: Attaching Door Lock and Doorbell with Raspberry Pi

                Most of the door locks are 12v, and generally fed via a battery to overcome the power loss situtation.

                This method allows 'fire drops' and emergency egress where the power is removed from the lock, which makes then open.


                The door strikes are the cheapest, but they require some modification to the door frame, and usually have a different handle that operates from the inside but is locked on the outside.



                You'll need to use a relay as shabaz suggested.

                The 5v relay boards can be driven from a Raspberry Pi however the optically isolated ones need to have 3v3 on the control side and the series resistor reduced in value to make them operate correctly.

                There are relay boards that use a transistor to drive the relay coli and these work fine.




                3 of 3 people found this helpful
              • Re: Attaching Door Lock and Doorbell with Raspberry Pi

                To add to what the others said:
                If you want to do a test of a homebrew version, without paying for electric locks, you could use a solenoid that retracts when power is lost, so if there is a power outage, the door unlocks. Sure, it's a little less secure, but if you can't afford those electric locks, or just are in a "build it yourself" mood, it gives you another option.