Raspberry Pi Zero W Surveillance Camera using MotionEye OS (2024)

Security is one of the main concerns now days, and there are numerous technologies available to keep your home/office safe and monitored. CCTV and IP cameras are an excellent way to monitor your home or office but setting up these cameras remain prohibitively expensive. So, in this tutorial we are going to build a Surveillance Camera using Raspberry Pi zero W, Pi camera module and MotionEYE OS. This is a fantastic and inexpensive security tool with numerous configurable features that can be set up in a matter of minutes. Although it cannot wholly replace the role of CCTV and IP surveillance cameras but will make it easy for low-income home owners to monitor their homes at a very affordable price.

Introduction to MotionEYE OS

MotionEye OS is a free open-source application that turns a Raspberry Pi with a camera into a home video surveillance system, with photographs and movies that may either stay on your device (and home network) or can be automatically sent to a cloud-storage service like Google Drive or Dropbox. Itis a Linux-based OSthat transforms a single-board computer into a security system. The operating system is based on BuildRoot, with motion as the backend and motionEye as the frontend.

Features

  • Easy installation and setup
  • Web-based, mobile/tablet-friendly user interface
  • Compatible with mostUSB camerasas well as with the Raspberry PI camera module
  • Support forIP (network) cameras
  • Motion detectionwith email notifications and working schedule
  • JPEGfiles for still images,AVIfiles for videos
  • Timelapsemovies
  • Connects to your local network usingethernetorwifi
  • File storage onSD card,USB driveornetwork SMB share
  • Uploading of media files to cloud storage services (Google Drive,Dropbox)
  • Media files are visible in the local network asSMB shares
  • Media files can also be accessed through the built-inFTP serverorSFTP server

Components Required Building a Surveillance Camera

  • Raspberry Pi Zero W
  • Monitor
  • USB Hub
  • OTG Cable
  • Micro HDMI
  • Micro SD card

Installing MotionEYE OS on Raspberry pi zero W

Step-1 Openthis linkand download the MotionEYE OS for Raspberry Pi zero W. Keep in mind that it itself is an OS, and you should not install any other operating system on Pi zero W. In the below image, you can see all the MotionEYE OS available. Click on the red circle link and your MotionEYE OS will start downloading. After downloading,extract the downloaded file by using WinRAR software. Here, we have used WinRAR for extraction but you can use any software for extraction like WinRAR or Easy 7-zip.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (1)

Step-2 You should insert a micro-SD card into your computer. Here, I am going to use 16GB micro-SD card. Now, open this link todownload the raspberry pi imagersoftware then install and open Raspberry Pi imager software. Select the extracted MotionEYE operating system by using the choose OS option. Select your micro-SD card by using storage option and then click on the write button. MotionEYE OS will be installed in few minutes.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (2)

Step-3 Now, you need to connect the Raspberry Pi zero W with Wi-Fi network. To do this, open the micro-SDcard and create a text file named wpa_supplicant.conf in the root directory of the micro-SD card. This file will help you to setup a Wi-Fi connection on Raspberry Pi zero W so paste the below lines of code in the config file

country=INctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={scan_ssid=1ssid=" Wifi Name "psk=" Wifi Password"}

I have written IN country code here. You can enteryour country code. For example, if you are from the United States of America, then use country code US instead of IN. Use your actual WiFi name and password in ssid and psk.

Step-4 Connect your monitor with Raspberry Pi zero W by using micro-HDMIcable and connect OTG cable to Raspberry Pi zero W. Now, connect mouse and keyboard to Raspberry Pi zero W using USB hub. Lastly, connect your Pi camera with Raspberry Pi zero W board. We have explained pi camera interfacing with raspberry pi zero W in our previous tutorial. In above image, you can see all connections on Raspberry Pi zero W. Now, every connection has been completed so power up the Raspberry Pi zero W by using micro-USBcable. Raspberry pi zero W starts booting and you will see below image on your monitor display. Make sure after booting your Pi camera red light should glow.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (4)

Step-5 You can see meye-77f2ebad login: line on your monitor display. Here, you have to put user name. Enteradmin as a user name with a blank password. You don’t need to type any password, just press enter. Now your monitor display should be look like this.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (5)

Step-6 Open web browser in your PC and make sure that your PC is connected to same Wi-Fi network as Raspberry Pi zero W. Now, enter the IP address of your Raspberry Pi zero W in web browser. If you could not find IP address of your Raspberry Pi zero W, you can get it by using some applications. Here, we have connected our Raspberry Pi zero W and PC with mobile hotspot. You should download Wi-Fi router manager android app in your mobile phone. Connect all the devices including Pi zero W to your mobile hotspot network. Open Wi-Fi router manager app, it will automatic starts searching the connected device. Now, select the device details option and then you will get IP address of your Raspberry Pi zero W board.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (6)

After entering the IP address of your Raspberry Pi in your browser, you will see below screen in your browser. Enter the username and password same as before.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (7)

Now, you will be able to see live surveillance on your browser from Pi camera. In the below picture, you can see surveillance from pi zero camera. We can add more cameras to same MotionEYE OS.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (8)

3D Printing of Security Camera Case

As this project will be used in surveillance purpose, I decided to 3D print an enclosure for raspberry pi security camera. I measured the dimensions of the setup using vernier to design a casing. Once it was done, my design looked something like this.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (9)

After I was satisfied with the design, I exported it as an STL file, sliced it based on printer settings, and finally printed it. The STL file is also available fordownload from Thingiverseand you can print your own casing using it. You can see printed security camera case in below image.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (10)

After the print was done, I proceeded with assembling the project set-up in a permanent enclosure for future use. Once the complete connection was done, I assembled the circuit into my casing and everything was nicely fit as you can see below:

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (11)

Finally. I have wrapped some stickers on it and I have mounted the Raspberry Pi zero security camera on the wall. You can see final view of Wi-Fi security camera in below images.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (12)

So, this is how you can install MotionEYE OS on Raspberry Pi zero W and built Raspberry Pi surveillance camera. In the upcoming tutorial of Raspberry Pi Zero W series, we will make Alexa using Raspberry Pi zero W by using API. Hope you enjoyed the project and learned something useful, if you have any questions, please leave them in the comment section below or use ourforumto start a discussion on this.

Raspberry Pi Zero W Surveillance Camera using MotionEye OS (2024)
Top Articles
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 6036

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.