DIY Professional Open Source Night Vision Security Camera




In this new tutorial, we will together make our Raspberry Pi open source video surveillance camera.
Yes, we are talking here about a real open source outdoor surveillance camera, capable of night vision and motion detection, all connected to our Jeedom domotic solution.

Now let's have fun. ^^

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Equipments

In order to launch this project, we will need:

    • Raspberry Pi 3B + (important)
    • 32 GB SD card
    • Cooling kit
    • USB IR camera or raspicam
    • PVC pipe diam. 63 mm, length 20 cm
    • Sleeve and trapdoor diam. 63 mm
    • Poe injector (12/24/48V DC power source)
    • DC/DC converter
    • Camera mounting arm
    • Waterproof PG13 mouthpiece
    • Anti-humidity bags
    • Spay paint
    • Files
    • PVC glue

    Total cost around 100€, maybe less if you have already some parts at home. Of course, the Raspberry PI and USB camera are the most expensive things in the list.

    Step 2: Raspberry Pi Preparation

    Let's start things serious, for this, we start by installing our cooling kit on our Raspberry PI with a little thermal paste.

    Then on the SD card, install MotionEyeOs, this is an open source distribution specifically designed to turn our Raspberry Pi into a connected camera. For more information, visit the GitHub project. Alternatively, there is also shinobi which is also very good work.

    We use as usual Etcher who will take care of everything for us. These operations will take about 30 minutes.

    Step 3: Raspberry Pi Continu

    Then plug his camera, I opted for a pro model very close to what is found in commercial cameras.

    This is a 1080p 30 fps camera with automatic night vision system all on a single USB cable. You can find this on chinese resealer between 25€ to 55€

    Here mine :

    One thing is on with this little gem, quality and performance are the rendezvous even in the darkest night.

    Step 4: Raspberry Pi Alimentation

    To power our camera, we will use the POE (Power Over Ethernet), it allows to use two pairs of RJ45 cable to pass through a supply voltage. So we avoid two cables instead of one. And later you understand that this saves us a lot of space in the assembly phase.

    In order to achieve this, it is imperative to use a Raspberry Pi 3B +, the only model equipped on the 4 GPIO pads allowing us to easily recover the power supply of the RJ45 cable. The 4-pin jack is located under the GPIO, at its right end behind the USB ports.

    The voltage supplied by the POE is between 5V and 48V. It depends on your power supply or your switch if it is designed with POE. In order to take into account this disparity, I will use a DC / DC converter to transform the POE voltage into a 5V voltage that will be reinjected by the GPIOs.

    Here, the converter is based on LM2596 which are step-down converters. And especially the model LM2596HVS (High Voltage) which is able to support up to 57V input. The card is equipped with a potentiometer to precisely adjust the output voltage.

    I used this module with an output voltage set to 5V. When the adjustment is finished, remember to fix the screw of the potentiometer with a drop of nail polish. All that remains is to secure the assembly in a heat-shrinkable sheath. On the other side, there is a POE injector here that will inject 48V in the network cable.

    Step 5: The Case

    For the case, I am part of a PVC pipe that is found in DIY stores with a diameter of 63 mm which corresponds to very few things close to the width of the Raspberry Pi, coupling and a waterproof inspection hatch/trapdoor.

    We begin by cutting the plexiglass to obtain a disc diameter of 63 mm that we will slip into the sleeve. The separator inside the sleeve will serve as a support to glue the assembly.

    For the pipe, I cut a section of 20 cm. At one end, I created a notch to pass the jack connector of the Raspberry Pi (picture 2). And for the hatch of visit, I do the same thing in order to be able to withdraw and put back the Raspberry Pi in its lodging once this one sticks.

    Step 6: More Case

    The hardest is for the case, the suite is more aesthetic than functional. I then reduced the size of the front sleeve so that it does not appear in the field of view of the camera. With a piece of pipe cut in half, I set up a kind of cap to protect the camera's field of vision from dust and water.
    Inside, there is a piece of spring-shaped pipe that allows me to cleanly clamp the USB camera to the bottom of the case so that it does not move. The set will be painted black to make it more discreet and give a professional look.

    Step 7: More Details

    All that remains is to add bags of anti-humidity granules, a mounting arm, a waterproof PG13 mouthpiece to pass the network cable and to paint the whole in black.

    Step 8: MotionEyeOs Configuration

    As I said above, with MotionEyeOs we have the ability to do motion detection. It is thanks to the Motion software, it will compare the successive images and determine the number of different pixels and depending on the threshold triggered motion detection.

    The configuration is relatively simple to take in hand. We start with the system configurations, then we add its camera, here a USB camera. The following settings are at your convenience.

    For my part, I activated motion detection. This one will trigger several things. First, sending an event to Jeddom via the API. Then he will record the entire sequence and send it to my NAS.

    Step 9: Jeedom Configuration

    The simplest part, here, we will simply retrieve the RSTP streaming stream to make it appear on the dashboard. It will also be an opportunity to retrieve the motion detection information for example to trigger a sending a Telegram or MMS with a photo.

    Step 10: Conclusion

    We are here with our IP Surveillance Night Vision and Motion Detection Camera, all open source based on our beloved Raspberry Pi.

    Now have fun, and if you like my instructables please vote for me in the contest, thanks.

    Safe and Secure Challenge

    First Prize in the
    Safe and Secure Challenge

    Be the First to Share


      • Made with Math Contest

        Made with Math Contest
      • Multi-Discipline Contest

        Multi-Discipline Contest
      • Robotics Contest

        Robotics Contest

      18 Discussions


      9 months ago

      Do you have any problem with reflection from the IR leds back from the lens?

      1 reply

      Reply 9 months ago

      At first yes, but then I cut an aperture for the lens in the plexiglass circle. And since the quality is perfect and without reflection. You can judge on the screenshots of motioneyeos and jeedom.
      If anyone has a solution without cutting an opening in the plexiglass circle I am curious. I have a second camera under construction that could do beta test.


      9 months ago

      When you refer to 63 cm (everywhere) don't you mean 63 mm?
      How about the 20 cm pipe?
      Thanks for the post.

      1 reply

      Reply 9 months ago

      Yes you are right PVC pipe diameter 63 mm length 20 cm. I correct the article. thanks


      9 months ago

      63cm diameter.... You could stuff a whole laptop in there!
      I think you mean 63mm.

      1 reply

      Reply 9 months ago

      Thanks, I correct the mistake. You are right 63 mm diameter.


      9 months ago

      I was wondering how this would work in the winter time here in Canada. -30C is not uncommon.

      1 reply

      Reply 9 months ago

      This is a very good question, I am happy to answer you, I found an answer on the site of raspberry.

      "The Raspberry Pi is built from commercial chips which are qualified to
      different temperature ranges; the LAN9514 (LAN9512 on older models with 2
      USB ports) is specified by the manufacturers as being qualified from
      0°C to 70°C, while the SoC is qualified from -40°C to 85°C. You may well
      find that the board will work outside those temperatures, but we're not
      qualifying the board itself to these extremes."

      What fear me the most is moisture, IT's why I put moisture bags inside the pipe.


      Answer 9 months ago

      I made my estimates and I added that in the tutorial, I get around 100 €. It may be less expensive if you, for example, get a pipe fall at the hardware store. Bomb paint at the discount store. And the camera on a Chinese site, mine comes from below and I'm very happy with the quality.


      9 months ago

      Okay, so in summary of everyone else's questions plus my own. What was the total cost of the parts? Do you have any reflection from the IR LED's? What camera are you using as well as link to that?

      1 reply

      Reply 9 months ago

      I made my estimates and I added that in the tutorial, I get around 100 €. Regarding the reflection, I had at first, but by cutting a circle in the center of the plastic circle to pass the lens I can not get any more. The Jeedom screenshot shows you the result I get in complete darkness with active IR.
      And I found my camera here :


      9 months ago

      Not the author, but I quickly looked things up on Ebay (all prices are approximate and in USD):

      Camera - $40 - $50.00
      RasPi - $40.00
      Voltage Converter - $3.00

      Figure another $10 - $15.00 USD for the PVC pipe and fittings (and that's probably high), and the software being free; you're looking at a total cost of around $100.00 USD.

      You might be able to find the camera module cheaper on AliExpress or other retailers like that; you could also substitute in a different module, or one that connects up to the Pi's camera connector (though you wouldn't get the IR capability - you'd have to come up with a different solution for that). You might be able to bring the cost down to $70.00 USD total with some careful shopping.

      I've built a MotionEyeOS camera using parts off Amazon - a CanaKit Pi Zero W and a SainSmart camera module - for about $40.00. The Pi Zero kit comes with a case for mounting the Pi and camera in, and you can power the module off USB (via the kit's 5V power supply or otherwise). WiFi connect to the network. I have mine set up - just with MotionEyeOS - to email me pictures to a gmail account when triggered. Works very well. Doesn't have IR, though. But really inexpensive (AFAIK the cheapest and smallest Wireless IP camera you can purchase).

      For a mount I added a 1/4-20 nut to the backside with epoxy, then standard hardware to attach to things (the 1/4-20 is standard photography nut size - so you can mount it on a regular tripod if you wanted, or any other similar standard mount).

      1 reply

      Reply 9 months ago

      Super comment. I did the same calculation on my side, I arrive at the same estimates. Indeed the camera module on a Chinese dealer is less expensive. I put the link in the article where i found mine and the quality is top.