How To Make A DIY Ring Doorbell – Remote Front Door Camera and Lock With Rasbperry Pi

How To Make A DIY Ring Doorbell - Remote Front Door Camera and Lock With Rasbperry Pi

Hi, this is Wayne again with a topic “How To Make A DIY Ring Doorbell – Remote Front Door Camera and Lock With Rasbperry Pi”.
This is a raspberry pi, smart doorbell, picking up from our last tutorial of creating a camera stream, we’re now building a application and introducing face detection. So we know who’s at the door, but that’s not all. The smart doorbell also features a door lock system which can be controlled remotely, whether it’s a friend or to retrieve a package whether indoors or outdoors, and you can also catch unwanted visitors at your door too hi. My name is evan, and i’m here with make to provide a second series of how to build your own raspberry, pi camera stream, but that’s not all with a portable power supply. You can also make your own pi gopro camera with his own tripod stand.

If you haven’t already have a look at part, one as a lot of this application is going to be based on that theory. Let’S get started the overview. The part list now based on the previous video. What we’re going to be using is the raspberry pi 4.. We’Re also going to be using a pi camera module, a micro, sd card, a micro sd card adapter, a pi 4 charger, make sure it’s usb c and a pi 4 enclosure to house the doorbell camera and the servo motor. This is going to be used to control our lock system and some male to female jumper wires assembly of parts. Now, picking off from the last video, we create a camera stream using a pi camera module and a raspberry pi we’re now going to build on top of this and build the pi doorbell. Now i’m using this specific design because it exposes the camera module and it has good air ventilation, but you can use any camera case now.

I’M just gon na pretty much assemble the whole pi camera module. The good thing about this case is that it exposes the ports, so we can work on other stuff. Now, with this case, it was pretty straightforward and the pi camera module was pretty much put in place by a simple clip-on, but you can also use electrical tape to add extra protection, and now we can just assemble the whole pie, build together and now it’s time To etch the pi os onto the sd card, this was covered in the previous video and we’re ideally using an adapter to plug the micro sd into the pc and we’re etching, the pi os onto the sd card. And now that’s done.

How To Make A DIY Ring Doorbell - Remote Front Door Camera and Lock With Rasbperry Pi

We can now place this into our pi doorbell build now we’re just going to supply some power and that’s pretty much it. If we stop here, we pretty much made a pie, camera stream which can be accessed on any client device, and we can see the camera stream. Let’S install this, and this is the final design, but there’s one small problem when someone’s at the door. We never know, and if there are, we still have to stand up and open them.

How To Make A DIY Ring Doorbell - Remote Front Door Camera and Lock With Rasbperry Pi

How can we improve this? Well, two things: we’re gon na, add a door lock system and a face detection module. So next time our parcel man’s at the door, we’ll know he’s there and we can just ask him to leave it there or if we have friends or visitors at the door, we can also be notified and we can also unlock the door using our phones and The door lock is controlled by a server motor, but let’s find out how to build this. The door lock system, so how it works is we’re essentially controlling the server motor through the flask web application and controlling the direction and the degree of rotation of the servo motor via the web page. The server motor has three wires, the red being the 5 volt and the brown being the ground and pin 11 being the gpio pin. Now these wires will be connected to the pin headers of the raspberry pi, and this is the current configuration of the gpio pins with pin 11 generating our pwm signal. Now these can be soldered on, but for now we’re going to use jumper wires. These are male to female jumper wires and they’ve been color coded accordingly. So what we’re doing right now is just setting it all up so we’re adding these jumper wires.

So we can plug these pins into the headers independently. The red 5 volt pin go into pin 4 the black wire going to pin 6 being ground and the orange wire being our pwm pin goes to pin 11.. The setup should look something like this. This is the final build it’s now time to download the git repo and see how the server motor interacts with the pi doorbell hey. You want to learn more about working with raspberry pi.

We have the perfect thing for you in the maker shed the getting started with raspberry pi bundle. It comes with a raspberry pi, some things like a power supply, hdmi, cable and stuff, like that and three awesome books, full of tutorials and projects to teach you how to work with the raspberry pi. There’S also a few issues of make magazine in there as well check the link in the description below for all the details on the bundle. Now, in the previous video we enabled the camera port as well as installing the library dependencies, so we’re going to take it from here now. The first thing we’re going to do is head off to the git repo of the pi smart doorbell. You can find more information in the article below now. The git repo outlines the steps in order to install the library dependencies as well as how it works.

You can also find the face detection examples in the repo. So what we’re going to do now is just get clone the library and looking into the folder we can see, it doesn’t exist yet now we’re just going to the terminal and cloning, the reaper, and you can see that the repo has now been created now. This is the current file structure. The main one we have is the main.py as well as the camera.py.

The main.py is what creates the flash server now. The general changes here is that we’ve defined some functions, for example the lock and unlock, and when a user interacts with the web page by clicking the lock button. For example, this passes the desired values to control the server motor via the servo.py script. And this is the current structure of the server script.

More information can be found in the article below and you can see that the gpio is currently set at pin 11 as an output. Now the general description of the code here is that the parameters are passed via the main.py into the server.poi, and the for loop generates a duty cycle to the server motor based on the parameters passed on the main.py right now. It’S time to test the server implementation. So what we’re going to do is click into the main.py and run it now, like the raspberry pi camera stream.

We can verify that we see the live footage, but where it differs here is that we’re making a http request via post right now, it’s time to test the face detection models, and we can do this by going into the face detection examples, and this is modeled Over the hard cascade face detection models, what we’re going to do is just delete the existing files and copy and paste the face detection enabled scripts into the parent directory. This is pretty lightweight and fully customizable for your own needs. Now you can see that the hard cascade, git repo has a lot of other models in this example we’re using the frontal face, but there’s also others such as a full body upper body and many others. So it can also be good to also play around with it, so we’re now just going to head off to the new main.py script and run the face detection example. Now you can see the camera output works and also when we have a new face in front of the camera, we’re now able to detect the new visitor at the door and also the motor works and interacts with our client device. Now this will be the basis of the door lock now there’s various ways of implementing a door lock system.

How To Make A DIY Ring Doorbell - Remote Front Door Camera and Lock With Rasbperry Pi

What i’m going to use is some electrical tape and some screws and create a custom hook to lock and unlock your door based on the server rotation. Now this is example, but you can also make improvements by 3d printing, your own door lock, and there you have it – we’re now able to lock and unlock the door based on face detection, as well as see the camera stream. You can find more information on how to auto start your pi stream, also as well as looking at the different hard cascade models, so you can customize your own version. That’S pretty much all now. This video demonstrates real world applications. We can make from a camera stream, but you can also make different examples too, like a pi, gopro camera anyways thanks for watching and if you want to find out more information, have a look at mike’s website in the description below for the article i’m evan thanks For watching peace, you .