Water meter for water consumption monitoring

I have read that there are folks here that are monitoring their water consumption which I would like to do here at home. I want to set up two meters for monitoring, one for "whole house" and the second just for irrigation (as a subset of "whole house".

I am looking at various water meters and I see several reasonable priced meters such as this one that show they have pulse output (in this case 1 pulse = 10 gallons) and according to what I have read here, we can measure and then track those pulses to get the data that I am interested in seeing, namely how much water am I using?

So I was wondering if that is the type of meter that I need and secondly, what would I then use with openenergy to monitor it as I do not see any specific hardware offered for pulse counting.

Thanks

Robert Wall's picture

Re: Water meter for water consumption monitoring

You need to find out exactly what they mean by "Pulse Output". If it's a reed switch operated by a magnet ("volt-free contacts" as I would put it, and that's what I would expect) then you can connect that to your Pi or one of your emonTx's. There's a lot here about gas and water meters and pulse inputs (and the various difficulties that some users have experienced) so a little more reading around those topics could be useful.

Eric_AMANN's picture

Re: Water meter for water consumption monitoring

Hi,

"you can connect that to your Pi or one of your emonTx's"

An EmonTh powered by battery can do it also. See https://openenergymonitor.org/emon/node/12165 . You will find a sketch for EmonTH V1.4 and V1.5.

Eric

rjsears's picture

Re: Water meter for water consumption monitoring

Hi again Robert - 

As I said in my other post on the electrical you are helping me with, I am new to this stuff. I have read every post I could find on water consumption monitoring and did not find a solution that really spelled out how it was done.

I was using this post as a sort of blueprint to get me going and since my main water meter does not look ike it can be monitored, I will contact the manufacturer of the water meter and ask them about the pulse output!

Thanks!

rjsears's picture

Re: Water meter for water consumption monitoring

Hi Eric - 

Looking at the specs on the EmonTh, it looks like it only supports a single meter, is that correct?

Many Thanks

rjsears's picture

Re: Water meter for water consumption monitoring

OK, I contacted the manufacturer of the water meters I am looking at and they said that the units were 2-wire, no polarity, dry contact operated by a magnet.  The standard output is 1 pulse per 10 US gallons.

This is the meter: HERE

Does it look like this meter would work with the EmonTh?

Thanks

Robert Wall's picture

Re: Water meter for water consumption monitoring

The "dry reed" bit is what we needed to know. Yes, that will work with any emonPi, emonTx or emonTH. But you can have only one per sensor node.

There's no fundamental difference between that reed switch and the sort of switch that you'd attach to a gas meter, and I think you'll find quite a lot of information about that. This thread is likely to be the most comprehensive.

rjsears's picture

Re: Water meter for water consumption monitoring

Robert - Awesome! Thanks! I will give it a try and report back here!

Eric_AMANN's picture

Re: Water meter for water consumption monitoring

Hi,

Both sketches for emonTH1.4 and 1.5, given here, only support one reed switch.

I just realized that I forgot to mention that one resistor (>10K) is required between D3 (D2 for EmonTH1.4) and GND. Then you have to connect the reed switch between D3 (D2 for EmonTH1.4) and VCC.

Both sketches can be modified to support two meters at the same time

Eric

rjsears's picture

Re: Water meter for water consumption monitoring

Thanks Eric - 

As soon as I get all the hardware I wil start playing with this!

rjsears's picture

Re: Water meter for water consumption monitoring

Hi Eric - 

Just thought I would report back here. I received everything and it using the 1.5 sketch you point me to I have the emonTH reading pulse counts off one of my water meters.

You had mentioned that the sketches could be modified to support two meters at the same time. I would love to do this as I have two meter right next to each other that I need to monitor. 

Can you point me in the direction I need to go to figure out how to support two meters on a single emonTH? 

 

I am not a programmer, so looking over the code did not insight any grand ideas on my part to make a second one work!

 

Thanks

 

Eric_AMANN's picture

Re: Water meter for water consumption monitoring

Hi,

You said you're not a programmer but can you read and understand the piece of code bellow ?   This is an extract of the EmonTH1.5 sketch you are using.

 //delay loop, wait for time_between_reading minutes  
  for (int i=0; i<time_between_readings; i++)  
  {  
     for (int j=0; j<55000/polling_period; j++) {       //1 minute should be 60000 but is not because of variation of internal time source  
    //caution parameter cannot be more than 65000, maybe find better solution  
    //due to internal time source 60000 is longer than 1 minute. so 55s is used.  
       inputHistory = (inputHistory << 1) + ((digitalRead(PULSEPIN)==HIGH) ? 1 : 0);   // use as shift register - clock switch state through right-left  
       if (inputHistory == 0x0F) {                                       // look for pattern 0 0 0 0 1 1 1 1,  i.e. LOW for 2 s, then HIGH for 2 s if the polling_period is 500ms  
        emonth.pulse++;  
       }  
       dodelay(polling_period); // im ms  
     }  
  }

