I’ve been logging my water heater’s energy on my emonPi successfully for a few weeks. When the heating element is off, the CTs read a very low ~15 watts.
Today I wired in a pulse input from a water meter. The two meter wires connect to D3 and 3.3v, and I’ve put a 10K pull-down resistor between D3 and GND. The water meter seems to be reading accurately, but it is causing noise on my energy readings whenever I get a pulse.
I’ve not heard of this problem before. Have you checked that the water meter contacts are isolated from the pipework? My thinking is the closed contact is putting noise onto the 3.3 V rail, which is also the analogue reference.
Second, I suggest you wire the switch between GND and Int1 (DIO3) and, only if the internal pullup - which is fighting your 10 kΩ pull-down at the moment - isn’t adequate, then you can add your resistor as a pull-up.
If neither of these helps, we’ll have to think about filtering the wires going to the water meter.
Unfortunately, my emonPi’s are presently in use, so I can’t attempt to replicate your problem.
Thanks for the suggestions! I wasn’t aware of the internal pull-up resistor. I reconfigured it to simply wire the meter between GND and D3, but this ended up leading to lots of false pulses. The meter is about 80’ away from the emonPi, so I must be picking up some noise in the wire. Adding a 10K resistor between 3.3V and D3 seemed to fix the issue by giving it a stronger pull-up.
It appears this setup gives me clean pulses from the water meter and no longer interferes with the energy readings. I’ll keep an eye on it for a few days and give an update if I run into any more issues.