Can the emonTx read 2 pulses?


My gas meter is being changed to a meter with a pulse output. I already read a pulse from an electric meter. This is in an adjacent meter box with an emonTx. Can the emonTX read a second pulse so I can monitor gas consumption with the same emonTx?


No - at least, not easily. I’m afraid there are only two interrupt inputs available, and one is used for the RFM69CW radio, leaving the second, which you are already using for the electricity meter.

If you are not using the temperature input, and your emonTx is mains powered, it might be possible to use that as a pulse input, but the sketch would need to be heavily modified to ‘poll’ the second pulse input. This would only work if the gas meter has a long pulse duration and a slow pulse rate - which is likely.

@Robert.Wall, I vaguely remember some discussion about the EmonTH reading pulses. Do you know if it can? This is then a relatively cheap way to capture the data.

If you go that route, have a look at the PinChange interrupts. As well as the two IRQ lines, any pin can be configured to generate an interrupt on change of state. You’ll get an interrupt on both falling and rising edges, so will need to deal with that, but that can actually turn out to be useful if you need to do any de-glitching / de-bouncing.

Yes it can - it is already part of the standard firmware.

Another option could be to add an emonESP and drop using the RFM to free up the IRQ.

Still another option is to set up a separate pro mini with a radio, and send the pulse counts to the emonTx over the air.

I have the sketch for reading up to 6 pulse outputs on a pro mini 8MHz.

That would be useful to post a link to.

Tasmota may have a pulse counter that could be employed as well (there was no really good part of that message to quote :frowning:).

Tasmota does have pulse counters. Up to 4, depending on what else you have attached. Tasmota speaks MQTT so reasonably easy to get it to talk to emoncms. It might be possible to do it directly, but I use NodeRED to listen to MQTT and massage the data and then send to emoncms.

1 Like

Many thanks for all the replies. My emonTx is using emonESP but rather than recoding the emonTx I shall just use an ESP direct with Tasmota. I already have a number of these reporting temperature and now I have learnt Tasmota has counters that is by far the quickest and most economic solution. Does anyone know if the shop pulse counter will interface directly with an ESP? I recall there has been a lot of discussion about how the shop pulse counter works.


I have posted the “emonMeter” sketch and instruction on GitHub:

Any questions let me know!

1 Like