Hi folks. I just installed a cheap XTM18SA DIN rail single phase two wire energy meter in my workshop's circuit, with the intention of monitoring the power consumption.
It claims to output a digital signal of 2000 pulses per kWh, so about 0.5 Wh per pulse.
The instructions are a bit vague as to how to connect it up, with no sample diagrams or specifics, just the comment:
manual:
The XTM1D V1.1 DIN rail energy meter is equipped with a pulse output which is fully separated from the inside circuit. That generates pulses in proportion to the measured energy for remote reading purposes and accuracy testing. The pulse output is a polarity dependant, passive transistor output requiring an external voltage source for correct operation. For this external voltage source, the voltage (Ui) should is 5-27V DC, and the maximum input current (Iimax) is 27mA DC. To connect the impulse output, connect 5-27V DC to connector 20 (anode), and the signal wire (S) to connector 21 (cathode). The meter pulses 2000 per kWh (0.5Wh/imp).
So, what I did was this:
I am using pin 3 on an "Arduino Compatible" Pro Micro until I can find a chunky USB cable for my old official Uno to test.
When I try to digitalRead the pin, I'm getting very inconsistent results. Usually it just sits at 0. I tried it using Interrupts, and it didn't seem to register any actions at all.
If I try analogRead, I get a signal that seems to oscillate between about 200 and 250.
This was the result of performing the analogRead in the main loop and spitting out the value:
Has anyone else tried to interface with this sort of meter before? I'll try and use a more standard Arduino in a few days when I'm back at the workshop, but I thought I'd ask first to see if anyone has got it working already.