• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
DarkBlueBit.com

DarkBlueBit.com

DIY projects with Arduino and Raspberry Pi

  • Arduino
  • Raspberry Pi
  • About
    • Contact
    • About Me
    • Amazon Affiliate Disclosure
    • Privacy Policy
You are here: Home / Raspberry Pi / USB Security Camera with Raspberry Pi

USB Security Camera with Raspberry Pi

camera-usb-featured

Surveillance video system with USB camera and a Raspberry Pi running MotionEyeOS. Get advanced functions like a motion detection, video recording, streaming and email/SMS notifications.

youtube-subscribe-button

This is an update of my previous Security Camera project from the last year. In 2016 I used a native Raspberry Pi camera module and put it together with the board inside of a dummy camera dome. This time I want to build another security camera with slightly different requirements to leverage experience from the previous project:

  • Use a USB camera
  • Camera with auto-focus
  • Resistance against freezing temperatures

Hardware list

Raspberry SC15184 Pi 4 Model B 2019 Quad Core 64 Bit WiFi Bluetooth (2GB)
  • Raspberry Pi 4 (older Pi 2 or 3 would work as well)
  • ELP USB Camera on Amazon.com | on Aliexpress.com | on manufacturer’s website
  • USB Wi-Fi (not required for Raspberry Pi 3 with integrated wireless or if you have Ethernet connection available)
  • Dummy/fake dome camera housing (optional if you use ELP camera casing)
ELP 60degree 5 megapixel Camera Module with 1Meter USB Cable
  • 5V power adapter
  • MicroSD card >8 GB

USB Camera

The quality of 5MP Raspberry Pi camera module (rev 1.3) is quite good, with the maximum resolution of 2592 x 1944 px. In my setup I preferred a lower FullHD resolution (1600 x 1200 px) anyway, because the real-time transport by a Wi-Fi was too slow for big images. At the time of writing this article you can already buy a newer version (v2) of this camera module supporting up to 8MP (3280 × 2464 pixels) for the same price as v1 – detailed HW specification comparison between v1/v2. For me, however, the major issue was a CSI (Camera Serial Interface) used to connect the module to Raspberry Pi. Its length was very limited without any possibility of extension, forcing me to keep all HW (Pi board, Wi-Fi, camera, SD card) in the same place outdoor. This proved to be a problem during winter (sub-zero F). Sometimes the camera went dark and ocasionally the whole Pi board stopped communicating. A reboot usually helped, but a security camera should reliably work 24×7. A minor issue was a missing auto-focus – I was hoping to get a clearer picture of new close objects (e.g. to read a license plate of a vehicle).

Therefore I decided to try a USB camera instead. It is the only component outdoor kept in a dummy case. A USB cable then goes through a window indoor, where it connects to a Raspberry Pi board. This allowed me to eliminate Wi-Fi as I have Ethernet available indoor. It increased the security (avoiding Wi-Fi jamming) and transmission speed. A big advantage of USB cameras is that you might already have one at home with no use for it. And if you decide to remove the security camera one day, a USB camera can be connected to any other computer, not just a Raspberry.

I selected an ELP USB Camera with 5MP resolution and autofocus, based on OV5640 CMOS chip. You can find its alternatives without autofocus and/or with a small case. The case is perfect if you want to hide the camera. In my project I reused a dome to keep it visible. There are also different USB cable lengths ranging from 1 to 5 meters.

ELP USB Camera 5MP Specifications

Source: http://www.webcamerausb.com

spec table

MotionEyeOS

As an operating system I installed the MotionEyeOS again. It is a Linux distribution which turns your single board computer into a video surveillance system. For more details (installation, configuration) take a look at the previous project.

Many readers have asked me about a USB camera support in this OS. Usually all USB cameras working on Linux are supported. To be sure you should look if your camera works with v4l driver. I had no problems with the ELP module, it was automatically recognized by a fresh installation of the MotionEyeOS (release 20171008):

MotionEyeOS - USB camera

Comparison

The screenshots below show the differences between Raspberry Pi camera module v1.3 and ELP USB camera. The biggest difference (lack of colors) is caused by Raspberry module NoIR filter to support additional IR LEDs for night vision.

 Screenshot from 2016: Raspberry Pi NoIR camera module
ELP-camera-screenshot
Screenshot from 2017: ELP USB camera module

Conclusion

If you plan to use a Raspberry as a surveillance video system, then I recommend to consider a USB camera. MotionEyeOS is compatible with majority of models and you can choose a quality to fit your project instead of being limited by only two choices of Raspberry Pi camera modules. Do not forget it allows you to keep the camera much further from the board (up to 16 feet/5 meters) and to re-use the camera with any other computer later.

Category: Raspberry Pi

Disclosure

Articles on this website contain paid links leading to Amazon.com.

As an Amazon Associate I earn from qualifying purchases.

Read more

Reader Interactions

Comments

  1. Pedro Machuca

    October 28, 2017 at 15:28

    Hi. Where can I get the USB camera?

    Reply
    • DarkBlueBit

      November 1, 2017 at 08:49

      you can use the link in the article or just google any USB camera supported in Linux

      Reply
  2. Alex

    August 25, 2018 at 21:14

    Do you know if I can control the camera parameters? Like autofocus/exposure?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

four + 16 =

About

About Me

Contact

Privacy Policy

Amazon Affiliate Disclosure

Social Profiles

  • Facebook
  • Twitter
  • YouTube

Copyright © 2023 · DarkBlueBit.com · All Rights Reserved · A redistribution or reproduction of the contents in any form is prohibited except with our explicit written permission.