How does the Web Energy Logger (WEL) work?
We know that the Web Energy Logger is an Internet Appliance designed to monitor a 1-wire sensor network, and post temperature and power data to a web site, but "how does it really work?" That's the question I'll try to answer here.
The WEL 3.1 is a small electronics assembly that uses an Ethernet-ready computer core from ZWorld, a 1-wire interface module from iButtonLink, and some pretty cool software (by me) to pull together all the functions needed for a roll-your-own temperature/energy logging system. In a nutshell, the WEL periodically reads all of it's sensor inputs, scales and filters them, and then posts the values to a couple of different places.
The primary destination for data is an off-site HTTP Web Server. This server is responsible for cataloging the data as well as generating various graphical displays. OurCoolHouse.com supplies a "default" Web Server that will perform typical processing, but the WEL can be configured to post to ANY server. The WEL assumes that this Web Server is reachable using the onboard LAN Ethernet interface. This can be achieved by plugging the WEL into a home's LAN if it has an "always on" internet connection (DSL, cable, etc.)
A secondary destination for data is a standard RS-232 serial port. This can be used to send sensor data to a local processing computer.
The WEL also has a tiny on-board Web Server of it's own, and this is used to configure the various operating parameters. Any local computer with a web browser can be connected to the WEL's LAN and be used to change system parameters..
Here is a block diagram for the WEL. Each of the blocks is described below.
The WEL uses an advanced 1-Wire interface module to communicate with addressable sensors on a shared external bus. The WEL supports both the two conductor "Parasitic" bus mode, and the three conductor "Powered" bus mode. Screw terminals are provided for connection to the 1-Wire bus. In the simplest installation, a single twisted pair of wires is routed throughout the area to be monitored, and each sensor is "clipped" onto the pair using in-line T-splices. Currently only the DS18S20 and DS18B20 sensors are supported. More will be added in the future. The maximum number of sensors that can be installed depends on the final wiring configuration (bus vs star vs random) but with suitable wiring, up to 100 sensors should be quite possible.
At power-on or reset, the system "searches" for all available 1-wire devices.
These are marked as "Found" and are available for subsequent polling.
Part of any energy study includes measuring the electrical power consumed by an installation. The WEL can monitor two independent electrical loads. An external pulse output watt meter is required for each load. A typical system might measure the entire Facility load, plus the Utility Room load. The WEL was designed to work with Pulse output Wattmeters from Continental Control Systems. These meters are economical and quite accurate, and can be purchased for many types and ranges of electrical load. A pair of wires runs from each meter to the WEL, and connects via screw terminals. The WEL maintains three values for each meter: Current load (W), Energy Used today (KWH) Energy Used this month (KWH).
The number of Power Meters is configured by the user via the local web
Local Run Monitor
Eight contact-closure sense-inputs are available on the WEL. These are used to sense external switching of equipment. A common "return" is provided for the eight inputs. The WEL can sense when any of the inputs have been shorted to the "Return signal. Dry contact relays or optically isolated outputs can be used as inputs. No active voltage (AC or DC) may be connected to these inputs.
Polling is a pure software function. 1-Wire inputs and Run inputs are polled every six seconds (0.1 Minutes). Power meter inputs are accumulated every 60 seconds. Raw input values are stored for further processing. The current sensor values are available for instant viewing via the local web server. If a "found" sensor does not respond during polling, or fails to return a valid value, it's status is set to "invalid" which prevents it's data from being posted.
Scaling and Filtering
Raw sensor values are "converted" to real world values by the scaling function. Each sensor can have a different scale if need be. The initial scale and offset for temperature sensors defaults to the Fahrenheit scale, but this can be changed by the user. The initial power meter scale defaults to that required by 100A current transformers. After scaling, values are time-filtered to produce a more smoothed result.
User Name Assignment
Each sensor is assigned a unique address by the system (or the 1-wire protocol), but these can be long and cumbersome. So, to simplify logging, each sensor is also assigned a logical "Name" by the user. These are typically short text strings that indicate function and location... eg: Z1,Z2,Z3 for zone temperature sensors or S1,S2,S3,S4 for slab loops. Users are encouraged to make names as meaning full as possible, while still keeping them short. eg: Z1S, Z1R & Z1A for Zone 1: Supply, Return and Air temperature.
Names are assigned interactively using the local web server User Interface. Names should be assigned as sensors are physically added to the 1-Wire network, because once many sensors are added, it can be difficult to tell them apart. Once names are assigned to sensors, these names are used when data is posted to the External website or transmitted via the serial port. These names are also used when configuring Web based graphics and graphing.
Assigning names to sensors also permits sensors to be replaced (due to failure) without effecting existing logs and displays. The new sensor is identified and given the same "name" as the old sensor.
A bank of 6 Status LEDs are located at the top of the WEL. These are in addition to the power LED and the Network status LEDS on the ZWorld module. Five of the Status LEDs are green, and these are tied to specific board functions. The last LED is red, and this is the Error Indicator. If a hardware or software error is detected, the Error LED will flash an error code. The User Guide lists the meanings of all the error codes. The red LED will normally be OFF, indicating no errors. The green LED next to the error LED is the "pulse" of the WEL, flashing once every 6 seconds.
Real Time Clock
A battery backed up Real Time Clock (RTC) is used to time-stamp any data sent from the WEL. This time can be changed using the local Web Server. It is expected that in the future it will not be required for the user to set the RTC as the WEL is able to automatically update it's own time using the NIST time standard that is available online. The user will only need to tell the WEL what time zone to use.
User Config. Web Server
This is also referred to as the "Local Web Server". This is a tiny web server is located on the WEL and it provides a simple user interface to any Web Browser connected to the WEL's LAN. The Web Server starts with a basic "config. home page" and then the user can jump to other specialized pages for performing such actions as: Setting the RTC, viewing sensor values, naming sensors, assigning scale factors to sensors, configuring network parameters and configuring the serial log.
As more capabilities are added to the WEL, additional config. web pages will be added to the server.
HTTP Web Post
This function collects all the valid, filtered sensor data and posts it to an external web site using the a standard HTTP V1.0 CGI protocol.. Each WEL is assigned a different User ID and Password for posting data, and this is sent with the data to the appropriate web site. The WEL assumes that the website is capable of extracting the sensor data (as regular form arguments) and processing it is required. The OurCoolHouse.com website is the default post location, but this can be changed by the user. If OurCoolHouse is used, the server collects the data and adds it to a monthly log (formatted for easy importing), and generates various graphics and charts based on a different set of configuration files.
It's easy to confuse the the various web servers in this discussion, so here's the key!
One of the LED status indicator flashes during the HTTP Post.
RS-232 Serial Log
Some people may also have other equipment in their home that could use the sensor data, if it could get access to it. For this reason, the WEL is also able to send sensor data out a standard RS-232 serial link. The content, update rate and baud rate of this serial stream is configurable using .... you guessed it... the Local Web server. The data can be configured to be fully annotated with sensor names and date/time, or stripped down to bare numbers.
Additional serial interfaces will be added in the future as demand dictates.
One of the LED status indicator flashes during the Serial Log output.