Water Meter?

(dijit) #21

@bram_dirriwachter thank you so much for this suggestion! This is exactly the right type of valve for this application and it solves all of the above mentioned issues.

I have already located a valve and ordered for testing with this setup. It is also referred to as a “magnetically latching” solenoid valve, as a magnetic coil operates the valve. According to the manufacturer, a short pulse of voltage opens the valve, then it remains open until it receives another pulse.

My next question is about valve/pipe size. For those that have already commented: what size plumbing do you have for the main water line where you would place this valve? I have 3/4", but I wanted to poll others.

(Bruce Lichius) #22

dijit: I was thinking of the same type of valve as @bram_dirriwachter mentioned above. Electrical current only used to open or close the valve … which is the way I would want it. I’m not 100% sure but I think my supply is 3/4". I don’t mind checking for sure … but at the moment my water supplier’s website is down and I’m not at home and don’t have a bill with me.

(dijit) #23

I imagine there will be some variety in supply line sizes, especially with the wide range of locations for openHAB users (Europe, US, etc.).

(dijit) #24

Further research has revealed yet another valve type that may be the best solution yet: a motorized ball valve.

Similar to the bistable solendoid suggested, it only requires power to open or close, and then remains in that state until power is applied again. There are a few added benefits of a motorized ball valve over a solenoid valve, including: Full-port/Full-bore offers unrestricted flow when valve is open, and a ball valve is better suited for shut-off than the plunger style in solenoid valve.

I have ordered a brass,12Vdc, motorized ball valve for testing, and will report my results.

Today I played around with testing the flow meter and temp sensor (pictured above).The flow meter calculations required a bit of calibration and tweaking, as I found that many code examples out there use a different pulse frequency than this meter outputs (11Q instead of 7.5Q= L/min Flow rate). Once I got that sorted, the values were much more accurate.

As for the temperature sensor, I was hoping the 2 wires exiting the sensor were for a 1-wire sensor in parasitic mode. They were not. I discovered that this is actually a 10k thermistor. That is not necessarily a deal-breaker, as a separate script could poll this sensor, but we have recently setup a 1-wire temp sensor network and would like to keep a uniform platform for temperature sensors. So, now the search is on for a screw-in 1-wire temperature probe (with the right thread size) to replace the thermistor.

As for communications, we are leaning towards a wifi solution using an esp8266 (nodemcu) to keep things simple and keep costs low.

(Bruce Lichius) #25

Yep. I’ve always thought that was the way to go. Didn’t know if you had found a solenoid operated ball valve that you were looking at or what. Seems like there would be a lot of torque happening on the components were it a solenoid for that. Then again, the slug can be curved and that could rotate when energized instead of going straight - endless possibilities. Here is a ‘solution’ from smarthome … but it’s not nearly as nice, overall, as what you are working on. Does say it’s a motorized ball valve though. Please continue to keep us updated on your progress.

(Kjetil Asdal) #26

Really interesting project! I have been considering something similar on and off for a while without getting to the implementation phase. Your post inspired me to get back on track with this so I’ll be following your updates with a keen eye, :slight_smile:

Regarding the temperature sensor: Other than it being part of the flow sensor you found, and the fact that it is always cool to have some extra values to show on the sitemap, do you see any practical use for this type of information (in this context)?

I just ordered a couple of 3/4" versions of the flow sensor you have in your setup (the 3/4" version seems to be called YF-B5 and apparently this only comes without the temperature sensor).

(dijit) #27

One of the overall goals of our project is to use readily available components, and these cheap Chinese flow meters are everywhere on ebay. I will be installing a complete setup soon to get some real-world values and test reliability and durability of the “Made in Shenzen” hardware.

As for the temp sensor, I specifically ordered a flow meter with the temp sensor. I live in a cold climate and temperature is possibly even more important than leak detection for my application. This becomes even more important after stopping the flow.
For instance, if this shutoff is triggered from a leak detection, it will then stop the main supply to the house. Then, the water line between my well pump and the shutoff valve would be at risk of freezing (moving water doesn’t freeze…at least not at these temps). For this I plan to also implement a switched heat tape to keep the water trapped in the pipe from freezing and bursting my supply line. This will be a future addition, and is outside the scope of this current project.

(Bruce Lichius) #28


Have you had any additional movement on this project? I was just thinking about this the other day as I’m going to have to replace my water heater in the foreseeable future and might install additional items at that time.

Just wondering …

(Paul Muldoon) #29

This definitely has me interested as well, especially knowing and possibly being able to control flow rate (pressure) of the water. We live in an area with pretty high pressure and constant water “hammer” when our appliances run, even with some strategically place water hammer arrestors.

So any further progress with the project?

(dijit) #30

Yes. Sorry for being MIA. Lots of projects in the works, and I was held up by delays in order processing and shipping on parts, apparently due to “Spring Festival/Golden Week”. I guess the week turned into months! This is another reason I would like to secure an inventory of parts, namely the electronic valves, to be able to offer for sale to others.

If anyone knows of a US supplier (not reseller) of motorized ball valves, I would be very interested.

I will post a full writeup of the current status of this project as soon as I can, but in the mean time, here is my advice based on our testing:

Definitely use a motorized ball valve for this application. All other valve types are failure prone or otherwise have unreliable results.

If hard wiring is not an option (ie use gpio on raspberry pi), you need to find a very reliable communication method to the valve, such as arduino or other dev board with wifi, ethernet, etc. Our testing has shown that the valve itself operates like a champ, but the bugs are always in communication between valve and device running openhab.

