Water Meter

Hi All

I just added a water meter to my flukso on port 3 as a pulse input. The meter gives a pulse from a reed relay at 1 pulse equals 10 litres, so I set the constant to 10.

The graph on the flukso dash looks ok but when the water stops flowing the graph line does not go to zero it just sits at its last pulse reading. I guess water works differently to other sampling as a valve can fully close very quickly taking you from max flow to no flow so there is no gradual change in pulses to get you down to zero as there is with power for example.

Do i need to look at a pull up/down resistor to zero the reading or do I need to drive a schmitt trigger with the reed relay pulse to produce something more akin to an S0 pulse output whcih the flukso seems to have no trouble with (like my pulse kwhr meters)?

Fluc's picture

I hade the same problem like you.
Then i used a chip in between, the CD4538, it act on rising and falling pulses and give every time a short pulse. In the configuration, i just have to divide the 1 litre to make it 0,5 litre.
Now the graph looks ok:
https://www.dropbox.com/s/y9j10umqaahufxw/water%20graph.png?dl=0

Give me a ring if you want to see the board and wiring.

venno's picture

Hi Fluc

Thanks for that, I would like to replicate what you have done, I am not sure how to contact you via the forum though. eg. PM, email

Wizzopa's picture

Hi Fluc
I would also like to use this piece of electronics for my water meter.

gebhardm's picture

Why do you react on rising and falling edge (on switch close and open) and then have to divide by 2 on getting two pulses for a single event? A one-shot on falling edge (reed switch of water meter closed makes input go to ground) would be enough?!
For all others: Fluc's trick is not leaving the reed switch in worst case closed, but get a well-defined single impulse to detect just when the switch is closing respectively opening again - for the circuit search for "monostable multivibrator on falling edge" - this can be achieved also with a good old 555.
You may output the trigger pulse to an LED and use this in series with an optocoupler. This way you isolate the FLM from any external power source that you will need to run the multivibrator.

gebhardm's picture

Yes, indeed. Very nice drawing. t should be in the range of 10 to 30 milliseconds; that is a „usual“ value of other pulse outputs. This is not critical. So are R and C then with what you easily get, e.g C with say 10 to 100 nF. Get the units right and you have your R-value ;-)

gebhardm's picture

R2 is a pull up, 1 to 10k, t = 1.1 R C, so 1 uF with 1k is 1.1 ms. Mind the units provided in the spec. They might not be full Farads...

venno's picture

Built the circuit and connected between flukso and reed switch. The data still comes in same as before and after switching off the water the flukso graph hangs at last reported non-zero value :(

venno's picture

Could the issue be that my flukso pulse inputs don't have the internal pullup resistors functioning properly?

gebhardm's picture

Hm. The pull-ups are microcontroller internal; I doubt that they don't work. You may test with a volt meter, if you "see" 3.3V at the pulse port.
I have neither a water nor a gas meter, so I can just speculate. You may check the code what the expected behavior should be - but this would be a longer debugging session.
Do you have a "mqtt log"? See what is transferred as sensor message on the water meter.
What is your FLM's software version? In any case update to the latest.

venno's picture

Ok, I think I have it sorted and its not what I would have thought.

I removed the opto circuit so back to normal reed switch and let the unit run. Was at work and decided to check results and it all looks good. At home I use a modified high security Firefox browser at work its just normal google and this works fine, so looks like may be a browser issue with how things are displayed from the Flukso site.

There is one caveat though. the flukso graphing on the web page leaves the graph hanging at the last reported non-zero value but when the next run of the valve occurs the space inbetween is zeroed and the graph is corrected as the new flow data is submitted.

Fluc's picture

Saw the reactions a bit late ;-). I do not not received any warning emails from this forum anymore ...
@gebhardm, i do it on the rising and falling edge because it is was possible with the chip i used. So in can detect also a smaller quantity of water usage.
info: On my watermeter is a disk that rotates 360° per liter, half of is is shiny metal, the other half is red plastic. So it was easily to do both : a little higher resolution and eliminating the problem of a always high input.

ruben-s's picture

Hi Fluc,

I'm interested in your solution based on the CD4538.
It seems you have it triggering both on positive and negative edge, and looking at the datasheet of 4538 I don't immediately how to achieve this.

Any input is welcome!
Thanks.

br,
Ruben

Fluc's picture

Hi Ruben, i shall look for my schematic, i put it somewhere ... :-)

Fluc's picture

I found the shematic i based on.
Look in folowing pdf ( French) to schematic:
https://www.sonelec-musique.com/electronique_realisations_gene_imp_005.html
Schéma 005c = Combinaisons des deux sorties en une seule.

So combining both outputs to a single one.
I used as R1 and R2: 1Mohm and as C1 and C2: 220nf, on the output i used a small n-channel mosfet with a led (+resistor) between +5v and drain. Source = gnd and drain + goes to the Flukso.

I used the ic CD14538, same as CD4538.
If i can help, give me a shout.

ruben-s's picture

Hi Fluc,

Thanks for the link.
I've built a version and I'm currently testing to see if I can now indeed correctly measure the waterconsumption.

One question: do you get the best results with "edge" or "level" trigger?

Best regards,
Ruben

OnIrIa's picture

Just noticed the same behavior over here. The graph doesn't drop anymore to zero. And values just stop sending? I'm reading the data through mqtt from another server, and it suddenly 'dies'. When water is flowing, the readings start again?

In my statistics, I've got thousand liters of water used this night. When nothing is done. Not really the idea.

Is there something changed in the software?
Can't flukso send out some extra 5 pulses after a change or so? This way, i drops to the 0?

ps I had a huge water leak since more then a year (solved yesterday), so I had the whole time water running. that's why I never picked this up and had nice graphs. Cause the small leak, values dropped low, and I assumed this was the 0,5l pulse. But turns out, I had a leak. :$

Fluc's picture

Quote RUBEN-S [...
Thanks for the link.
I've built a version and I'm currently testing to see if I can now indeed correctly measure the waterconsumption.

One question: do you get the best results with "edge" or "level" trigger?
...]

Hi Ruben, the IC cd4538 is designed for edge detection (i use both, the rise AND falling edge) so every change in level, it sends a pulse and put for an short time the Flukso input "LOW" That's why i change the settings to 0,5 litre/pulse not 1 litre/pulse like original.
So with no water flow, input is always High.
If input stays Low, than we could get the problems that most users have here.

mr_thingy's picture

I've got the same problem as @OnIrIa, usage went from zero to 500,000L/day (!!) within a 30-minute period and then stopped. The meter is a Minol (now Zenner) aqua pulse, so one pulse per litre used.

Fluc's picture

Check your sensor. if it stays low or not.