---
title: Solar Powered Raspberry Pi Camera
date: 2019-08-09T17:54:25+00:00
modified: 2025-12-22T17:35:31+00:00
image:: https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-camera-solar-panel-12v-in-a-tree.jpeg
permalink: https://kaspars.net/blog/solar-raspberry-pi-camera
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
category:
  - Electronics
  - Home Automation
  - Video Blog
post_tag:
  - MikroTik
---

# Solar Powered Raspberry Pi Camera



**Update:** this project was featured in [issue 92 of the official Raspberry Pi magazine](https://magpi.raspberrypi.org/issues/92/) ([download as PDF](https://magpi.raspberrypi.org/issues/92/pdf), [buy the issue](https://store.rpipress.cc/products/the-magpi-magazine-92) or [subscribe](https://magpi.raspberrypi.org/subscribe/new)).

SSH-ing into a remote solar powered Raspberry Pi at the top of an apple tree has a special feeling — almost like commanding a spaceship where any mistake can cost you a lost link.

[![Raspberry Pi in a dummy security camera in a tree.](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-camera-solar-panel-12v-in-a-tree.jpeg?strip=all&quality=90&resize=1024,1024)](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-camera-solar-panel-12v-in-a-tree.jpeg)Raspberry Pi in a dummy security camera case placed in an apple tree with a 100Wp photovoltaic panel and a 12V battery for power.I build this project to remotely monitor our countryside house.

## Internet Connectivity

There are two options:

1. A mobile USB modem attached directly to the Raspberry Pi [using the point-to-point (PPP) protocol](https://wiki.debian.org/Modem/3G), or
2. A [standalone mobile modem/router](https://mikrotik.com/product/wap_lte_kit) creating a WiFi network.

I decided to go with a standalone modem that is plugged in at my neighbours house because of complexities involved in creating a reliable [PPP connection](https://github.com/kasparsd/remote-pine).

## Components

- $8 [Raspberry Pi Zero W](https://kaspars.net/go/raspberry-pi-zero-w) which supports the camera module.
- $29 [Raspberry Pi Camera module](https://kaspars.net/go/raspberry-pi-camera-v2) (and [a cable for Raspberry Pi Zero](https://kaspars.net/go/raspberry-pi-zero-camera-cable)).
- $18 any 12V battery capable of delivering 1.5W x 24h = 36Wh, such as [this 7Ah Pb battery](https://www.ebay.com/sch/i.html?_nkw=12v+7ah) (80Wh).
- $8 [dummy security camera](https://kaspars.net/go/dummy-security-camera).
- $10 [12V charge controller](https://kaspars.net/go/12v-solar-charge-controller).
- $2 [12V to 5V buck converter](https://kaspars.net/go/5v-dc-buck-converter) to power the Raspberry Pi.
- $15 cabling and connectors.
- $132 [100Wp solar panel](https://kaspars.net/go/100w-flexible-solar-panel).

Total: $222 + $7 per month for a 10GB mobile data plan.

## Notes

- Avoid blocking the `/dev/video0` device when not used to allow other things such as timelapse scripts to capture photos or record videos. This is hard with things like the Motion daemon which constantly blocks the video device source.
- Use the [official `picamera` Python library](https://picamera.readthedocs.io/) for accessing the camera and formatting the image and video to match the required output.
- [AutoSSH](https://www.harding.motd.ca/autossh/) in combination with a custom [systemd service](https://www.freedesktop.org/software/systemd/man/systemd.service.html) is great for creating and maintaining a persistent SSH tunnel from Raspberry Pi to a remote server. **Update:** [Use WireGuard for secure remote access](https://kaspars.net/blog/wireguard-raspberry-pi).
- Rsync with hourly cron jobs is great for uploading and syncing photos and videos to a remote server for persistent storage. It also allows deleting older captures from Raspberry Pi while keeping them on the storage server.

Some of these scripts are available [in this GitHub project repository](https://github.com/kasparsd/pine-monitor).

## Photos

[![](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-camera-in-dummy-security-camera-case.jpeg?strip=all&quality=90&resize=1024,1024)](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-camera-in-dummy-security-camera-case.jpeg)Raspberry Pi 3 with a camera module inside a “dummy” security camera case.[![](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-solar-panel-12v-camera.jpeg?strip=all&quality=90&resize=1024,1024)](https://kaspars.net/wp-content/uploads/2019/08/raspberry-pi-solar-panel-12v-camera.jpeg)Raspberry Pi with a camera module attached to a 12V battery charged by a 100Wp flexible solar panel.