So far our solution uses a NodeMCU, replacing firmware with Arduino IDE based code. The temp and flow sensors are polled with the existing arduino code, and the valve control is essentially an openhab switch through the NodeMCU.

The charging circuit is surprisingly good using the micro-hydro generator, and allows for everything to be self contained and “wireless”. (Ie, no wires outside of waterproof enclosure.

Again,I will post detailed writeup and photos ASAP.

Sorry for the hiatus, and thanks for being patient with me.

(Craig) #31

I use a SDR on a pi, and a program called rtlamr which wirelessly gets water readings directly from my utility meter.

I send the readings into openhab via mqtt because the pi is closer to the water meter to get maximum number of readings.

Works great because with grafana you can use annotations such as identifying showers, laundry, turning on irrigation shutoff right on your dashboard for usage.

If you find your water meter is compatible with rtlamr, let me know, I’d be happy to share my docker images or scripts which get the info into openhab.

(dijit) #32

To clarify, our current setup does not allow for pressure control or partial opening of the valve. We have a valve that has 2 settings: fully open or fully closed.

I suppose that this could be further expanded with a pressure sensor and valve that can be incrementally opened, but we have a lot of work to do on this version before we can tackle those options.

(dijit) #33

Excellent. This one one of my first thoughts on how to get the data for water usage, however I also wanted a control valve and the ability to use this for smaller applications such as closed loop water systems.

Just thinking out loud here, but if I could combine my Brewtroller with openhab, I would be one very happy guy!!

(Bruce Lichius) #34

This really is awesome … (and sorry for my hiatus as well). I look very forward to seeing what you have come up with. I’m really impressed that the “Micro-Hydro generator” is working as well as you say … but when you think about it, at least in an ‘active’ household … it would get a lot of opportunity to charge things. In a vacation home … there would probably have to be an external charging option.

Anyway … design on mate!

(John Schmitz) #35

http://www.valworx.com/ sells motorized ball values. These are industrial quality and very well made. You can get the ball valve and actuator separately if needed. The actuator mounts to an ISO ball valve.

Or get the Zwave valve that Homeseer is selling: http://www.homeseer.com/water-valves.html

If this is for potable water, make sure you get a lead free valve. There are cheaper valves on ebay and Amazon but I would be wary of the unspecified valve material.

(dijit) #36

Ok, here are the current issues/Updates:

  1. The output of the mico hydo generator is good, however the plastic housing, as feared, developed a leak in a matter of days. It is likely there was already a small crack which grew larger under pressure. The symptoms were lessened with the application of plumber’s putty (instead of pipe tape), however a small drip persists. I believe the only resolution to this would be a metal body, but that product does not yet exist, and we do not have the equipment to fabricate one. At this stage, the generator would be optional as @Ctrl-G suggested. Unfortunately this means we cannot have a fully enclosed and “wireless” unit. We are ordering from other vendors and different variations of this generator to continue testing.

  2. While changing the calibration factor increased accuracy, we are still having a calibration issue. The accuracy of the meter is off and we cannot narrow down the cause. @KjetilA, have you had any luck with your G3/4 valves? Manufacturer support is non-existent and most sample code currently online is designed for the G1/2 valves

  3. Again, the motorized ball valve is the most stable component of this project. It is reliable, and easy to setup in Openhab. I will post the simple code snippets to easily get one of these up an running.

(Kuba Wolanin) #37

Looking forward to see your results! :slight_smile:

(glufonec) #38

I started researching water metering a few years ago but I opened the question again as my water company will replace my meter…and should close this question soon:)

  1. They will eventually install attachment that transmit RF signal at 868Mhz with Prios protocol. Could not find much data how to read it. Anyone with a similar device? It does have hall element but I can not do my own reading with the TF device there too. Using dialEye there will be hard as it is in a dark hole outside my house.

  2. I bought this cheap meter for a test. It was easier to calibrate (have some Arduino sketch around) https://www.aliexpress.com/item/OKD-HZ43WA-Hall-flow-sensor-3-4/761954312.html

I am not sure if it will last long if I use it in a real-world scenario. The propellers inside are plastic. However, I plan to put whole house water filter before the meter so it will last longer.

  1. The third option is to use old but unused water meter with dials as a second meter. I can place it inside my house and control the environment (light) and use dialEye. It has a dial with one rotation per 10 L so most likely I will get 1L precision.

(dijit) #39

I have to apologize to all on this thread (at least since I hijacked it). In all honesty and full disclosure, part of the reason for the long delays between posts is that we ran into problems with this setup, and have not been able to resolve them. The biggest issue is the flow meter itself, which has had reliability issues. The motorized ball valve portion of this setup has been very reliable, but the flow rate is the more important function. I have ordered a new flow meter from another supplier and we are completely re-vamping this project. The other thing that took away from this project is a completely different project: a solar charge controller project, which I will be posting about separately. I have been working to build a charge controller that is easily integrated with openhab. I’m also working on a binding for that one. I hope to complete that and get back to the water flow meter and shutoff device.

(glufonec) #40

I have a similar flow meter. There is a nonproportional relation between water flow and the number of pulses. Seems like, when the flow is low there is an amount of “uncounted” water.

My test: There is a valve on the pipe that fills the water tank for flushing the toilet. Each press gives almost the same amount of pulses (valve opened to maximum, pulse count across multiple time slots till comes back to 0). When I close the valve (like 40%) I get fewer pulses per flush. On very low flow there are even fewer pulses. It is hard to fix this.

I did 15L bucket test with similar findings. 380 pulses are around 1L. It does provide nice graphs anyway :slight_smile: