Power monitoring and logging

I'm in the process of building a home monitoring system which will have three separate sources of data; house energy, garage energy and gas consumption. I'll probably add external temperature at a later date.

I've started using an EnviR from Current Cost which can do all of that. Quickly discovered that the EnviR's own logging is very limited. It's an aggregate of two hours of readings. I need better granularity than that, maybe log every 10 seconds.

The EnviR outputs a stream of data from a serial port every 6 seconds in an xml format. Current Cost have a product called a NetSmart Bridge which can send this information to a "Dashboard" page hosted by themselves.

The NSB costs about £30. You can guess where I am going with this. It would seem a better solution to use an rPi to do the logging and possibly server up the information locally on my home network. It will, of course, have greater flexibility than the NSB.

Has anyone had any experience of doing this sort of thing?

Reply to
Rob
Loading thread data ...

In a crude way. I've written a python script which reads, timestamps and logs data from a cheap USB logging DMM. I've only used it for monitoring temperatures (and until finding that two apparently identical thermocouples gave very different results), but as a winter project I reverse-engineered almost all of the DMM's data protocol, so it could be used in theory for logging anything else the DMM can measure. IIRC the DMM's sampling interval was about 0.75s, which certainly won't be fast enough for some purposes.

Reply to
Hils

Does that mean that the rPi was able to log at 750ms intervals as well? For my requirements this is a lot quicker than I need.

Out of interest, how wildly different were the thermocouple readings? From my experience of temperature sensing it is useful to keep in mind that the temperature sensor reports the temperature of the sensor. As to how well it records the temperature of the environment it is in depends on how well it is "interfaced" (for want of a better word) to the environment.

The only way to truly compare the two thermocouples would be to physically tie them together (use a cable tie), maybe with a thin smear of heatsink compound between their bodies. It's about the only way of ensuring that the thermocouples are in the same temperature environment.

Reply to
Rob

From an early stage I designed in two modes, one decodes all data frames sent by the DMM, the other ignores unchanged frames (usually giving significantly smaller data files).

The difference was several degrees at room temperature. I considered doing some more tests: I have a pair of the DMMs, which could have made this more interesting. They appear to have (undocumented) internal temperature sensors which are more consistent at room temperature. But I had (and still have) more pressing things to do.

Reply to
Hils

Not on a Pi or using the EnviR but on a Linux box and CC128.

Uses a Perl script to monitor the serial data stream and log the min, max, and calculated average every minute.

A bit of PHP then reads the daily log file and plots a graph using GNUPlot and presents that with the min/max/avg, kWhr and cost as a web page via apache.

Donno what comes with a Pi out of the box but nothing I have used is out unusual for a linux based system.

--
Cheers 
Dave.
Reply to
Dave Liquorice

If you're interested in low-power remote logging, the chap over at JeeLabs has done a lot of work in that area. This year's blog is here:

formatting link

Search on the words "house" or "housemon". He uses micro-controllers rather than RPi, though.

--
Cheers, 
David 
Web: http://www.satsignal.eu
Reply to
David Taylor

yerrs. after actually looking at Arduino + ethernet I concluded it was a far simpler way to read process and present a series of (analogue) sensor values to a network client. If you want it done at precise intervals use timer interrupts to simply read and store the port values, and have a main loop doing any pre-processing and running the web or other IP based servers.

then use the Pi to assemble process and generate graphical displays.

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher

Thermocouples are a poor choice for measuring small temperature differences around room temp. You can get accurate results, but it needs careful control of all connections (generally, all intermediate connectors, switches, multiplexers, etc. must be made of the same material as the thermocouple leads), a precise and stable cold-junction reference and a good ADC. Not likely on a generic DMM.

I have a home monitoring system, and I used the Analog Devices AD590JH, for a compromise between factory calibration and cost. I had to calibrate each sensor and then enter span and zero values into a calibration table for each sensor. The sensors provide a current output, so I built a simple one op-amp circuit to convert current to voltage, for each channel. This has been working since 1988 or so.

Jon

Reply to
Jon Elson

,

These days one would use the Maxim DS18B20 One-Wire sensors. Plenty of stuff already cooked up for the Pi to manage the bus. Looks like they'll connect pretty much directly to GPIO... Bit pricy though at £2.69 from Homechip, other suppliers maybe cheaper.

--
Cheers 
Dave.
Reply to
Dave Liquorice

The advantage to current output is that you can run the signal down a long wire without changing its value. I'm playing with LM35D and MCP9700A, so I can either corrupt the voltage reading sending it to the Pi, or take the reading on the spot with an 8-bit microcontroller and send to the Pi with a binary protocol to be determined, or move the Pi to the sensor. Moving the Pi to the sensor makes the one-wire scheme look very good -- no additional parts required and all.

Mel.

Reply to
Mel Wilson

their website doesn't even use HTTPS so that NSB looks to be a real turd and a security risk too (it's probably just a network port with embedded 8-bit micro).

yeah, kinda.

Q1: what sort of "serial port"

--
?? 100% natural
Reply to
Jasen Betts

On the EnviR I'm not sure, the CC128(*) is just a TTL 57600 baud data stream. Current cost sell a TTL > USB convertor, they used to TTL > RS232 but not sure they do any more.

(*) I suspect that the EnviR is pretty much a CC128 in a different box.

--
Cheers 
Dave.
Reply to
Dave Liquorice

How long is "long". The 1-wire system will cope with a few hundred metres of cable, depending on how many devices (can be several tens of devices) and topology of the network (single long cable, trunk with (short) stubs, trunk with a star on the end).

--
Cheers 
Dave.
Reply to
Dave Liquorice

Yes, that's EXACTLY the advantage! I have sensors about 100 feet from the ADC, but it works quite well. I did find out the AD590JH in the metal can was susceptible to ESD. I had some of them glued to copper pipes in the heating system (we have hydronic heat here) and heavy thunderstorms blew out a few of the sensors. I glued new sensors on with Bergquist silicone transistor insulators and haven't had any more blown sensors. The sensors in open air have never had this damage, so I guessed it muct be potentials to the metal can.

Jon

Reply to
Jon Elson

Note of caution: I worked for a period in Johannesburg, S Africa: a place renowned for thunderstorms. After every single one a pile of equipment would land on mydesk for repair. the common factor was all being connected to long wires, outdoors.

And alarm installer - who had subtracted manufacture to us eventually requested we optocouple all the sensors "That way, i just go round, replace the blown opto cards, and the rest is sound. Simple: I make money, the job is done".

I would strongly advise, if you do not regard the pI itself as disposable, you consider some kind if fire break between it and external sensors. Nearby strikes can induce several thousand volts at surprisingly high currents into any wires with respect to earth, arriving from outside.

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher
[%X]

For some material on protecting I/O on a system you could try my article on Reading the World and Writing the World (a set of four). The first one starts at .

--
******************************************************************** 
Paul E. Bennett............... 
Forth based HIDECS Consultancy 
Mob: +44 (0)7811-639972 
Tel: +44 (0)1235-510979 
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. 
********************************************************************
Reply to
Paul E. Bennett

Actually, the environmental monitoring system, once I added the insulating pads to the sensors has been quite robust. My home-made burglar alarm system got blown to bits, smoked chips and all that, and I still have not got it running again. That was a CMOS Z80, however, and may get replaced with a Pi or a BeagleBone if I ever get serious about repairing it.

Jon

Reply to
Jon Elson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.