How to Make a Smart Security Camera with a Raspberry Pi Zero

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • In this video, we use a Raspberry Pi Zero W and a Raspberry Pi camera to make a smart security camera! The camera uses object detection (with OpenCV) to send you an email whenever it sees an intruder. It also runs a webcam so you can view live video from the camera when you are away.
    See how we built it, including our materials, code, and supplemental instructions, on Hackster.io: www.hackster.i...
    Make sure to look out for our behind the scenes video! • Behind the Scenes: Sma...
    USEFUL LINKS:
    Follow Hacker Shack on Instagram:
    / hackershackofficial
    Subscribe to Hacker Shack: goo.gl/qHjz4j
    Visit our website for parts and project updates: www.thehackers...
    View our code on Github: github.com/Hac...
    OpenCV Install Guide: www.pyimagesear...
    Get our 3D printer: robo3d.myshopif...?rfsn=1004615.c5abe
    MATERIALS:
    Raspberry Pi Zero Wireless × 1
    Amazon Affiliate Link - goo.gl/Zsxm7k
    Raspberry Pi Camera module × 1
    Amazon Affiliate Link - goo.gl/4kR632
    Check out the NoIR camera for night surveillance
    Amazon Affiliate Link - goo.gl/fT7oL9
    Raspberry Pi Zero Camera Cable x 1
    Amazon Affiliate Link - goo.gl/pBVZb1
    Micro-USB to USB Cable × 1
    1/4" MDF Board × 1
    90 Degree Angle Bracket × 1
    Outdoor Mounting Tape × 1
    M4 X 20mm Long Machine Screws × 2
    M4 Hex Nuts × 2
    M2.5 Machine Screws × 4
    #8 X 3/4" Long Machine Screws × 1
    #8 Hex Nut × 1
    #8 Wing Nut × 1
    MUSIC:
    / joakimkarud
    Disclaimer
    The methods shown in this video should be used
    as a guide only.
    HACKER SHACK ACCEPTS NO RESPONSIBILITY FOR
    ACCIDENTS OR INCIDENTS ARISING FROM INDIVIDUALS
    UNDERTAKING ANY OF THE TASKS DESCRIBED. IN
    PARTICULAR, IF UNSURE YOU SHOULD ALWAYS CONTACT
    A QUALIFIED TRADESMAN BEFORE PROCEEDING.

