Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi All,

I'm new to the world of 'OpenEnergyMonitor' and am amazed on the knowledge and enthusiasm that can be found throughout this forum. A short introduction:  I myself am 46 years and live in the Netherlands.  I work with unix/linux systems in the role of sysadmin but am no programmer.  I'm also no electrical engineer and cannot read the schematics found around here.  So soldering together my own set would not be such a great idea ;).   As such the pre-assembled/build components found here in the shop would give me the perfect possibilities to put together a nice setup that should get me started.  Now for measuring our power usage the bundle with the EmonTx with CT clips & RaspPI set should do the trick.  I would however like to get the picture complete for our family including GAS (covering most of our utility bill) and water.  Now this is the part where i'm lost a bit on the possibilities.

 

My GAS & Water meter are both from the company Itron and are compatible with the Cyble sensor (v2). Now from all the reading i understand that with the EmonTx v3.x you must use the pulse count screw terminal to be able to do 'something'  with pulse counting.

 

So here are some questions i have;

Here ( https://www.itron.com/PublishedContent/Cyble%20Sensor%20EN%2003-14_Brochure.pdf ) are some more details on the Cyble sensor.  On the market i can find different types of this sensor (2 wire version / 5 wire version) and a factory set so called 'K'  factor (explained in the brochure). Now i know these are quite expensive but as mentioned i'm really not the guy to get my own soldering gun ;)

 

1st. Would this Cyble sensor be compatible to be used directly with the EmonTx v3.4 by connecting it to the ' pulse-counting screw terminal'.  And if so which one, the 2 or 5 wire version and what ' K'  factor and how to connect.

2nd. The EmonTx v3.4 (as i understand it) only has room to connect one pulse counter to the pulse-counting screw terminal.  So if i would want to collect data from two different (Gas & Water) Cyble sensors i would also need two EmonTx v3.4 sensor nodes?.  Or could the RaspberryPi be of some use here.

 

Any guidance is much appreciated.

 

Thanks & Kind regards

Patrick

Robert Wall's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

I do not know enough about the Raspberry Pi to say whether that would be better, so I will only talk about the emonTx.

Your Cyble sensor requires a meter with the correct "Cyble Target". Your meters have that.

The Cyble sensor has an internal battery with a life of 12 years. Is this a concern? After 12 years (or maybe more, possibly less), you will need to replace the entire sensor.

I think you do not need the extra information that the 5-wire sensor gives you (direction of flow, both HF & LF outputs and cable cut detection), therefore the 2-wire version with K=1 is equivalent to the HF output of the 5-wire version.

The value of K determines the smallest quantity that you know about. With K=1, you have one pulse per revolution of the target. The printing on the meter face should say what that is in m3 (I cannot read that in the photograph). If it does not, you will need to count the number revolutions for one digit on the register.

I cannot think of an easy way for you to use two of these with one emonTx V3.4, so I think you will need two emonTx's. You connect the brown & white wires (either way round) to "IRQ1/Dig3" and "GND".
You will need to use a sketch that uses interrupts, and I think there is not yet one for the emonTx V3.4, therefore it will be necessary to convert the V3.2 version. This is not a major problem.

pvg's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi Robert,

 

Thanks for your clear explanation,  exactly what i was hoping to hear.   I think i have everything now clear for myself and am going to proceed with building my set.   

Thanks again.

Patrick

calypso_rae's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

If a utility meter provides an optical output, the activity can be captured using a simple LDR-based sensor.  This can be polled every mains cycle (or every few milliseconds) to find the LED's state.  This approach can use any of the IO pins. 

On the emonTx V3, IO ports 5 and 19 are available at the 6-way terminal block in addition to digital 2 or 3 which supports interrupts.

Robert Wall's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

The Cyble detector appears to use a 'metal detector' technique to determine the passing of the flag on the "fast" indicator, and the gas meter certainly does not have an optical pulse output—rather a reflective spot on the "first drum". To use that would require a LED illuminator, a detector and a means of mounting both that would also exclude ambient light, and as Patrick isn't a constructor, it's a non-starter. So he's better to stay with a proven device that doesn't require development beyond converting a sketch.

calypso_rae's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

OK, Robert, I'm not familiar with the Cyble detector.  I was simply picking up on the comment that:

... with the EmonTx v3.x you must use the pulse count screw terminal to be able to do 'something'  with pulse counting.

If the meter provides an optical output, it is possible to use any of the IO ports for this purpose.

pvg's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi,

Thanks for all the info provided.   I just placed my order and hope i will get things going.  Looking forward to playing around with it.   In the mean time i'm learning every day here.  This community is amazing.

Could well be i'll be posting some more questions in the near future when running into issues.  But that's part of the fun. ;)

 

Thanks again all.

Kind regards

Patrick

Robert Wall's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

"If the meter provides an optical output, it is possible to use any of the IO ports for this purpose."

It doesn't. They are gas and water meters and so do not have access to an electrical supply. The data sheet notes: "the fast duration of the pulse does not allow to connect electro-mechanical relays". From that I deduce that the pulse is less than a few hundred milliseconds wide, but they do not disclose anything else about it. It may well be wider than 20 ms and thus could be polled once per mains cycle by a standard input, but we cannot take that for granted and I think the only safe way is to use the interrupt input.

Larsjo's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Did you get this to work ?

Have a watermeter with Cyble Sensor, so if it works for you i will go the same way.

pvg's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi Larsjo,

That's a coincidence, just finished updating the emontx with latest FW (including pulse counting), going to try the cyble sensor this weekend, will for sure let you know the outcome.  Furthermore i thought i had the itron cyble sensor compatible gas meter but was mistaking in that, so ordered a reed switch from flukso for the gas meter.

 

