Build your own Raspberry Pi Security Camera system with less than $100 budget. It offers advanced functions like motion detection, video recording, live IP streaming and email/SMS notifications. Using just a dummy security camera dome, Raspberry Pi board with a camera module and Wi-Fi. The configuration is very user friendly via GUI (web interface).
- Raspberry Pi 3 (older Pi 2 would work as well)
- Pi HD No-IR Camera module
- USB Wi-Fi (not required for Raspberry Pi 3 with integrated wireless or if you have Ethernet connection available)
- Dummy/fake dome camera housing
Put the security camera together
I did not want the camera to be very visible, so I decided to put it into a dome housing. You might want to choose any other dummy security camera, for example a CCTV case. Just make sure there is enough space inside for the hardware – not only to fit a Pi board (85.60mm x 56mm x 21mm or roughly 3.37″ x 2.21″ x 0.83″), but also the USB connections for Wi-Fi and power adapter. My dome was actually too small (95 mm diameter) and I had to make my own cabling with extra short connectors.
If you are not sure how to connect a camera module to the board, visit this setup page with a video. It is also possible to use any kind of USB Web Camera instead. The operating system based on the Raspbian is compatible with most of them, meaning no driver installation is necessary.
Wireless connectivityIt is very likely you will not have an Ethernet connectivity available, so a Wi-Fi is required to access the security camera remotely and setup a video recording over the network (to your own server or Dropbox/Google Drive). In case of Raspberry Pi 3 the Wi-Fi is already built-in, but if you selected any other board or you need a stronger signal using an external antenna, then a USB module is required. Most of them are supported by OS natively, I used TP-LINK TL-WN722N Wireless N150.
If a night vision is required then make sure you buy a camera module without an IR filter, usually labeled NoIR (No Infrared). It will make the colors a bit unnatural during day, but gives you the ability to use infrared light when it gets dark.
For IR LEDs I just disassembled one old damaged camera and removed a board with many IR LEDs and a light sensor (to automatically turn on the circuit only during night). This board works independently and only needed a separate power.
Unfortunately I was not able to put the light inside of the dome, because the dome shape (and possibly material) reflected the IR light back to the camera and the image was almost completely white. So I was forced to keep the light as external – you might want to consider it and avoid such issue.
An obvious weakness of this system is no backup power if a criminal cuts the power. Either by snipping a power cord (which can be avoided by installing it inside of a wall) or just by disabling your circuit breaker. Therefore you should consider a backup battery or UPS system depending on your use case. Lower energy consumption device, like a Raspberry Pi Zero would be more convenient in such case. With no backup you should at least make sure the criminal is recorded before he gets an access to the security camera power.
Similar issue is a possibility to jam Wi-Fi signal. In that scenario a recording stays stored at least on the SD card.
MotionEyeOS is a Linux distribution which turns your single board computer into a video surveillance system. It is all-in-one package for this purpose and it is very easy to install and setup using a web-based (mobile/tablet-friendly) user interface. Just a few major features:
- supports single board computers like Raspberry Pi 1,2,3, Banana Pi, Odroid C1,C2,XU4 and Pine A64
- compatible with most USB cameras as well as with the Raspberry Pi camera module
- motion detection with email notifications and working schedule
- JPEG files for still images, AVI files for videos
- timelapse movies
- upload of media files to cloud storage services (Google Drive, Dropbox)
- media files accessible through Samba (Windows sharing), (S)FTP server
For download and installation instruction follow https://github.com/ccrisan/motioneyeos/wiki/Installation. After it is ready, the system listens on TCP port 80 (http), so you can connect to it with a web browser in your local network:
After a login (default username is “admin” with no password), the configuration becomes accessible:
The motion detection needs to be tweaked – it works by comparing the number of different pixels in consecutive frames. Therefore it is very specific for each environment. In my case 0.5% threshold was the best. I have to accept false alarms caused by moving trees when it is windy.
Keep in mind there are some limitations to the motionEyeOS as it is not a general-purpose Linux distribution. Most important is that you can NOT install packages like you are used with a normal Raspbian distribution. If that is a problem for you then take a look at installing motionEye on a common distro.
A Raspberry Pi 3 in combination with MotionEyeOS allows you to build a surveillance camera system with professional functions found only in much more expensive products. You could use multiple cameras and create a whole surveillance network. The OS also provides a direct MJPEG streaming, so it can be integrated with an external security camera system. It also possible to integrate it in your own website using <img> or <iframe> elements. Streaming authentication is supported.
The video quality is very good – you can download an example of a short video captured by my Raspberry Pi Wi-Fi camera after a motion was detected: 08-35-04.avi. After using it for a few weeks I can also say it is reliable, you just need to make sure the wireless signal is strong enough and to protect the surveillance camera from adverse weather conditions (if used outdoor).