Monitoring The Depth Of Water In Our Well

Our household water supply comes from an old hand-dug well. The well is 6ft wide, about 20ft deep, and was presumably dug back when the house was built in the 1880s. There's a simple automatic pump system to lift the water into a large storage tank.

Many local wells have been running dry during the summer months recently. Ours hasn't yet, but it has been getting down to a precariously low level. A day-to-day consequence of the low level is that the refill-rate becomes very slow. The pump brings up 140 gallons (about 8 inches of water depth) at each pumping, and by the end of summer it will take a couple of days for the water level to rise enough to be able to pump again.

Last summer I decided to build a system to automatically measure and report the depth of water in the well. The simplest way I could think of to measure the depth was to place a pressure sensor right at the bottom of the well (water pressure being directly proportional to the height of water above it). A 25ft-long cable connects the sensor to a battery-powered microcontroller at the top of the well, which is within range of the house WiFi. The microcontroller wakes up once per hour, takes the pressure reading, connects to WiFi, and submits the data.

The end result is a chart with an hourly timeline of water depth readings. Here's what the chart looked like soon after I built it, in October 2022:


Larger-scale version of this image here.

You can see how it takes a couple of days for the water depth to rise back to the previous level.

Here's what it looks like now, at the end of January 2023, after the winter rains and storms:


Larger-scale version of this image here.

The water depth is now up to 10ft (from a low of less than 3ft in early December). You can see how the level recovers rapidly after pumping, refilling at a rate of over 1 ft/day initially. It's also interesting to see how the refill-rate slows down as the level reaches equilibrium with the surrounding water table. Compare that the the earlier chart, where the rate never really slows. The well was seemingly never reaching equilibrium with the surrounding water table at that lower level.

Here's a view of the water level over the last 3 months. You can see how the level rises very rapidly after Christmas.


Larger-scale version of this image here.

There's a whole dashboard too. I added a second sensor to track the level of water in the storage tank, and monitor the sensors' battery voltage so I can tell when they're due for replacement or recharge. I use 3 AA rechargable batteries for each sensor, which power the system for about 4-6 weeks between recharges. Here's a view of the full dashboard for the past 30 days:


Larger-scale version of this image here.

Now, this is definitely what you'd call a homemade system. The well monitor is built from a Raspberry Pi Pico W microcontroller, programmed using Micropython, connected to a cheap (non-submersible!) pressure sensor via a 25-ft cable, and housed within a water-proof box. Inside the house there's a Raspberry Pi 4B on our home network running just about the simplest HTTP API endpoint you can imagine. A bunch of scripts run on the Pi to read and transform the raw data and make it available to the dashboard, which is a free Grafana Cloud instance.

The code running on the microcontroller is on Github, along with details on how the whole device is assembled.

It took a few interations to make the pressure sensor watertight. The sensor I bought is designed to be screwed into a pipe system, not to be immersed. After some experimentation I ended up with two different watertight variants. The more robust version has the sensor housed inside a sealed length of PVC pipe, with only the pipe connection exposed to the water. For the other variant I just covered everything except the pipe connection in silicone sealant (up to and including the solder joint to the long cable), and then wrapped it all in rubber tape after it cured. Photos of each version below:


Pressure sensor and solder joint to the long cable are inside the PVC pipe. The sensor intake hole (on the right) is sealed with an O-ring, and cable exit (on top) sealed with silicone.

Simpler version, made watertight with silicone sealent protected by rubber tape. This is what it looked like after a few weeks in the mud at the bottom of the well. You can also glimse the project box which houses the Pico W and batteries on the right.

The cable runs up through the water, so it needs to be a rubber-insulated 3-conductor cable. My first iteration just used standard PVC-insulated cable, but after a few weeks it was clear that moisture intrusion into the cable was affecting the reading. When I pulled it out and stripped the wires to inspect them, they were visibly corroded.

There are immersible pressure sensors on the market, but they have a couple of downsides. Firstly, they're quite expensive, and secondly they use current rather than voltage to signal the pressure reading. Measuring current would make the electronics at the top of the well significantly more complicated. Perhaps one day I'll experiment with one anyway.

Future versions of this system could have some other improvements, too. One obvious change would be to enable longer battery life by using more powerful batteries and a lower-power microcontroller. It would also be interesting to build a version that submits the readings via LoRa or some other long-range radio protocol, to enable the system to work outside of the range of a home WiFi network.

Update: some charts overlaying winter rainfall and water level/refill-rate here: Well Water-Depth And Rainfall - Nov 2022 to Jan 2023.

Ben Lund
Published on Mon Jan 30th 2023 at 16:56 and last updated on Wed Feb 8th 2023 at 10:30