Water, yum…
Every home requires multiple inputs and outputs for it’s proper functioning. eg. Food in, food waste out, water in, waste water out, power in, power out (thanks Eskom). I wanted to monitor the “utility” inputs to our home. Today, it’s about water.
Pictured: Me when I can actually shower at home (Image Credit)
Since the floods and subsequent damage, there have been many areas (including ours) within eThekwini that are still experiencing an unreliable water supply. So, I wanted to build something that could tell me the water status instead of walking over to the nearest tap or messaging our community WhatsApp group.
Bucket baths are cool again (Image Credit)
Hardware Setup
Diving right in, the plumbing side:
- Blue – Y splitter from existing connection
- Green – Washing Machine water pipe
- Red – Custom Adapter
- Yellow – Pressure Sensor 1.2MPa G1/4” Fitting – Link
Then the microcontroller side (removed from it’s enclosure):
- Blue – Power input
- Green – Pressure sensor signal and power connection
- Red – Microcontroller – Raspberry Pi Pico W – Link
- Yellow – Resistor divider (5V -> 3.3V)
- The Pico can accept a maximum of 3.3V via it’s ADC. Since the sensor outputs 0.5V-4.5V, this is essential to scale the voltage appropriately.
Software Setup
Since HomeKit doesn’t have water pressure sensor integration, there wasn’t a way to make this play nicely with my existing Homebridge/HomeKit setup. So, the system runs completely independently. I’ll need code on the Pico to read the sensor and send the data, a way to store the pressure data in the cloud, a way to display it on my devices and a way to get push notifications.
Adafruit IO‘s free tier would solve the cloud storage, so I’m using Adafruit’s CircuitPython on the Pico. To display, a PWA hosted on GitHub Pages and for push notifications, ntfy.
Here’s a demo:
To replicate the software stack:
- Sign up for Adafruit IO and create a public feed for the pressure data (eg. my-water-pressure).
- Choose a unique Topic that’ll be used for push notifications from ntfy (eg. kavi_water_pressure).
- Set up him on the Pico W.
- Set up wpm_d.
- Install ntfy android/iOS app and subscribe to the topic you chose in (2)
Full Stack
Here’s it all on one diagram:
Conclusion
Does it work? Yes 😃. Is it helpful? Hell yes! Am I entirely happy with it? Not yet. The custom adapter for the sensor is inelegant, as is needing the resistor divider. Also, it doesn’t work during load shedding. I’ll accept these as the follies of v1 hardware. For my own piece of mind, I’d also like to verify the pressure readings against a calibrated sensor.
Regarding the software and cloud stack, design decisions were made for this to be entirely free and easy to set up. To go with a nice custom cloud setup would be ideal, but with only a few users, it doesn’t quite make sense.
This was a fun project because it had so many facets. Plumbing, custom adapters, CircuitPython on the Pico, JS for the dashboard, talking to a cloud service. Every project teaches me something new and further convinces me of the benefits of project-based learning.
The Future
The hardware definitely needs a v2 revision, addressing the concerns from the conclusion. Also, to have this integrated properly into my smart home, a platform switch to Home Assistant is needed. But, that’s a different project for another day.
To expand on this project, it would be incredibly cool if someone could install one of these at their place in uMhlanga and give me access to the feeds so I can see the water status at my office.
Or allow me to think even bigger: If a few of these were set up near every reservoir, sending data to a single cloud service, we could build WaterSePush…
If you have any questions/would like to share your experience with water pressure sensing, leave a reply below. To receive an email when I publish a post, subscribe here.
(Featured image remixed from this photo)
Leave a Reply