Pi Zero Motion Sensing Camera

Updated 13 September 2024

The Pi Zero Motion Sensing Camera is a portable security camera using a Pi Zero 2W, Pi Zero camera, Battery Pack, and Case.  I started this to have a taskable security camera with motion capture & notifications. I had some spare Pi Zero 2 Ws so I built two of these, one with a battery pack to move about as needed, and another running on mains with an Infrared light and camera to use as a motion-sensing security camera at the front door. The live feed from these devices is visible by logging into the system on another device on the same network.

 

This project will build motion-sensing security cameras with some spare Pi Zero 2Ws. I built two, one to move about as needed, and another with an Infrared light and camera to use as a motion-sensing security camera at the front door.  

This project consists of a Pi Zero 2 W running a version of MotionEyeOS - connected to a camera & battery pack in an enclosure. For the mobile camera, I used a ribbon camera with no IR filter.  I added a fan for ventilation.  It was intended to be unobtrusive, protected from the elements, and durable.

The infrared camera has no fan or battery, I just glued it in place and fixed a hat on top to protect it from drips and splashes.

On another Pi Zero 2 W, I attached a small screen that when powered on auto-opens the live feed in a web browser in fullscreen mode.

BOM:

Problems & Considerations

Problem

motionEyeOS is not supported for the new Pi Zero 2W, also it usually requires ethernet for the first setup. The project is based on this old post and this recent YouTube video

Considerations

Battery size - and accessibility for mains power/ recharging.  

I used a spare 3700mAh Pi battery-hat which lasted about 5-6 hours but a 10,000 mAh battery pack also just fits inside the case and lasts much longer.  For the infrared camera, I used mains power as it will be left on for days and is near power points.

WiFi signal and range are also considerations, although it can still work as a trail cam and save videos or photos without a wifi connection.

Detailed Steps

  • Download and flash Jawsper’s version of MotionEyeOS to a micro SD card
  • Edit wpa_supplicant.conf file to include wifi keys
  • Make sure Country=AU
    • & update_config=36
  • Startup motioneyeOS with a monitor attached. Find the IP and enter it on a web browser on the same network. 
    • (Default account is admin - Password is blank - you can change it once logged in)
  • Select a battery pack, purchase, or make an enclosure. Decide on the location of items and drill camera/cable access holes, waterproof as needed. Decide if you require heatsinks, fans, or ventilation vents.
  • Set up motion trigger for MotionEyeOS & File storage. Test.
  • Modify as needed

Detailed Walkthrough

  1. Download Jawsper’s version of MotionEyeOS

  2. Extract the image to your hard drive (using Winzip, 7Zip, etc.)

  3. Write the image to your microSD card using Win32DiskImager/Balena etcher/pi imager

  4. DO NOT EJECT THE SD CARD yet

  5. Open Windows Explorer and browse to your drive containing the microSD card. You should see files such as:

    • bootcode.bin

    • loader.bin

  6. Right-click in the right window pane and select New Text Document.

  7. Now, right-click on this file and rename it wpa_supplicant.conf. Make sure to remove the .txt file extension.

  8. Once again, right-click on this file and select Edit with Notepad++.

  9. Make sure you set the EOL conversion to UNIX LineFeeds (Edit-->EOL Conversion-->Unix LF).

  10. Paste the following contents into your blank file (obviously changing the SSID and psk to match yours):
     country=AU

     update_config=1

     ctrl_interface=/var/run/wpa_supplicant

     

     network={

          scan_ssid=1

          ssid="MyWiFiSSID"

          psk="S3cr3tp@$$w0rc|"

     }
  1. Save the file.

  2. Eject your microSD card safely.

  3. Insert this microSD card into your Pi Zero 2 W.

  4. attach a camera to your device via USB or ribbon cable

  5. Apply power to your device.

  6. If you have a monitor attached to the device, you should see the wireless network service starting, wpa_supplicant being read, and 'brcmfmac Done'.

  7. Shortly, you should see the IP address being displayed along with your gateway and DNS servers.

  8. Using a browser on another device, browse to the IP address that was displayed and log in to the device using the default MotionEyeOS credentials of admin / [blank password]

    • Note: If you do not have a display attached to your zero, you can use Nmap to scan your home network for any new devices / IPs.

  9. Set up motion detection threshold and notification methods. Login using admin as username (no password - can be set in settings after login) 

  10. You can shut down the MotionEyeOS remotely by selecting advanced settings-->shutdown.

  11. Now you just need to build the case.  Select or print a case that fits your Pi and battery pack - if using one. 

  12. Drill a hole for the camera, and add a fan if needed.

  13. Test to make sure it works & doesn't get too hot.

  14. To set up a small low-power dedicated device for viewing the camera feed - 

  15. Download Rasbian and connect a screen and controller to your Pi Zero 2w. Connect to the same local network

  16. Add and configure the 3.5 screen as per Core-Electronics´ excellent guide

  17. Edit settings to disable screen auto-dimming.

  1. Autostar to autostart apps:
     
    • Download Pi-Apps by opening the terminal and entering: 
      wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash
  2. Search for AutoStar and download it.

  1. Open Preferences then AutoStar and make a new entry with your IP:
    chromium-browser http://192.16.YOUR.IP --kiosk

Then when it turns on, it will open the link to your MotionEyeOS feed in fullscreen mode.  Tap the screen to fullscreen the feed further.

You can now watch live as birds steal your fruit.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.