Kind regards

Patrick

pvg's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi All,

A short update on the progress on my attempts to get water & gas pulse monitoring to work.

For each of the pulse generating sensors i use a eMonTX v3.4. So i have two eMonTX v3.4 units measuring a total of 7 CT sensors.

Started with connecting the Flukso sensor to the screw terminal pins 3 & 4. (on the TX using default v1.6 sketch).   This seemed a somewhat frustrating process as i could not get any stable reading.   Serial connected the emonTX to see what was detected.   When connected at power-on the serial console showed weird counters.

 

emonTx V3.4 Discrete Sampling V1.60 RFM12B
OpenEnergyMonitor.org
POST.....wait 10s
CT 1 Calibration: 90.90
CT 2 Calibration: 90.90
CT 3 Calibration: 90.90
CT 4 Calibration: 16.67
RMS Voltage on AC-AC Adapter input is: ~246V
AC-AC adapter detected - Real Power measurements enabled
assuming powering from AC-AC adapter (jumper closed)
Vcal: 268.97
Phase Shift: 1.70
CT 1 detected
CT 2 detected
CT 3 detected
Unable to detect DS18B20 temperature sensor
RFM12B Initiated: 
Node: 9 Freq: 433Mhz Network: 210
CT1 CT2 CT3 CT4 VRMS/BATT PULSE 
822 104 1460 0 24503 42  
822 103 1441 0 24524 84  
820 104 1441 0 24530 126  
823 104 1467 0 24538 168  
822 104 1389 0 24600 262  
827 104 1399 0 24582 304  
820 103 1395 0 24534 346  
821 105 1395 0 24499 388  
816 105 1391 0 24456 430  
816 104 1390 0 24472 472 

When putting a small magnet on the sensor the pulse count remained stable at the same value (so concluding the senor is working)

Connect the Cyble sensor to my other emonTX and this produced the exact same result (so large number of pulsecounts while nothing was happening). Test with a magnet failed because of the way the Cyble sensor works (hence, its generating a pulse on its own when a cycle of the meter is detected.)

So was wondering on how to proceed and started googling-around.  I finally landed on the arduino tutorial pages. (  http://www.arduino.cc/en/tutorial/button )  Modified it slightly with some info found elsewhere and resulted in the following sketch.

// constants won't change. They're used here to 
// set pin numbers:
const int buttonPin = 3;     // the number of the pushbutton pin
const int ledPin =  6;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  digitalWrite(buttonPin, HIGH); // turn on input pin's pull-up resistor 
  Serial.begin(115200);
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
  Serial.println(buttonState);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == LOW) {     
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
}


This is basically exactly what i was hoping for, just to see if the pulses were detected correctly from both the Cyble sensor and Flukso sensor.   It will light the emonTX LED whenever a pulse is detected.  This worked perfectly on both the sensors, for the GAS meter whenever the last digit showed the number '7' the LED would turn on.    For the cyble sensor on the water meter this also worked but could clearly distinguish it is working in another way ( hence the cyble sensor would produce a pulse for a shorter amount of time because of the way it works)

I'm thinking that if i can produce a '1' or a '0' on the console and make the LED go on and off upon detection of one cycle of the gas & water meter it can be used 'somehow'  in a sketch to produce some meaningful info to pus to emoncms.

So i'm basically at the point on discovering on how to incorporate this in the emonTX discrete sampling sketch (as the currently available pulse counting in that sketch isn't working for me)

One of the things that still a question mark for me would be the working of the Flukso reed switch. (hence, if gas was used but stopped exactly when the last digit shows 7 on my meter the LED would remain on)'.  As stated, i'm no programmer and having real difficulties in understanding the sketches, but taking small steps at the time.

Will update whenever something interesting evolves in my little home project. (and of course any help would be much appreciated)

Kind regards

Patrick

 

Robert Wall's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

What you're seeing there is no doubt contact bounce. The standard pulse input and routine in the default sketch is not suitable (as you've found out) for mechanical switches. I solved this problem a long time ago - see about half way down this thread. [Beware, that sketch was for the emonTx V3.2]

Larsjo's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Good to hear that the water reading is working. 

?? why the 7 digit, is that where the magnet is ?

Any photo of the setup.

Robert Wall's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

There's quite a lot of information here: http://openenergymonitor.org/emon/node/1732

pvg's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Hi Larsjo

Yes indeed the last digit is triggering my (Flukso) reed switch whenever the display show a '7'. So thats the position of the dial where the magnet is best positioned for the reedswitch.

Robert pointed me into the right direction in regards to the software debouncing.  Found out (after doing a lot searching on the web) there are different approaches to this.  I tested out some of them.   I modified my sketch accordingly and now am pretty happy with the result (although it needs some tweaking still as the Cyble sensor seems to generate a few false pulses)  During all the testing i also discovered the emonhub is not receiving all of the transmissions from both of my emonTx's. So some work needs to be done there. (perhaps both emonTx's being so close together interfere with each others radiosignal?) But overall readings (both water with the Cyble sensor and Gas with the Flukso probe) are satisfying for me.

Now with the pulses coming in i'm  able to do the math.  For me the most important one are the costs. I know from within Emoncms you can get some cost calculations but i personally like the ' My Electric'  way of showing usage. Unfortunately not possible to display costs by default. So as (not being a coder) hacked my way through the scripts and modified it to show the cost as well.

 

Kind regards

 

Patrick

 

 

 

Larsjo's picture

Re: Cyble sensor compatibility EmonTx v3.4 (pulse counting)

Nice work. Will give it a try.

Comment viewing options

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