How to Make a Raspberry Pi Smart Doorbell

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] you hey I'm here can you let me let me yeah sure I'll let you hey guys Aaron here in this video I'm going to show you how to make a smart video doorbell slash intercom unit out of a Raspberry Pi the doorbell is equipped with a mini screen and camera so that you can chat with your guests over internet calls I've created a simple script for this project that sends a notification to your phone when the caller presses the button but it could also be used as always on intercom system for your office let's get started our 3d printed housing looks a little bit like this this is actually our third revision of this housing we've made a couple more and we couldn't get the bevel right so kind of had to keep iterating on I should mention that all the 3d printed files a full parts list and write-up will be available in hackster Daioh if you miss anything in the video underneath the top housing we have its screen which attaches to our Raspberry Pi so this is where the video is going to show up on the doorbell we also have a button so you can press the button to activate the doorbell and a speaker so that you can hear the person on the other I started by taking four female hobby jumper wires and cutting the ends off one side of those wires I stripped them and these are going to be the wires that we use to connect the button to the Raspberry Pi I tend one end of those wires and this is just to make the solder flow easier onto the button when we attach it my button came with a resistor so I attached that to the yellow wire and now I'm just tending up the ends of the button here so that the wires can connect a little bit easier again my resistor was on my yellow wire so I attached that to the wire in the diagram here and my load in this case is going to be the Raspberry Pi so just make sure to keep track your wive's for that speaker was easier because we had a connector so we didn't have to solder anything our 3d printer was too small to print this in one piece and this is the back section of the doorbell we're going to have to glue these two parts together and these didn't come out perfectly from our printer so we're going to file them down before we move together and the trick is actually to file both pieces back-to-back like this so that when you glue them together even if there's a slight slope from the side to the other side they still fit together perfectly this part doesn't have to be too precise so I used my wood clamp to clamp the pieces together and filed those sides down next I use some superglue and I kind of held the pieces down with some other parts and super glued those edges together you definitely want to use a lot of superglue on this part to make those sides strong I'm using a small USB microphone for this project and you want to make sure to plug it in that slot because there are a few holes over that slot on the enclosure that make it easy for the microphone to capture audio next I screwed the Raspberry Pi into the enclosure using some em 2.5 millimeter screws now these holes don't come off the 3d printer threaded so you need to either make sure that you push those screws in pretty hard to tap the holes or use an actual tap to do that which is probably the better choice in order for the homeowner to chat with the visitor we're going to use this mini camera which attaches to the Raspberry Pi and we've actually used one of these before for the smart security camera and we thought it works pretty well so we're going to use it again check this out so when we design this enclosure we thought the camera goes here plugs in here with this little strip here but it turns out the camera actually plugs in here so we're gonna have to bend this a little bit more than we would like to actually get that plugged in but we think it should work using some tiny two millimeter screws and that technique I just described I screwed the camera into the enclosure we had to really put this wire in a weird position to get it into that slot and you want to make sure it's really connected to the Raspberry Pi because this gave us issues later on when we tried to connect the camera in code next I test fit the button but the hole came out a little bit too small from the 3d printer so I just took a file and open that up a little bit and it was a little scary getting that button in place because it sounded like this but after it was in place everything seemed fine next I looked at the diagram for the button and cut the ends off the positive wires from the diagram on the button and then the red wire from the speaker and stripped those these are going to be soldered together so that we can connect them to one pin on the Raspberry Pi instead of multiple pins it was a little tricky getting these in place but I use my helping hands to solder all three of those wires together then I use the trimming from the red speaker wire to connect to the end of all three of those wires and I wrapped it in some electrical tape so it doesn't short out next I cut the ends off B black-and-white speaker wires the white wires the signal the black is the ground we're going to have to solder these directly to the monitor because there aren't any pins available on the Raspberry Pi I would prefer to connect these directly to the Raspberry Pi but is what we had so we chose to do it this way if you want to make sure to use a really fine tip on your soldering iron so that you don't burn the plastic on the audio output but with a really steady hand I was able to do it and then I took my black wire and soldered it directly to the outermost pad and the white wire to the middle pad I lined all the wires up so it was easier for me to see how everything would go together and then I connected the pins to the Raspberry Pi the power cable going to the 3.3 volt pen the ground cable going to the ground pin and then the load cable from the button going to an arbitrary GPIO pin and I chose pin 26 for this here's a diagram so that you can do it yourself when you're building this project it's difficult to get all the wires under the screen and it might look a little messy but once you get that screen on it should be fine don't be afraid to kind of wrap the wires in different directions if they aren't fitting and then I took the HDMI connector and connected that to the Raspberry Pi next I took the speaker and using some 2.5 millimeter screws I screwed that speaker into place I had to use the same technique that I did earlier where I used some force to kind of tap the holes with the screws and then I fit the cover on the project the covers a little finicky to get to fit in place depending on how your 3d printer printed the parts so I had to actually file down my parts a little bit then I took some three millimeter screws and screwed in the back plate I should also mention that for power I took a right and gold micro USB can I did that to the Raspberry Pi routed it through the back of the project look so well ugly so you could also power through some standard wires and the GPIO pins if you wanted okay so now I'm on my computer and I'm recording this after the fact which is why I have this beard all right so I'm connected to my Raspberry Pi through VNC on my computer the first thing you're going to want to do is enable your camera so I've opened up a terminal window here and I'm going to type sudo razz be config this opens up the configuration options for your Raspberry Pi I'm gonna go down to interfacing options and select camera I'll hang yes to enable the camera and then okay once I finish I will be asked to reboot and I want to hit yes for this okay so after you've rebooted you can type sudo razz be still specify an - o option and then your file name in this case I'm saying output to test a PG now I'm just gonna quickly open up this image and you can do that through the document viewer which is these to folder icon up in the corner here and let me just double click to open that looks like my dog was actually looking at the camera when I took this photo but you can see it's working if you ran into any issues when running that command there might be a problem with your camera so you have to troubleshoot if that's actually connected to your Raspberry Pi okay so the next step is enabling the microphone to do that I'm gonna go to my terminal again and right al SOI mixer - see and then L which opens up this interface where you can configure your sound input if I press f4 it'll take me to the capture options for my microphone I'm just gonna bump this all the way up to 100 this sets the input level on the microphone because by default it's pretty quiet you want to update so that you can hear the audio next I'm gonna run this command and it's pretty long come in but this commander will be available in the github repo and also on hackster Daioh so you can copy and paste it if you want basically it's going to capture some sound and save that sound in a test dot wav file so as you can see here it's recording some input and we'll just let this record for a little bit now stop that to play the sound back you can type a play and then the name of your file which is Test WAV so this will play back our sound and we can check that the microphone is actually working properly next we actually have to store those settings so that when we reboot it will persist that information so I'm going to type sudo a SL a ctrl store and that will store our settings ok so now the next step is going to be enabling video calls so I'm going to go to a web browser here and we're using a free open-source internet call software called jitsi meat so I'm going to connect to that and I need to configure it jitsi so that when we open this up through the software it will already have configurations for the microphone and the camera so if I type in a meeting name here this can be any meeting name in the actual program it uses a unique ID but I'm just going to type Packer shack doorbell for this example and hit go it opens up a new call and says that we need to use the camera I've already configured this so it works for me but if you haven't had it configured you need to go into settings here and make sure that you're actually connected with your camera in some cases this won't work because Chrome doesn't pick up that you have a camera so you actually need to go into Chrome settings and so let me just show you how to do that so if you go into Chrome settings and you search for camera it will show you all the sites that you've enabled the camera for so I'm just going to go into site settings and click on camera here and you can see jitsu me is down here I want to select this camera and you might have to experiment with this a few times because there are a few different options in here but this is the camera setting that works for me then we're gonna go back to the microphone and select my USB device there are a bunch of different options here but this one worked for me and once I've done that I can exit out of the settings next I'm going to download the script in order to make this run properly and I've provided the script on our hacker Shack github account so if you search for a hacker Shack github you should be able to find our organisation and I'll just click on the first link here the repository is called smart doorbell so you're going to want to click on that and then click the cloner download button up here at the top and download zip which will download the code onto your computer I'll extract this file and put it in my home directory and now if I click into that folder that I just subtracted I can see the doorbell dot py file I'm just gonna copy that and paste it in the root of my home directory and this is what we're going to be running when the program starts up you can test it out by running Python doorbell py and it should print out some commands and start up basically what the program does is waits for somebody to press the button and then plays a sound opens up a web browser with that jitsi mean link and sends an email to the email that you specify through these variables for somebody to click on and join the meeting the meeting stays open for a set amount of time closes and then you can do you know whatever you want on top of that so the program is pretty straightforward it's just a simple script only about 200 lines here at the top you have all the variables that you can change I just want to make a quick note about security here since this doorbell is connected to the Internet and as a general rule of thumb if anybody can access your USB on your device they have access to all the information that's on that device as well as the network that the device is configured to so if you connected to your private network you probably don't want to put this outside as a video doorbell I would just keep it inside and use as an intercom unit but if you connect to public Wi-Fi and maybe you have some sort of server that's I sending the emails and creating the meeting links for you it would be more safe to use this as a doorbell but we didn't design it to be you know secure so it's up to you to actually take action to make this device secure that being said you can easily extend the code to do whatever you want with it this is kind of just a proof of concept to show you how to get the doorbell working ok so if you look at the settings here we have a bunch of different variables I'll quickly go through them first ones just the pin that you connected your load wire to for your button this is how long the screen stays active we have a jitsi IDE that you can use if you want to hard-code your jitsi ID but if this is not defined then we just create a random ID for you you can specify a sound effect if you want here's a setting for enabling the email and you'll notice down here that I have the email and app password of hard coded if you're at all concerned about security you don't want to put your app password in your app code because again anybody could access it you'd most likely want to create a server running up in the cloud with business logic concerned with sending emails and opening up video links you would do validation at the server levels so even if some random actor makes a request to the service you would still be okay because that sensitive information wouldn't be on the device if you want to use a server for your project you can use a service like Linode I've been using Blue Note a lot recently and I helps you take your DIY projects to the next level by providing personal Linux servers that help you run your projects in the cloud if you're like us and you like to tinker you should give lindo to try with low notes cloud storage you could create archive of your doorbell footage and access it from anywhere in the world you can even create a media server and play music when your guest rings the doorbell it's great for you know providing more security services for your doorbell as well like I mentioned earlier all kinds of upgrades are possible when you build on Leno give Leno to try today you can create a free account using the link in the description and get a $20.00 credit on your new account we're gonna do a few more things to make sure that the Raspberry Pi is set up for the video doorbell first we'll rotate the screen so that it aligns with a screen on the doorbell to do that I'm going to type sudo vim slash boot slash config txt and I'm going to add a new entry in this file pressing I to enter insert mode and I'll type display underscore rotate equals one press escape and then capital ZZ to save then I'll type reboot to reboot the Raspberry Pi and after reconnecting you can see that the screen is now in portrait mode which is great I'm gonna change this back to landscape just so we can finish out the video here next I'm gonna make sure that starts at boot so I'm going to type make directory slash home slash PI config slash Auto start and again all these instructions will be in the github page and i'm hackster i'll type them and create a new file in that directory called doorbell desktop in this file I'm going to insert some more text here and this will be to make sure that the program actually runs on start and the expect parameter specifies where the script is this will be the command that's run on start I'm gonna press escape and things easy again to save that now if I reboot it should start up the program when the Raspberry Pi starts I can test this out by pressing the button on the doorbell which opens up a browser and displays a new meeting with a random ID as you can see here okay so to demo this project we're going to mount it outside of our house and we can't drill into the wall here so we're just going to use some of this 3m exterior mounting tape and put it on the back of our doorbell just like we've done with some of our other projects and if you wanted to you could also just use some screws here mount some screws in the wall and then hang it on the screws but we're just going to use the mounting tape on top of this plastic piece right here obviously when it's mounted like this on the wall somebody could just come up and take your doorbell so you want to make sure that you trust your neighbors which we do but if you don't you know just be careful and don't put it anywhere that somebody might steal it you might have noticed that we also have an electrical panel on our home and if we're making a more permanent installation of this unit we would probably route this wire through that electrical panel just so it's not hanging down like this but for the purposes of this demo we're just gonna keep it like this alright guys thanks for watching this video all the parts for this project and a full write-up will be available on hackster do so if this video was too long and you missed a part make sure to check that link out so you can go at your own pace if you haven't already make sure to subscribe to keep up to date with all of our latest build videos but until then I'll see you next time [Music]
Info
Channel: Hacker Shack
Views: 205,554
Rating: undefined out of 5
Keywords: smart doorbell, raspberry pi, zero, raspberry pi 3, raspberry pi 4, diy, intercom, hacker shack, home automation, iot projects, hacker house, smart mirror, raspberry pi doorbell
Id: NteJ33ETxmA
Channel Id: undefined
Length: 21min 23sec (1283 seconds)
Published: Fri Mar 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.