Remote water monitoring with a solar powered Raspberry Pi
Earlier this year I finished a prototype for a remote camera which had been sitting on my desk for a couple of months. After bundling it up in a weatherproof enclosure, it was ready to go. A family member’s property in South Australia was the perfect location to test such a device. After roughly 6 months without any maintenance, it’s still going strong, diligently reporting every day.
Farmers can spend many hours a week checking water supplies for their livestock, which is a costly, time-consuming exercise. Remote monitoring can reduce the frequency of physical visits while also providing a more up to date picture of what is happening. Animal welfare is improved by being able to detect water issues faster and not being caught out by a problem that occurs after a physical visit.
- Raspberry Pi Model A
- Raspberry Pi Camera Module
- Sleepy Pi
- SD Card with Raspian Installed.
- 3G Modem
- SIM card
- Power Supply
- Solar Panel
On power usage
The Model A RPi typically uses 200 mA at idle, and an additional 250 mA with the camera module (according to the specs). I used a 5200 mA battery, which could power the RPi + camera for around 9 hours without recharging. Given enough sunlight the solar panel should be able to keep the battery topped up indefinitely, but eventually it will probably get into a cycle where it runs out of power.
An obvious power saving solution is to turn off the RPi when it isn't in use. It should wake up in the morning, take a photo, send it, and power down until the next day. This sequence of powering on, doing stuff and shutting down takes less than 5 minutes. That’s 5 minutes of work per day and we have 9 hours - or 540 minutes - of run-time at our disposal, which amounts to 108 days of operation on a single charge! Add a solar panel to the mix and it’s fair to say that we have obtained phenomenal cosmic power. But there’s a catch. The RPi will never stop consuming your power — even when it’s off.
The RPi will draw power whether it’s turned on or not. It is essentially always on, even if you shut it down. Another problem is that once it shuts down it can’t power up without you. It needs you just as much as you need it. I know what you’re thinking, “James you’re so powerful, surely there’s another way.” You’re right and there is. The Sleepy Pi is an Arduino based add-on board for power management. It works by shutting down the RPi and waking it up when needed. Cutting the power to the RPi when switched off prevents it from draining the battery.
Power management with the Sleepy Pi
Once the Sleepy Pi has done its job it can enter a low-power state where it only consumes 500 uA (0.5 MA) — bugger all! This allows us to achieve the great power savings we need to make a project like this successful. A Real-Time clock allows you to set alarms for certain times of the day or take timed measurements. Jon from Spell Foundry is the creator and he was very helpful in responding to my email queries. There are other paths you can go down as the Sleepy Pi is 2x the price of a single RPi. However, it’s the fastest way to get up and running.
Setting up the Raspberry Pi
Once the power problem is solved, the rest is relatively straightforward and there’s a mountain of how-to guides in the community.
From a high level you need to:
- Obtain an SD card with Raspian installed.
- Install any drivers and set up your modem (the steps will differ depending on which model you choose).
- Setup the camera module.
- Connect the Sleepy Pi
- Write some startup scripts to connect to the internet, take a photo, upload, and shutdown.
Once you have everything set up, it’s time to go out and test.
It looks a bit post-apocalyptic, but it does the job.
A lot has changed since I first created this prototype. There’s new hardware available that requires less power and is more suitable for a project like this. A modified version with an infrared camera is being trialed to reveal the water level of closed tanks and interest is growing for remote water monitoring solutions.
I’ve taken the lessons learned and teamed up with a friend who is a Mechatronic engineer to create a new and improved version called Farwatch.
Remote monitoring doesn’t eliminate the need for physical visits. However, it can reduce the frequency of visits to achieve significant savings in time, money and fuel. Innovative farmers are embracing such technology and reaping the rewards.
If you’re interested in a remote water monitoring solution for your property, check out our website or send an email to email@example.com. We’re currently working with early adopters and the results are very promising.