Quick Outline
- How to Monitor Power
- Power Monitoring options
- Xbee Radios for wireless serial data
- How to monitor with a Brultech ECM1240
- Ecmread.py and parseecmpower
- Cacti Basics
- Graphing power with cacti
- Questions
Measuring Power Use
- You pay for Watts
- Watts = Volts * Current * Power Factor
- This is why VA (given on UPSes) is different from Watts
- Power Factor is offset between Current and Voltage curves
- PF can be as low as 60% on motors or some PC power supplies.
- Any power solution that only measures current is worthless for giving you watts and real power use.
Power Factor
- Having a PF close to 1 lowers line transmission losses, not just for the power company, but you too.
- Device needs watts, if PF is low, VA is higher, so A is higher, therefore more voltage and power lost due to wiring losses.
- I have seen 120V lines with 110V or less due to wiring losses
Measuring devices
- Clamp
- Cheap In line adapter (Watt's up)
- UPS
- Circuit Breaker Panel probes
Clamp Meters
- Picks up magnetic field generated by AC current
- Current creates magnetic field
- Loop of copper in magnetic field picks up current (that's how a dynamo works)
Clamp Meters with PF
- Some clamps can give you real watts and PF
- Requires getting voltage sine wave for offset computation
Watts Up / Kill a Watt
- Kill a Watt meters are cheap ($40-ish).
- They're pretty accurate
- Only useful close to the end devices
- Mostly no logging or remote capability.
- Well... until...
Zigbee / Xbee
- Simple, small and cheap serial radios
- RS232 interface
- Analog and digital IO can be sampled and transmitted
- Can be run independently (without a computer or arduino).
- Series 1 modules are Point to Point or Broadcast
- Series 2 (aka 2.5) support Mesh Networking for greater range.
- Coordinator, Routers, and End device modules as determined by which firmware you flashed.
Zigbee / Xbee
- Module takes care of routing in mesh networks and retransmission of lost data (up to a buffer size).
- Analog and digital IO can be sampled and transmitted
- Low power use (10mA when not sleeping)
- Xbee Pro modules transmit at 60mW instead of 1mW
- Can run on 3.3V or somewhat less
- Perfect for embedded use
- Here comes tweet-a-watt
Xbee receiving on router/arduino
- If receiving from a PC is not desirable (remote locations, power usage or uptime of monitor), a 5W wireless router can be used, or a <100mW arduino.
Direct Panel Monitoring
- Several solutions use Cts (current transducers)
- Do not trust them unless they monitor voltage too.
- Relatively safe to install.
XPL
- XPL is a network protocol to broadcast sensor data
- Rfxcom receivers work with xpl-rfxcom or Iranger's rfx-xpl.
- http://misterhouse.wikispaces.com/X10RFX10SecRFXCOM
- Rfxcom can be used to receive power data from rfxmeters
- Sample (non power) data received via rfxcom/rfx-xpl:
Rfxmeter Monitoring
- 433.92Mhz rfxcom based
- Needs one monitor per leg
- Relatively expensive.
- Requires an rfxcom receiver ($150-ish)
Ted 1001/5000-G
- CTs in the breaker panel.
- MTU reads CTs and encodes values over power line.
- Receiver in the house reads encoded data and displays or sends over the internet.
- Easy install.
- Does not play well with X10 or Insteon.
- Powerline coms not super reliable in some houses.
- Only monitors house use, does not support power generation.
Brultech ECM1240
- Uses an AC to AC converter to pick up phase offset between current and voltage and compute PF.
- 120 and 240V compatible.
- Can sample 7 currents, 2 of which directional (allows for solar panels and other generation).
- Lots of CTs (current transducers) to chose from.
- Serial, ethernet, or Zigbee (wireless) interface.
- Cheap (starts around $200). Cheapest entire granular house monitoring option I found.
- Needs windows to configure, but platform independent python code to query the data (up to once a second).
Brultech ECM1240 options
- Choice of the most cost and space efficient CTs for each install. Multiple CTs can be bundled on one channel.
- Lots of monitoring for cheap. Options for $176 and $370.
ECM1240 Log Gathering
- ECM 1240 only has one device by your breaker panel
- Data is sent to a receiving PC or any device that can receive serial data and log it (wireless router with usb to serial port adapter, or even arduino with SD card if needed).
- Communication is over serial port (3 wires needed, more than one ECM can share the same cable), wireless serial via Zigbee, or ethernet to serial adapters.
- If at all possible, running a cat-5 cable and putting DB-9s on each side is the most reliable and cheapest.
ECM1240 Logs and ecmread.py
- Ecmread.py dumps data from serial port.
- Samples Voltage and 7 Watt.second counters
- The 2 main channels count amps in both directions (solar panels).
- Multiple CTs can be linked to one channel (house lights).
ecmread.py and parseecmpower
- ECM can send ASCII data, but only at 0.5Hz. 1Hz refresh rate is obtained by sending binary updates.
- Ecmread.py decodes the binary, computes the positive and negative counters.
- Ecmread.py can do basic data uploading to some cloud services, but not recommended due to possible data glitches. It does not track historical data at parsing time (stateless logging).
- Parseecmpower reads logged data, filters out bad data samples due to serial port glitches as well as counter jumps and resets.
- Raw data stored on disk can be used by parseecmpower to be (re-)parsed and uploaded to cacti, or any cloud service (current data and old data can be back-filled).
Phase volts mismatch
- It's good for a monitor to match the right phase voltage for each leg being monitored
- Phase mismatch is due to load imbalances between both phases.
Understanding the monitored loads
- You can see how much power each washing option in your dishwasher or washer uses, and decide.
- Use power at night if you can to balance the grid and if you have time of use pricing.
- Spin down unused hard drives in your disk arrays.
Composite cacti graphs
- It may be difficult to locate which circuit each one of your devices is on.
- In more tricky cases, a composite graph can should a fan turning on vs home automation logs and temperature changes
Cacti Primer
- Full doc: http://www.cacti.net/downloads/docs/html/
- http://sysadmin.miniconf.org/2006/andrew-mcmillan-using_cacti.html
- Cacti is based on rrdtool, which stores data in single database-like files, RRDs (round robin database).
- Cacti is a web frontend to make rrdtool create, rrdtool update, and rrdtool graph more user friendly
- On the fly graph creation and data zooming/panning
- Graphs can be created based on data from multiple data sources (DS), even stored across multiple RRD files.
- RRD files are based on DS definitions and RRA (round robin archives) data aggregation rules.
- Use DERIVE for DS (counter that can go down).
- Data stored in RRD files but config data stored in mysql.
Cacti RRAs
- RRA (round robin archive) is meant to keep recent data for high precision time and switch to bigger time aggregates for older data.
- Because disk is cheap, I don't use aggregation much, see “no data loss” config tips:http://docs.cacti.net/manual:087:8_rrdtool.03_big_rra
- Rrdtool graph will take the highest resolution data for any time period requested
- For graphing purposes to make cacti happy, good to define weekly and monthly ranges with AVG and MAX aggregation.
- Beware of the 2GB RRD file limit on 32bit systems.
Cacti Primer, RRA definitions
- RRAs are defined for step (minutes between samples), rows (how many minutes of data to store), and timespan (how wide the graph for that RRA should be).
- Cacti does not support updates of less than 1mn but rrdtool does => requires direct rrdtool update from cron instead of the cacti update job.
Cacti: Planning RRDs
- RRDs are hard to manipulate and usually need to be re-generated from scratch when data fields need to be added, or precision needs to be changed.
- You can plan ahead by looking at the RRD that cacti generated (use debug mode), and recreate the same RRD file, but with dummy fields that can be changed to data fields later.
- Other RRD changes typically require regenerating the RRD file and resending all historical data (which parseecmpower can do).
- Remember to use 'turn on debug mode' in cacti's upper right corner for “data sources” and “graph management”.
- When needed, you can run your own rrdtool commands.
Other Cacti Tips
- In RRA:AVERAGE:0.5:1:446400 '1' means that points are averaged from 1 samples, --step 10 given in rrdtool create actually sets the update interval (10 seconds)
- You can modify/recreate an RRD from the command line after cacti made one and remove/add AVG/MAX/MIN RRAs. They only help what rrdtool graph can display
- Cacti depends on mysql to work, backup your mysql data.
- Keep raw data outside of cacti in case you need to recreate your RRDs later.
- Look up rrdtool information when in doubt, cacti is just a frontend to rrdtool.
- You can create composite graphs from multiple data sources: http://forums.cacti.net/viewtopic.php?p=195379 (for instance, unmonitored power data is meter data minus all monitored items)
Power Monitoring Tips
- Consider logging your data in UTC more than local time. Daylight saving time switches will make your logging unhappy (parseecmpower will handle most artificial data jumps when time jumps back 1H and eventually data from 2:00 to 2:01 jumps by 1 hour's worth).
- When you wire multiple CTs to the same input (like multiple breakers for lights), make sure to orient each CT donut according to the phase so that you don't end up having lights on one phase canceling out induced current from lights on another phase.
- Setup monitoring to see when things go wrong. I had a mysql upgrade which contained a moronic change which moved logging to /var/run/mysql (thank you whoever did that) which will fill up /var/run tmpfs, cause mysql to crash, and cacti logging to stop.