Комментарии • 725

  • @christopherbillington8965
    @christopherbillington8965 5 лет назад +10

    rather than dealing with MDF, I think I would mount it in an electrical box. The steel ones are modular, cheap and durable. Plus, you can mound an unwired outlet in it, which isn't the sort of thing most people would think twice about seeing.

  • @circuitmasters5258
    @circuitmasters5258 5 лет назад +5

    Man Finally this project I have been trying to create for a minute...i need it LOL!

  • @fabulousasia9848
    @fabulousasia9848 5 лет назад +2

    This is a great project. One of my students built something similar, except she used the project to feed her cat by sending emails to the DIY cat feeder! :)

  • @FantasyLegacyGraphicArts
    @FantasyLegacyGraphicArts 7 лет назад +52

    Always test your electronic components to make sure they function properly before mounting them in a "permanent" way. Great video.

  • @DanielJohnHowTo
    @DanielJohnHowTo 7 лет назад +17

    The wood needs sealing and priming otherwise it will swell up and come loose etc , in case anybody is thinking of building this.

  • @GadgetAddict
    @GadgetAddict 6 лет назад +23

    Pretty cool. Useful for those who just want something that basically works out of the box.

    • @Chris_t0
      @Chris_t0 4 года назад +15

      This is 2 years old but its worth point out... This is the complete opposite of "works out of the box".... Literally you even have to MAKE the box...

    • @viertausend87
      @viertausend87 3 года назад +1

      @@Chris_t0 I scrolled through the internet in the office and suddenly I had to start laughing out loud. Best comment I read in a while!

    • @ParodieHecker-mobile
      @ParodieHecker-mobile 3 года назад

      @@Chris_t0 Well, I think... That was the joke :D

  • @theapricotbambino
    @theapricotbambino 6 лет назад +2

    why am I just finding this youtube channel now!? I love you guys!

  • @cxosposync9937
    @cxosposync9937 2 года назад

    Awesome Prj!!!

  • @nanakeyks
    @nanakeyks 5 лет назад

    I love the use of multiple skills to get the job done.

  • @AndrewAlex92
    @AndrewAlex92 7 лет назад +63

    At 10:45, you go through allowing the insecure login. You should instead just generate an App Password support.google.com/accounts/answer/185833?hl=en and use that in place of your real password to begin with. You never want your Google password stored in plaintext anywhere.

    • @hackershack
      @hackershack  7 лет назад +12

      +AndrewAlex92 good idea. I can update the docs tonight

    • @hackershack
      @hackershack  7 лет назад +12

      updated

  • @travis8753
    @travis8753 7 лет назад +275

    Or you could just buy a piece of PVC pipe, two end caps mount it in that and have a waterproof security camera.

    • @SllyRbbtTrxR4Kids
      @SllyRbbtTrxR4Kids 7 лет назад +8

      Travis lol, true, but to each their own. But i like your style better.

    • @hellrazor35
      @hellrazor35 7 лет назад +14

      Personally I'd just get a plastic project box and drill a hole for the wires / camera. It would be flat and alot more water proof than MDF. This could be done alot easier.

    • @Skyefuego
      @Skyefuego 7 лет назад +3

      that would look sleek. will definitely look better.

    • @KapnKerfuffle
      @KapnKerfuffle 7 лет назад +15

      Or by a hollow plastic skull or gargoyle or statue of a poster of Big Brother with a plastic electrical gang box behind the eyes.

    • @axsdeny6692
      @axsdeny6692 7 лет назад +6

      Wouldn't there be the potential for excess humidity to condense on the inside of the pipe thereby endangering the electronics? The MDF is more porous and wouldn't do this as much. Of course, if left outside, the MDF will fall apart eventually because it's garbage.

  • @PeterMaloy
    @PeterMaloy 7 лет назад +1

    Inkscape is awesome for drawing up templates. Free, runs on Windows, Mac, Linux. I use it for laying out all my laser cutter designs. Probably would have saved some time on this project.

  • @Adnegoo
    @Adnegoo 7 лет назад +590

    If i made that here in Brazil im pretty sure that they will steal my camera...

    • @FerrariTeddy
      @FerrariTeddy 7 лет назад +13

      adriano sousa lol you gotta bolt that stuff down!

    • @MikeMaher
      @MikeMaher 7 лет назад +27

      Make the housing blend into the surroundings. It doesn't have to be a black box..

    • @nicT9
      @nicT9 7 лет назад +116

      If I put this up here in the USA, thieves will avoid wasting time at my house and probably drop a couple bucks in my lawn so I can go buy a better camera system.

    • @hamptonford3066
      @hamptonford3066 7 лет назад +3

      But what if they steal what it's bolted down to?

    • @JoshSideris
      @JoshSideris 7 лет назад +11

      If there's one thing I' know about Brazil from watching videos on the internet, it's that there's no shortage of off-duty police officers to save the day.

  • @grayhatfailure2428
    @grayhatfailure2428 5 лет назад +120

    I'm 42, do I still need a parent to help me cut out the MDF?

    • @draco5991rep
      @draco5991rep 5 лет назад +29

      Yes, even if you're 95 year old, you need a parent to help you cutting the MDF. Without a parent it won't work :(

    • @bruh-gn5kc
      @bruh-gn5kc 5 лет назад +13

      *Illegal without a parental guardians assistance and approval*

    • @gzcwnk
      @gzcwnk 5 лет назад +2

      If you need to ask, yes.

    • @timfoote6919
      @timfoote6919 5 лет назад

      yes

    • @soorionyt
      @soorionyt 4 года назад

      @Cloudy_lotus no no no u have to do Orochimaru's reanimation jutsu from Naruto.

  • @santoshceg
    @santoshceg 7 лет назад

    Thanks a ton, guys! This is one project I've been working on recently. Next steps could be to detect the face on the camera and match with the voice and commands of the visitor to unlock the door if authorized. If you guys plan on doing something like this, it will be of great help.

    • @rajatharry
      @rajatharry 5 лет назад

      Hello bro

    • @rajatharry
      @rajatharry 5 лет назад

      I am planning to do the Same. Can You Please contact me

  • @najawarus5693
    @najawarus5693 7 лет назад +48

    Best Tutorial for home made security cams

    • @Ree1981
      @Ree1981 7 лет назад +1

      Top 10 anime security cam tutorials

  • @narpat007
    @narpat007 5 лет назад +3

    Excellent ! In the event of image detected, have you given thought to consider switching a light bulb via I/O pins in conjunction with a optoisolator or something like that ?

  • @Malcolmstuartcole
    @Malcolmstuartcole 7 лет назад +1

    Very user friendly vid..well done

  • @cri8tor
    @cri8tor 6 лет назад +2

    Great tutorial and appreciate the time and effort it takes to record, edit and upload. It's already been done, but please consider an updated version using Raspberry Pi 3 B+. Wyze data mines it's customers, can't be used with iPhone 4S and has no customer service number, so your hack is a great alternative.
    Cheers

  • @imben77
    @imben77 7 лет назад

    You have no idea now we'll timed this video is! I just got a pi zero camera kit (with suction cups for a window) and was researching the code when I found your video :)

  • @syafiqazainal1691
    @syafiqazainal1691 3 года назад +1

    hi can you help pls me why mine has sign in and it said your connection to this site is not private? i m using raspberry pi 4b

  • @alphawolf9371
    @alphawolf9371 5 лет назад

    I am using elements of this tutorial for my own robot. I am using a Raspberry Pi Model B, a Raspberry Pi camera for face recognition, and some small servos to move parts of the robot.

  • @SheltonDCruz
    @SheltonDCruz 3 года назад

    Thanks Davis!

  • @n0ukf
    @n0ukf 7 лет назад +1

    A jigsaw is not the best thing to use to cut straight lines. You can get straighter lines with a plain handsaw. Before painting the MDF you can seal the surface with white or wood glue (or actual wood sealer) to seal it against excessive paint absorption, reducing the number of coats required for full coverage.

  • @nayaktel
    @nayaktel 3 месяца назад

    Hi, Project is Fantastic, Is possible to make Drowsiness detection only? no video is required, only will take a snap while detecting drowsiness?

  • @RT-eb6vo
    @RT-eb6vo 6 лет назад

    Well done guys, as always.

  • @lleo9791
    @lleo9791 4 года назад +1

    This project is great, thank you for sharing!

  • @kehindea
    @kehindea 5 лет назад

    Brilliant video

  • @anamikamishra552
    @anamikamishra552 5 лет назад

    That ruler used to draw the line was so precise & appropriate. By the way nice video

  • @mfr8471
    @mfr8471 4 года назад

    What other kinds of Raspberries are supported / useable? How low can you go? Can you use a Raspberry 1 Mod. B as well? I have a Camera Rev 1.3. Will this be accurate enough?

  • @snidelywhiplash
    @snidelywhiplash 7 лет назад

    Tool suggestion: For drilling the recess for the lens, a Forstner bit would be useful. They're capable of drilling flat-bottomed holes.

  • @mihirpatil8843
    @mihirpatil8843 7 лет назад

    For night vision, get the NOir camera and some ir LEDs

  • @siddarthpandian5963
    @siddarthpandian5963 4 года назад +1

    I can access the webcam on the local network, but how do we access it over the internet? From outside the private network?

  • @mnbvcxzzxcvbnm
    @mnbvcxzzxcvbnm 7 лет назад

    I'm going to do it. Excited. Thank you guys.

  • @lukaszgudewicz6442
    @lukaszgudewicz6442 7 лет назад

    Awesome project. Will definitely give it a try.

  • @Ricraftsla
    @Ricraftsla 5 лет назад +2

    Thank you so much for the tutorial...
    How to fix "error sending email?"

    • @GeniusFormat
      @GeniusFormat 4 года назад +1

      The error that I am getting is "Error sending email: "

  • @datdoesthings
    @datdoesthings 4 года назад

    Which OS should I install for my Raspberry Pi 3? Before I get into configuring the Camera when the code starts in the video. Thanks!

  • @joybuendia6742
    @joybuendia6742 7 лет назад

    It works, it's better if you read the instructions of the GitHub page, cause have many differences for python 3 or 2 , in my case I needed to changed the route because was different, in my case was: Smart-Security-Camera-Master/.
    Also I needed to download the VIM, just sudo apt-get install vim, and that's it

  • @ntc490
    @ntc490 6 лет назад

    What sort of frame rates are you getting? I was thinking the Pi Zero W would be tool slow for this application. The form factor and price are nice, though.

  • @techtam3505
    @techtam3505 5 лет назад

    Hey guys i would like to say one thing that is instead of human detection you can add facial detection using tensorflow or the same open cv and you can make a smart door lock.

  • @hxdx6950
    @hxdx6950 3 года назад

    What all componets and how much would it cost!
    Haven't watched the video yet please reply

  • @AtenTetsu
    @AtenTetsu 3 года назад

    HI thanks for this great tutorial. But, may I know can I add alarm function when it detect the person?

  • @mohamadalsadi7584
    @mohamadalsadi7584 4 года назад +1

    I need replacing Pi camera with webcam via USB please what is edit code to do that

  • @BillRoberts5
    @BillRoberts5 4 года назад

    How much power does this setup require? If I wanted to build one of these and make it solar powered, how big of a solar panel would be needed?

  • @mariancostinzamfir9357
    @mariancostinzamfir9357 3 года назад

    Smart guys !

  • @joshhagen4182
    @joshhagen4182 7 лет назад

    I wonder if you could have a Bluetooth connection or something and have multiple cameras 🤔 awesome video! Airsoft turret!!! That's sweet I wanted to build one of those In seventh grade. That was in 2010, makes me think I should try building one now!

  • @engineeringtechniques6179
    @engineeringtechniques6179 7 лет назад

    3d printing camera housing would be a great idea.

  • @michaelashitey7930
    @michaelashitey7930 6 лет назад

    Good work done

  • @gawi834
    @gawi834 3 года назад

    you should sell this thing, awesome!!

  • @ahmetenesozturk1902
    @ahmetenesozturk1902 4 года назад +1

    The system detects fine but I have a question, what will happen if it sees a photo ? Can it differenciate "it's picture"

  • @wierdome4320
    @wierdome4320 5 лет назад

    Can i use raspberry pi 3 model b instead of raspberry zero

  • @niler3019
    @niler3019 7 лет назад

    You could easily become a teacher! Thanks for the video!

  • @murderdoggg
    @murderdoggg 7 лет назад

    Nice work with the jigsaw dude. I am surprised you don't have one with a shop-vac attachment.

  • @ashishkumar-gr9hk
    @ashishkumar-gr9hk 6 лет назад

    the browser takes long time to fetch the video feed, is it an internet speed problem or frame rate prob?

  • @Rahulus_
    @Rahulus_ 4 года назад

    can this be done on the raspberry pi b+ 1st gen

  • @Tech_Code127-76
    @Tech_Code127-76 Год назад

    Thanks! Now I could no when my parents come into my room😂

  • @chihoeliew5970
    @chihoeliew5970 6 лет назад

    Is the code you provided only suitable for pi camera? Can I use other webcam instead?

  • @aman.takher
    @aman.takher 4 года назад

    Hi there, Excellent video. One question is this setup is capable with Raspi 4 B?

  • @armelkouadio574
    @armelkouadio574 5 лет назад

    Good video guy's

  • @kennedymwangi60
    @kennedymwangi60 5 лет назад

    nice one i loved it

  • @danielrivera275
    @danielrivera275 4 года назад

    how did you open the code?
    what program did you use?
    Can somebody help please😥

  • @smilelagoonOfficial
    @smilelagoonOfficial 7 лет назад

    Hey for booting should we need Ethernet or Wi-Fi will work please reply

  • @andreamitchell4758
    @andreamitchell4758 6 лет назад

    but why do this instead of using motion eye OS? are there any advantages over motion eye O?
    whcih is the better way to go what the pros and cons of each method and are there any better OS solution in the same vein as motion eye OS?

  • @bradwilliams5290
    @bradwilliams5290 6 лет назад +1

    was all of the raspberry pi stuff done on the pi zero?? if so how did you plug in the keyboard and mouse?

  • @pointer5698
    @pointer5698 7 лет назад

    amazing...i should definitely try this dude

  • @voodoochili12
    @voodoochili12 7 лет назад

    Can multiple cameras be used on the same network? Any tutorials or resources available for that?

  • @bobliao1665
    @bobliao1665 7 лет назад

    Hi,can i reforward this video for another site without commercial purpose?

  • @g.vsrinivasreddy3198
    @g.vsrinivasreddy3198 6 лет назад

    can we do it in rasp 3 i mean is it same process or not

  • @arielomc
    @arielomc 7 лет назад

    Excelent project guys!! I imagine the v2.0 where you install night vision to this security camera.

  • @jakeb8
    @jakeb8 5 лет назад

    How do you make this more secure network wise and do you know the code to arm and disarm this so that way I am not getting an alert every time someone passes by it when I am at home???

  • @sakshamsharma2098
    @sakshamsharma2098 6 лет назад

    Hi I just wanted to make a small sized video camera how can I make it?

  • @NotAllHeroesWearCapes-101
    @NotAllHeroesWearCapes-101 7 лет назад

    accidentally stumble upon your channel .. you guys are doing amazing job :)

  • @jamesshaw3910
    @jamesshaw3910 6 лет назад

    So can this camera feed be viewed when not on the same network?

  • @riffrafftracey
    @riffrafftracey 2 года назад

    Hi great vid how about a vid on the esp32 from start to finish thank you Ha

  • @FireFistMan2772
    @FireFistMan2772 7 лет назад

    What's the best way to implement video storage for y'all's setup? Write a script where you can store the video in a micro-sd card and overwrite 3 min clips at a time after the storage gets full like on dash cams? Or store them through a server?

    • @hackershack
      @hackershack  7 лет назад

      Server storage is probably the best option for a scalable solution, but the 3 min hack would probably work as well.

  • @Colaaah
    @Colaaah 7 лет назад +5

    The best thing for a camera at the front door off Angel is, put a small led ligh. That lights the entrance, then the person looks at the light by curiosity and BAM a nice picture of the front view of there face lol. Talking from experience here too 😉

  • @blakelong6149
    @blakelong6149 7 лет назад

    Any suggestions on how to save short video files or images to a usb or sd card once motion has been detected?
    Also suggestion on using a usb camera instead of a raspberry pi camera?

  • @rocko0028
    @rocko0028 7 лет назад

    Im coming from the wood building/car diy side of the youtubes but am I missing something? How or where does it get power from? And how is it connected to the home network? Does the raspi have a battery? Or WiFi? Can you get different camera sensors for different resolutions? Or some night vision sensors?

  • @frans5163
    @frans5163 6 лет назад

    instead of moving object, can i use this for face recognition? i mean when the camera recognize unknown face then sent gmail

  • @jkamagie
    @jkamagie 7 лет назад

    Nice work, thx for the tutorial

  • @yuvarajvelumani7760
    @yuvarajvelumani7760 4 года назад

    Nice video. Will it work with RPi-B+ and night vision camera during daytime and night?

  • @mr12page
    @mr12page 4 года назад

    First off, great video. Can this work with a 3B+? Do you have an .stl for the case and not one out of mdf?

  • @novechotango5033
    @novechotango5033 7 лет назад

    Good day, Is it possible to merge or connect this project to another project which is Smartphone Connected Home Door Lock as one project? Does the raspberry pi 3 can run them simultaneously? Thank you

  • @jim7smith
    @jim7smith 4 года назад

    I liked the video instructions and materials list and code available, I did not like the background music. Why is it necessary. I just need the instructions. I am sure that a lot of other hearing challenged viewers feel the same.

  • @abelvilla03
    @abelvilla03 7 лет назад +1

    I noticed there was internal ip, can I access this from outside my home. Via cellphone perhaps?

    • @Dogeek
      @Dogeek 7 лет назад +2

      Yes you can access any computer on your network, but you have to set up your router to do so. You need to open ports through your firewall corresponding to the Pi, and then remember your router's public IP address.

    • @abelvilla03
      @abelvilla03 7 лет назад

      Simon thank you.

    • @hackershack
      @hackershack  7 лет назад +1

      +Abel Villa you could also use Ngrok to expose a local tunnel

  • @ChristophPuetz
    @ChristophPuetz 7 лет назад +6

    Can you run this on solar + powerbank the way it is?

    • @TheAnthonywildman
      @TheAnthonywildman 6 лет назад +1

      Christoph Puetz Yes, as long as it can supply 2 Amps you're good.

  • @roid1510
    @roid1510 6 лет назад +1

    This is cool. Is it possible to setup a record function that saves the footage somewhere secure?
    And make a remote you use to switch on the camera when youre going out?

  • @angelicaibay3268
    @angelicaibay3268 5 лет назад

    Your genius bro

  • @aldifachrurrozi4822
    @aldifachrurrozi4822 5 лет назад

    what sensors do you use?

  • @lorensiuswlt
    @lorensiuswlt 7 лет назад

    Nice tutorial...i have a plan to make security camera using raspberry pi like this. Can we take picture/snapshoot while the camera detecting motion so we can upload itu via http to server or send it along with the email attachment?

  • @everton.colombo
    @everton.colombo 3 года назад

    Is it hard to create a new object model?

  • @RiskyStrats
    @RiskyStrats 7 лет назад

    Is there a wait time before it takes another picture or does it spam me with mails when someone is moving in front of the camera for a longer period of time?

    • @hackershack
      @hackershack  7 лет назад +1

      +RiskyStrats waits 10 minutes between emails by default, but it's configurable

    • @RiskyStrats
      @RiskyStrats 7 лет назад

      thanks :)

  • @ducsue751
    @ducsue751 4 года назад +1

    @5:40 Wait. Lucky supermarket store still exist? This was my childhood go to market. Still the same font used.

  • @vinkand6393
    @vinkand6393 6 лет назад +1

    Thank you guys
    I works for me but how to access cam for a different network from anywhere.
    Pls help me...

    • @halilcnar6029
      @halilcnar6029 5 лет назад

      Hello,
      You should edit your routers routing table. An example below
      Public IP x.y.z.t
      internal IP a.b.c.d
      You should route your public ip's some port to internal ip's some port
      x.y.z.t:9999 -> a.b.c.d:8888 then on a public WiFi, if you write your xyzt:9999 to the browser's address bar, you will see your camera. But it is not secure. Anyone that knows your routing table(camera port?) and public IP(may be static or dynamic ip) can see your house:)

  • @rubenheredia4938
    @rubenheredia4938 4 года назад

    can it work with NOIR camera?

  • @shortcutDJ
    @shortcutDJ 6 лет назад

    Question: can i use a pi 3? with a USB webcam?

  • @greywolf4686
    @greywolf4686 7 лет назад

    Can this be added to the smart mirror

  • @danielchisica6486
    @danielchisica6486 6 лет назад

    Can be made this camera with a Raspberry Pi 3 Model B?

  • @aniruddhamulay2932
    @aniruddhamulay2932 6 лет назад

    Can i train the object detector using my own dataset on a pc and then deploy it on a Raspberry Pi as i want to build a security system which classifies between threat and no threat.

  • @adityaunde7611
    @adityaunde7611 7 лет назад

    can we run the same code on laptop using webcam and show the results live?Please help.