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:
Items
- Pi Zero 2 W
- Ribbon Camera & night vision camera tested as working (not tested with Pi-Cam v3)
- Small utility box like this
- 10,000 mAh Battery Pack or Pi battery-hat
- Power supply/cable & microsd cards.
Optional
- Pi Zero 2 W
- 3.5 GPIO touchscreen
- Mobile phone stand
- 90-degree micro-USB adapters
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
-
Download Jawsper’s version of MotionEyeOS
-
Extract the image to your hard drive (using Winzip, 7Zip, etc.)
-
Write the image to your microSD card using Win32DiskImager/Balena etcher/pi imager
-
DO NOT EJECT THE SD CARD yet
-
Open Windows Explorer and browse to your drive containing the microSD card. You should see files such as:
-
bootcode.bin
-
loader.bin
-
-
Right-click in the right window pane and select New Text Document.
-
Now, right-click on this file and rename it wpa_supplicant.conf. Make sure to remove the .txt file extension.
-
Once again, right-click on this file and select Edit with Notepad++.
-
Make sure you set the EOL conversion to UNIX LineFeeds (Edit-->EOL Conversion-->Unix LF).
- 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|"
}
-
Save the file.
-
Eject your microSD card safely.
-
Insert this microSD card into your Pi Zero 2 W.
-
attach a camera to your device via USB or ribbon cable
-
Apply power to your device.
-
If you have a monitor attached to the device, you should see the wireless network service starting, wpa_supplicant being read, and 'brcmfmac Done'.
-
Shortly, you should see the IP address being displayed along with your gateway and DNS servers.
-
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.
-
-
Set up motion detection threshold and notification methods. Login using admin as username (no password - can be set in settings after login)
-
You can shut down the MotionEyeOS remotely by selecting advanced settings-->shutdown.
-
Now you just need to build the case. Select or print a case that fits your Pi and battery pack - if using one.
-
Drill a hole for the camera, and add a fan if needed.
-
Test to make sure it works & doesn't get too hot.
-
To set up a small low-power dedicated device for viewing the camera feed -
-
Download Rasbian and connect a screen and controller to your Pi Zero 2w. Connect to the same local network
-
Add and configure the 3.5 screen as per Core-Electronics´ excellent guide
-
Edit settings to disable screen auto-dimming.
- 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
- Download Pi-Apps by opening the terminal and entering:
- Search for AutoStar and download it.
- 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.