Data Collection

From C-Aware Project Wiki
Jump to navigationJump to search

< Main Page < Joule


To capture electricity use within the Computer Laboratory, we have installed a range of hardware and software to monitor, capture and record the electricity consumption of various circuits within the building.


Electricity Monitoring Hardware

Main Meters

We have installed high accuracy electricty monitors on main circuits within the building. These meters are Autometers' IC995, and provide overall power usage data, as well as the ability to measure additional data such as powerfactor and harmonics. These provide power information for the main circuits of the lab, such as electricity use per corridor.

These meters are connected via MODBUS over RS485, to the storage hardware.


USB Current Clamps

We have created a USB Current Monitor that interfaces a Current Transformer to a machine through USB serial commands, and developed a Python interface to access data available as high-level python objects. We use this as a less accurate but much cheaper monitor for circuits such as those feeding racks within server rooms.


Additional Data

In addition to the data we collect from our own sensor deployments within the building, we have access to data from the utility company on overall total power use for the entire building as a whole. This is reported and stored, and made avalible at the top level of the meter tree.

We also use the outside temperature provided from the weather station at the building.

Data Processing and Storage

The main meters are connected over RS485 to a machine that collects and processes the raw data, and stores it in a CSV file, which also includes data from the utility company.

The USB current meters are connected to local machines to the sensor deployments which capture the raw data and process it.

Both these machines are accessed by another machine that reads in the data and generates the JSON files which are then served to the web application via a standard web server.


The web app itself accesses the temperature data needed for the current time period it is displaying.

Data Access

JSON Data

The raw data used by the web app is directly available for download as JSON files, one per day and one per month, at http://www.cl.cam.ac.uk/meters/elec/. For more information regarding the data format, please see the Raw Data Format page.

Data Generation

This data is generated as discussed above, via CSV storage files. An index of all the JSON files is also created by a python script that runs over all the JSON files and calculates simple stats, as well as checking them for obvious erroneous readings, and generates both an error report and the index file.

Internally to the lab, you can find the root to all the data and scripts in the /usr/groups/building/meter-readings/meters.cl.cam.ac.uk/ directory:

  • elec/ contains the main JSON data files for the main meters.
  • tools/wgb-vis/ contains the web application and a number of previous versions
  • tools/wgb-vis/scriptscontains the scripts used to build the indexes & error reports.

To run the scripts you can either run the newindexgenerator.py file directly (running with no arguments will display a help message showing how to use it) or use the generateindex.sh BASH script.