Following on from a recent teardown of a low cost appliance energy meter, I’ve done a bit more hacking of the device. As you may recall, I identified that one of the pins on the meter’s chip (EOUT) output a train of pulses proportional to the energy consumed. Some tests with a multimeter seemed to confirm this because the average voltage of EOUT changed with the appliance wattage.
I was hesitant to connect my logic analyser to the meter to measure the EOUT pin because of potential differences in voltage levels. To resolve, this I quickly whipped up a small board with a 4N25 opto-isolator to provide some voltage isolation between the internals of the energy meter and my logic analyser.
Again, I will repeat the obligatory warnings prevail. Do not:
- Attempt or copy any of this if you do not fully understand or appreciate the hazards of mains power
- Open the meter whilst connected to mains power
- Perform any measurements whilst the meter’s case is open
- Connect another mains powered device to measure the chip. The energy meter’s power supply is not isolated from active, neutral or earth.
The circuitry that allows for isolation of voltage levels is based around a 4N25 opto-isolator. An opto-isolator allows for a signal to be transferred using light, this provides an airgap which provides electrical isolation.
A quick explanation of the circuit, the signal from the energy meter is EOUT_B (note the small horizontal bar across the text ‘EOUT’, this signifies that the signal is active low) and this drives a PN2222A general purpose NPN transistor. The NPN transistor was used to drive the opto’s LED at approx 10mA instead of the CS5460A having to source this current. The output of the opto-isolator was configured to be active-high because active low signals can be confusing.
The hardware was quickly assembled on some protoboard. Note that the output resistor (R4) has not been installed on this board as it will be external to the meter.
Assembly was a pain, finding a suitable place for the opto board inside the meter took two attempts. Hot glue saved the day in the end.
Before closing up the meter, a thorough check of clearances was made to ensure that the output wires could not come in contact with the mains voltages.
Once I was satisfied that everything was safe I powered up the meter with nothing connected. None of the blue smoke escaped.
Then the energy meter’s output wires were connected to a small PCB with a pull-up resistor for the opto’s output transistor, a 5V bench supply and an IkaLogic logic analyser. (If you want a low cost but very capable logic analyser I highly recommend the Scanalogic-2 Logic Analyser.)
A 2400W clothes iron was connected to the energy meter and powered up – it began to draw 9.75A.
The logic analyser was configured to trigger off the EOUT pulses and set to record data. Sampling rate was 250kHz and each division is 537us.
Review of the logic analyser’s results show that the EOUT pin outputs its data as a burst of pulses. This concurs with the CS5460A, which says ‘the pulses may be sent out in “bursts”’. When an appliance is removed from the meter, the pulses stop.
Well, this proves that the energy meter’s EOUT pin is outputting a stream of pulses. Next up is to review the datasheet and perform some trials to determine the relationship between the rate of pulses and the power being measured by the meter.