The arduino polls the value of D3 (PULSEPIN=3) and looks for pattern 00001111. This can de duplicated to make it poll the value of two pins at the same time.

What are you expecting exactly ? Do you want some help to modify the code yourself ?

Or are you asking me to modify it ? If yes, I can do it but I am not sure what other pins may be used on EmonTH1.5. And how to setup the pull-up or pull-down resistors. Can someone help us on that point ?

Eric

rjsears's picture

Re: Water meter for water consumption monitoring

Hi Eric - 

I'm not a programmer, but given some direction I can usually beat my head against a wall long enough to make something work, and I enjoy the challenge. 

The piece I was missing was that I could just use another pin at the same time and modify the code above to read them both. I assume I can use any other "D" pin as I assume that is a 'digital' pin instead of analog (thinking of using D6 as this EmonTh does not have the onboard temp/humidity sensor. 

 

Eric_AMANN's picture

Re: Water meter for water consumption monitoring

Hi

I'm not a programmer, but given some direction I can usually beat my head against a wall long enough to make something work, and I enjoy the challenge. 

OK, now I am sure to understand your need ;)

The piece I was missing was that I could just use another pin at the same time and modify the code above to read them both. I assume I can use any other "D" pin as I assume that is a 'digital' pin instead of analog (thinking of using D6 as this EmonTh does not have the onboard temp/humidity sensor. 

Some inputs :

0. You should clean the sketch and delete everything related to temperature or humidity. Those part of the code already use some pins like D6 or D5

1. Data sent by the EmonTH is organized in a 'struct' named payload :

    typedef struct {int temp; int temp_external; int humidity; int pulse; int battery; } Payload;

   You have to modify it to be able to have two counters, let say pulse and pulse2.

2. You have to declare and use two history

  static char inputHistory = 0; --> used to increment "pulse"  (emonth.pulse++;)

  static char inputHistory2 = 0; --> used to increment "pulse2" (emonth.pulse2++;)

3. You have to declare and use two PINS : PULSEPIN and PULSEPIN2

Regarding the choice of the second pin, I can't help you because I have difficulties in reading electrical schemes (see the wiki). You have  two find two free and accessible pins. And you have to take care of existing pull-up, pull-down resisors.

 

Eric

 

rjsears's picture

Re: Water meter for water consumption monitoring

Eric - 

Thanks. This is a great help and will get me started in the right direction! I'll let you know how I make out!

rjsears's picture

Re: Water meter for water consumption monitoring

Eric - 

 

Here it is....works great! Thanks for the pointers....

 

DIP Switch #1 Position: 1
DIP Switch #2 Position: 1
0 = UP(LOW), 1 = DOWN(HIGH)

emonTH_dual_REEDSWITCH V1.0
OpenEnergyMonitor.org
RFM69CW Init> 
Node: 23 Freq: 433Mhz Network: 210

You are currently configured to transmit data every 1 minute(s).

Here is the data that we are transmitting:
Total pulses pulse1: 0P, Total pulses pulse2: 0P, Battery voltage: 3.20V
Total pulses pulse1: 1P, Total pulses pulse2: 0P, Battery voltage: 3.20V
Total pulses pulse1: 1P, Total pulses pulse2: 0P, Battery voltage: 3.20V

Eric_AMANN's picture

Re: Water meter for water consumption monitoring

Congratulations !

Now, you 're a programmer ;)

Eric

rjsears's picture

Re: Water meter for water consumption monitoring

hahahah....well I wouldn't go that far...

rjsears's picture

Re: Water meter for water consumption monitoring

OK, so another quick question. One of the meters I am getting pulses 10 times for every gallon of water which will give me very good resolution on near instantaneous water usage, but only if I can get that data back to emon quick enough.

My max usage I have seen on my system is about 30GPM which would equate to 300 pulses per minute which is only 5 pulses per second or one pulse per 200 ms. I just could not find any information on how quickly the emonTH could read pulses. 

 

I was also wondering just how quickly (or how often) I can transmit back to the emonpi to get decent resolution. Once per minute seems a bit slow for any kind of leak detection, but maybe not. 

 

If I do transmit back once per minute, will all 300 pulses make it back?

 

Thanks 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.