Gas meter BK-G4, pulse reader IN-Z61; wiring help?

I would like to measure our gas usage/rate etc.

I am trying to follow/adapt a tutorial here: https://www.bc-robotics.com/tutorials/using-a-flow-sensor-with-arduino/

We have Elster BK-G4, so I bought the pulse adapter to match:

This adapter has 4 wires, and the diagram provided is:

yellow-----------\
green---\         \
        impulse   alarm
brown---/         /
white------------/

Could someone please help with:

  • is this a digital / analog signal (pulse)?
  • how do I wire this to the arduino

Thanks for any pointers

It appears to me that the magnet in the meter will cause a switch to close between green and brown. If so, connect one of them to a digital input on the arduino with pinmode input_pullup and the other to ground.

Poll the input and when it changes from high to low, count that as a pulse.

@wildbill, thanks for the confirmation - that's what I expected.

I read somewhere that current meters could give a nasty shock without using a resistor - something about infinite amps...

Do I have the same issue with this?
If I use input_pullup, do I need a resistor?

There is a tutorial here;

With the caveat that I know next to nothing about electronics;
You don't need a resistor.
It seems to me the the switch is volt free and you are just trying to read if it is opened or closed.

I am not sure where "current meters" come into this.
You will get an electric shock once the voltage is high enough to overcome the resistance of your body.
You can touch the terminals of a 12V car battery safely.
However, drop a metal spanner over the terminals and there are going to be some exciting flashes and sparks. The spanner has next to zero resistance and the car battery can dump a lot of current through it, probably melting it.
That seems to have nothing to do with counting your gas meter pulses though.

Did you read this on the tutorial?:

• These are not able to monitor a flow of less than 1 liter per minute or in excess of 30 liters per minute.

What flow rate are you expecting?

JohnLincoln:
Did you read this on the tutorial?:

What flow rate are you expecting?

I did read the tutorial, thanks.
At the moment I am simply trying to capture the pulse. I will follow @wildbill's advice and connect to a digital pin...

About the question of resistors:
I saw a video in another tutorial - can't find it unfortunately - that warned about touching wires of a wrap-around power clamp without any resistor, so I was curious of this sensor had the same issue. I believe it does not have the same issue.

DerekC:
....
I am trying to follow/adapt a tutorial here: Using A Flow Sensor With Arduino - BC Robotics
....

Just to be clear you are not thinking of passing the gas through a flow sensor are you?
That would be a seriously bad idea.

DerekC:
....We have Elster BK-G4, so I bought the pulse adapter to match:
Flow Meters, Ultrasonic & Electromagnetic Flow meters | PCT Flow

Using the pulse adapter would be the safe way to go. The magnet in the meter causes the external reed switch to operate so the gas flow is not interfered with.

DerekC:
About the question of resistors:
I saw a video in another tutorial - can't find it unfortunately - that warned about touching wires of a wrap-around power clamp without any resistor, so I was curious of this sensor had the same issue. I believe it does not have the same issue.

AC Clamp meters are used to measure AC currents. The AC current flowing in the conductor causes disturbances in the magnetic field surrounding the wire. The Clamp Meter is clamped around the conductor and it acts as a transformer, the changing magnetic field inducing a current in the meter. It may be possible to get a shock from that, but it is not a problem that applies to the pulse adapter.

Thank you all for helping!

I managed to get a pulse following the guidance above, so I am sharing this for anyone else who may be interested.

The LED comes on when the dial reaches approx 9, and turns off again at approx 1.
I.e. we have a pulse for each revolution of the right-most dial (wheel).

The code is a simple adaptation of the tutorial above:

const int led = LED_BUILTIN; //13;
const int pin = 2;

void setup() { 
  pinMode(led, OUTPUT);
  pinMode(pin,INPUT_PULLUP);
  digitalWrite(led, LOW);
} 
/******************************************/
void loop() {  
  int reading = digitalRead(pin);

  // remember, PULLUP reverses the HIGH/LOW...
  if(reading == HIGH) {
    digitalWrite(led,LOW);//turn the led off
  } else {
    digitalWrite(led,HIGH);//turn the led on 
  }

  delay(100); // debounce might be more elegant...
}

IMG_8208-sm.jpg

IMG_8207-sm2.jpg

Glad to see it's working. What next to capture the data?

And here is a little video...

wildbill:
Glad to see it's working. What next to capture the data?

On the hardware side, I ordered NodeMcu Lua Wireless WIFI V2. I think battery drain might be an issue, so I need to investigate low power modes and interrupts.

I am still looking for a 'big data' platform... but for the moment I'll just http post the data to a node.js server and save to MySQL. I already have Grafana running for another project - once you have the [timeseries] data it's trivial to create graphs and dashboards.

It is nice to see things coming together.

Is this a domestic or commercial application?
There will be times when the Arduino is powered down, and you should consider how you will handle that.
When the Arduino loses power or fails any existing pulse count will be lost. If the Arduino is down for a while, and gas consumption continues during that period, then your derived readings could differ significantly from the actual meter reading.

There are lots of ways that this could be handled. One way would a bit of handshaking so that your data storage system gives you alarms when coms to the Arduino are lost and restored. On restoration of coms you could take a manual meter reading to realign things - unless you have this problem with the meter :slight_smile:

The project is for personal use. I started out thinking I would need a camera to record the digits, and then feed them through ocr/ai to get a reading.

Of course, a pulse meter only gives a pulse, and could be down for some time, so the solution should cater for that - a manual reading would recalibrate the cumulative total at server.

Closing the loop... I posted my solution here on Hackster.io

Perhaps that's useful to someone.

DC