|
Rising electricity costs in the UK are increasing the popularity of electricity monitors, which allow the power consumption of a whole house to be monitored. One product, the Current Cost, is notable because it incorporates a serial port through which data can be exported to a PC. This page describes one method of interfacing a Current Cost unit to a PC. Hardware detailsThe technical details of the Current Cost's serial port vary between revisions of the unit. The circuit described here may not work with other revisions. In any case, there's always a risk of causing damage when plugging a home-made circuit into the Current Cost. The Current Cost revision described here has an 8P8C (aka RJ45) socket in the base, but this is not an ethernet interface. Although the interface is a serial one, TTL voltages are used rather than RS-232 compliant voltages, so a convertor will be required before connecting it to a PC serial port. Ground is present on the 8P8C's pin 4 (blue), and the data from the Current Cost is on pin 8 (brown). There are many ICs available that can perform TTL-to-RS232 conversion, such as the Maxim MAX-232 chip, which is currently stocked by Maplin, Farnell and others. This is available in a number of variants. For this job, one of the cheaper low-slew-rate types was quite sufficient, because my Current Cost runs at 2400 baud. The exact details of the convertor circuit will depend on which convertor chip you use. Example circuits are given in MAXIM's data sheet. The circuit (see diagram on left) I used required only the MAX232CPE chip and 5 1μF capacitors. I added a bi-colour LED and a 4.7kΩ current-limiting resistor between the RS-232 output and ground to help with debugging the circuit. Some slightly different (and probably better) circuit designs can be found at the Currentcost Wiki, which also gives details on where to buy a ready-made convertor cable. Software detailsI chose to use Java to monitor the RS-232 port, with the RXTX serial port library. The software is easy to write, because it is not necessary to send anything to the Current Cost, all that is required is that the software listen to what is being sent. This is what my Current Cost sends out every 6 seconds:
<msg> The <watts> element contains the power data. The <tmpr> element contains the internal temperature of the monitor, it seems to be fairly accurate so far. I've heard that later Current Cost revisions store some historical power data in internal memory and send that out as well. This would remove the need to have a PC permanently turned on to capture the data, which is rather wasteful of energy. ResultsThe graph on the left shows the first day of data captured from the monitor. The square-wave component of the graph with a period of about 40 minutes seems to be due to a refrigerator motor switching on and off. The data output from the Current Cost is reassuringly plausible, with very few isolated outlier readings. After about a week of operation, I haven'y seen any suspiciously low values. There is the occasional suprisingly high reading, such as 1.9kW just before 6am on 2008-07-20 for example. These may be due to the large startup current drawn when a fridge or heating-pump motor switches on. Links
The Current Cost seems to be generating quite a lot of Internet interest at present, partly due to its serial port. Here are some links which helped me to get started: |