Senior Seminar

From Copelco

Jump to: navigation, search

Contents

Economical Real-Time Monitoring of Power Consumption

Providing consumers with a permanent daily check can give greater insight into consumption for continuous services, like electricity, gas, water, etc. A cheap, cost-effective automated system to provide frequent feedback and convey consumption information may help with energy conservation. Make sure to check out the [Earlham Energy Awareness Project (EEAP)]. The Earlham Energy Awareness Project (EEAP) is an incentive program to increase energy awareness of students living in campus housing. By promoting conservation efforts on campus, EEAP hopes to create a student body conscious of their consumption in hope of decreasing the environmental footprint of the college.

  • Final Project Paper:
  • [Project CVS]
    • All of my code for the project (mostly C and Perl)
    • Feel free to use any of it --- use at your own risk!
    • Kernel module development requires: [Kernel headers for patched 2.4.23 kernel]
    • I'd love to know if you found any of this information useful, please contact me!
  • Miscellaneous:
  • Contact information
    • copelco _at_ earlham dot edu
My project and messy desk!
Enlarge
My project and messy desk!

Project Summary

Hardware

Single Board Computer

[Technologic Systems] (Embedded Arm) offer compact single board computers (SBC). I chose to use the [TS-5500], which is a standard x86-based PC compatible computer with an AMD Elan520 processor running at 133MHz. It boots a distribution of Linux off of a compact flash (CF) card for a simple development environment. The TS-5500 is equipped with TTL level digital input/output (DIO) lines and a 12-bit 8 channel Analog to Digital (A/D) converter.

TS-5500 Single Board Computer
Enlarge
TS-5500 Single Board Computer

WattNode

My initial system used a single board computer (SBC) connected to a power monitoring device called a WattNode. [Continental Control Systems] offers the [Pulse Output WattNode], which is a true RMS AC watt-hour meter with TTL level pulse output proportional to kilowatt-hour consumed. Installation of the WattNode requires a direct connection to the circuit to measure voltage and current transformers (CTs) to measure current. Continental Control Systems offers split core (opening) current transformers, which have a removable section, so that they can be installed without disconnecting the circuit being measured. I used the WNA-1P-240-P-TTL (0-5 volt TTL Square-Wave output).

Pulse Output WattNode
Enlarge
Pulse Output WattNode

Initial System

SBC and WattNode system with Current Transformer
Enlarge
SBC and WattNode system with Current Transformer

Connecting the WattNode TTL level output to the TS-5500, I've written C-code to monitor the DIO ports on the board. My program uses kernel timers to poll the DIO ports at discrete intervals, checking to see if it registers a pulse. After making sure not to count the same pulse twice, the pulse count in incremented.

Energy Monitoring in Software - EEAPnode!

The SBC and WattNode combination is expensive. Further, the SBC isn't being fully utilized. The WattNode uses hardware to monitor power consumption in real time and provides output in the form of pulses proportional the power consumed. The same functionality could be performed in software on the TS-5500. The TS-5500 has analog input ranges up to -10V to +10V, with each channel being over-voltage tolerant from -16V to +16V \cite{tsmanual}. In order to measure voltage and current safely, a circuit must be designed to condition signals enough to safely connect them to the board. I built a voltage divider to step the voltage down to the TS-5500 levels. The current measurement can be assisted by the current transformer. The solid core current transformers offered by Continental Control Systems, produce 0.333 VAC output at rated current, which means that a 30A rated current transformer will produce 0.3VAC when placed on a line with a load of 30 amps.

Picture of signal conditioning circuit on PC board
Enlarge
Picture of signal conditioning circuit on PC board
Schematic drawing of signal conditioning circuit --- use at your own risk!
Enlarge
Schematic drawing of signal conditioning circuit --- use at your own risk!

In software, the SBC polls the A/D at discrete intervals to take instantaneous readings of current and voltage. In order to record the maximum number of readings per cycle, the SBC must dedicate all of it's time and processing power to my program. To ensure this, I wrote a module that runs in kernel space, allowing my program to disable interrupts before running in a tight loop to take its readings. This guarantees my program will remain active and not be swapped off so the SBC can handle other tasks. My module can then relinquish it's priority and allow the SBC to perform other tasks. Average power can then be calculated by dividing over the period (the number of recorded readings, which was usually around 600 samples per cycle). This information is written into the proc filesystem, which is readable from user space.

In order to make the information presentable, it must be acquired from the SBC. Using kernel timers, a user program reads the proc file created by the power monitoring kernel module multiple times a second. It packages the information into a protocol data unit (PDU) and pushes the packet through a TCP socket. At the other end of the pipe, a server receives the packet and stores it in a postgres database.

SBC polls A/D at discrete intervals to measure instantaneous voltage and current
Enlarge
SBC polls A/D at discrete intervals to measure instantaneous voltage and current
The data is pushed out over the network multiple times a second to a server for data analyzation and presentation
Enlarge
The data is pushed out over the network multiple times a second to a server for data analyzation and presentation

I calibrated against the WattsUp? Pro, a true RMS watt meter and electricity monitor. It includes an option to display the cumulative watt hours used since it was plugged in. Using a space heater and light board consisting of 5 light sockets, each powering a 100W incandescent light bulb, I ran a series of 10 minute tests under various constant loads. I recorded the various watt-hours, plotted them against my values, and plotted linear regression line. I used the linear equation to calibrate my readings.

Entire setup: SBC, WattNode, Circuit, Current Transformers, etc
Enlarge
Entire setup: SBC, WattNode, Circuit, Current Transformers, etc
Light bulbs, space heater, microwave, etc, used for testing
Enlarge
Light bulbs, space heater, microwave, etc, used for testing

To test my results, I created a simple interface to display the total cumulative watt-hours recorded in the database. I ran an 80 minute test, recording both the EEAPnode and WattsUp? reported watt-hours. The graph shows both meters inline early on, but begin to digress after about an hour. This is probably due to my calibration time being limited to a short 10 minute interval. Ideally, running a series of tests spanning longer periods of time would produce more accurate readings. I believe doing this would train the EEAPnode to be more accurate.

10-minute calibration results
Enlarge
10-minute calibration results
Personal tools