Using binary inputs for water or electricity metering

Hello,

I would like to use binary inputs at the Sensor module (Sensor Module - HARDWARIO Shop) for monitoring devices such as water meters, electricity meters, or :cloud_with_rain: rain gauge at a weather station.

Could you please give a hint or publish any successful project using a sensor module for water or electricity metering (analog binary input)?

Thanks!

Hi,
you can use pulse counter firmware. On channel A it is counting pulses and sending value every few minutes. Channel B acts differently - as a normal button AFAIK.

This firmware is already in the Playground.

I used and tested this firmware few days ago to test my new utility meter and works fine. You can extend the code so all three channels A, B and C (check the solder jumper in dev docs) could count pulses from any contact/S0 utility meter.

Hello to Hostětín :slight_smile:
we have some tips in this Twitter thread so you can follow some ideas.

1 Like

Hi,
I followed instructions described at https://www.hackster.io/jakub-smejkal/hardwario-pulse-counter-15ce72
This step-by-step manual help me to set the kit, but I would appreciate more detailed information about:

  • how to connect cables from sensor (in my case from water meter) to Sensor module?
    It is written to connect in A and B channels of the module, but there is also a wire connected in the GND slot.
    Thus, can I ask you to draw a wiring diagram?
  • what are differences between pulse on channel A and channel B?
    What are the appropriate time periods of wire connection to register a pulse?
    How to publish a pulse imediatelly - same as push button behavior - and not to wait for REPORT_INTERVAL?
    see https://github.com/hardwario/twr-radio-pulse-counter/blob/master/src/application.c
  • is there any limit for maximum count of pulses registered within a one second?

Thanx for an advice!

Hi,

In this project and firmware, there are two things connected to the Sensor module. To the channel B there is a button connected, in this case a magnetic sensor, against the ground.
To channel A, there is a counter connected.
The firmware gets the values from the pulse counter(channel A) and sends them over the radio with a topic /pulse-counter/a/count.
The button on channel B is detected and send over in case of an event.

You can send pulse in the body of condition if(event == TWR_PULSE_COUNTER_EVENT_UPDATE) on line 94 in the firmware, just put twr_scheduler_plan_now(0) there. But we do not advise this because in the case of for example electricity meter with 1kwh you would get like 10000 messages(pulses), for these reasons we put the REPORT_INTERVAL there. You can probably find number of pulses, kwh, or cubic meters on the device.

There is a limit in sending over the radio. Pulses should be detected without a problem.

Hope this helps.