First post and looking for some information. Received all the relevant bits from the shop. Built, tested and working apart from pulse counting. I have the emonTx shield with three CT sensors AC-AC and a pulse counter. In GitHub firmware the emonTx v2 shows a pulse sketch but the shield firmware doesn’t seem to have pulse listed. Can someone point me in the right direction in terms of firmware and wiring to an UNO.
Didn’t seem to get much of a response on this.
Would really appreciate some help or advice with the Pulse Counter.
For the connections, have you read about pulse counting in Learn? If you’re going to use interrupt-based software, then of course you’ll need to use the second (unused) interrupt input (the first is used for the RFM Radio).
For software, I’m afraid you’ll need to lift the example code from Learn, or the pulse counting parts of the emonTx V2 or V3.4 sketch, and transplant whichever into your emonTx Shield sketch.
Thanks for the reply.
Yes I’ve had a look at learn pulse counting and from the emontx V2 firmware I’ve made some assumptions about connections from the sketch comments (IRQ1 Pin3).Just looking for confirmation that I’m on the right track.
So as far as pulse counting and the shield is concerned, there is no standard firmware and we all have to hack the code together to get it working. Is that a fair assessment? Or is it the case that no one uses the shield for pulse counting. Sorry to be naive but I’m new to openenergymonitor.
I did attempt to take parts from the V2 code yesterday but it complained about ‘onPulse’ not being declared. I haven’t had a chance to look at it this morning but is there anything I’m missing that you can think of that would generate that error.
I don’t know why there’s not a ‘standard’ sketch. The Arduino code samples tend to be tutorial examples, i.e. they illustrate the principle, they work, but they’re not necessarily the optimal solution. I don’t know much about the Arduino per se, so I’m claiming not to be an expert on it.
Could it be that you hadn’t copied the onPulse( ) function across from the V2 sketch? That’s what handles the interrupt.
(Look at the jumper setting for the interrupt used for the radio, and pick the other one.)
We all were once. Don’t worry about it.
I’ll take a look at the sketch in more detail later this afternoon.
Thanks for your help.