rdmeter simple decoder hardware

The Elster A100C outputs what is claimed to be IrDA. Every second the current energy consumption in WattHours and a few other values are broadcast at 2400 baud to any nearby device. This is handy if you want to know your consumption on a regular basis, but has the problem that most peoples eletric meter is a long way away from a computer.

From this you have a few options, find an IrDA receiver that runs at 2400 (and most seem to only support 9600 baud and up), use a laptop or other lowpower device, build a full IrDA decoder or, as described here, build a circuit that can decode this specific IrDA using a handful of common components.

Which ever route, the resulting data stream can be decoded with this program, or if using the Gas Meter option at the same time, this modified program.

Circuit diagram

The circuit diagram is shown here. The only critical components are the 39K resistor and the 10nF capacitor. Together these produce a pulse width of 0.39mS, using the equation T=ln(3)*R*C. This must be less than (but near to) 1/2400 seconds. The 555 does not support being triggered while already active, so a second trigger would create no output. As the computer serial port is probably lax about pulse width (I know some implementations sample the voltage 3 times over a period and take the majority), it is better ensure T is always less than 1/2400 regardless of component tolerances. It might be a good idea to use, for instance, a 35K resistor and a 10K potentiometer.

The circuit can be connected remotely by only 3 wires, ground, power supply and signal. The dotted box area should be close to the electric meter, with no more than a few feet between the phototransistor and the 555. The diodes and resistor outside the dotted box can be inside the 9 pin D type connector, many meters away (in my case, 20 meters). An LED indicator is included to show a signal is being picked up and sent out by the 555, this might stop the circuit working if your serial port is weak, so I recommend testing. It is useful to confirm the circuit is working, which confirms the phototransistor has been taped to the right place on the meter.

Theory of operation

The IrDA signal as sent by the Elster A100C is essentially standard RS232 serial. The output is 2400 baud, with a start bit, 8 data bits, 1 stop bit and no parity. The data is just a stream of bytes containing the data bytes we are interested in. The principle difference is that RS232 bits maintain their state on the wire for the full duration, so a start bit is 1/2400 seconds long and the voltage on the wire is +12V for 1/2400 seconds. An IrDA start bit (and all the bits that follow) is much shorter, to use less energy powering the LED. Knowing this, the easiest solution to convert this IrDA into RS232 serial is to expand the pulses to be the correct width. In this circuit, I consider it acceptable to expand the pulses to be nearly the correct width.

For this, a 555 timer is configured as a monostable (one-shot) timer with an ON time of slightly less than 1/2400 seconds. The ON time is triggered by an IR sensitive phototransistor that is taped to the front of the electricity meter. As the 555 trigger is active low, a 47K resistor provides a normally high potential. This 47K resistor has not been optimised, it worked for me so I didn't change it.

The output of the 555 drives the RX line. As shown, the RX line will vary from -0.6V (negative potential provided by the TX line) to around 11V. In tests, none of the serial ports I had to hand (two different motherboards and one USB serial dongle) had any problems reading serial data in the voltage range 0V to 12V, or even 0V to 5V, suggesting no modern serial port implemenation takes any notice of the negative voltage portion and have a low threshold for what they consider to be high. It would be possible to recreate the full voltage swing with an opto-isolator or a two transistors+resistors, but as my computers didn't care, your computer probably won't either.

The circuit uses a classic NE555 and consumes (without the LED) around 2.25mA at 5V, 7mA at 12V. In practice this was low enough to be powered by the serial port itself using the RTS and DTR lines as sources of power and the 100uF capacitor to smooth it out. These lines supplied either 12V (measuring onboard serial ports) or 8.8V (USB serial dongle). I am told laptops use a lower voltage of 5V, which might be a problem once the voltage drops across the diodes are taken into account.

As stated earlier, it is very important to ensure the output pulse width is always less than 1/2400 seconds, or the timing capacitor will never have a chance to be discharged ready for the next output pulse. I measured my capacitor to be 8.9nF and calculated and rounded down to 39K. This worked for me, YMMV and so you might be better with a potentiometer that can supply +-10% variation. Even if you arranged to discharge the capacitor (maybe using the reset pin), this would only lead to a high chance of over running into the next bit.

Picture of the finished product

The circuit was converted from prototype to stripboard, and result looks like this, sitting on the dining room carpet. On the left are the two wires to the phototransistor (around 4 feet away), on the right are the 3 wires that then run 20 meters in CAT5 to my 24/7 computer. The LED was not included in the finished version, it was only tested to work during prototyping. There is no picture of the D-type with diodes and resistor jammed in, that is best left unseen.


Written by Greg on 21/09/09, would welcome any comments on r.gregory at liv.ac.uk