View on GitHub

Emond

Smart energy monitor device software for EmonCMS

Download this project as a .zip file Download this project as a tar.gz file

emond

Smart Energy Monitor

About

This software implements a Smart Energy Monitor to be run on the RaspberryPi. In short, it is a simplified version of a combination of the emonTX, emonGLCD and emonBase modules, developed by the OpenEnergyMonitor project (http://openenergymonitor.org). It is a pure software solution and doesn't require any additional hardware modules to be added.
It connects to an energy meter via the SO (pulse) interface and measures/calculates the instant power consumption as well as the electrical energy on daily and monthly basis. The data is sent to EmonCMS (http://emoncms.org) which is the Web server used by the OpenEnergyMonitor project. EmonCMS can then be deployed to further process your data (store, manipulate, chart, ...).
The easiest way to display the energy data is to use the "My Electrics" appliance in EmonCMS.
A local LCD display is supported to have instant access to the latest measurements.

Features

Nice to have (wishlist)

Hardware modules

Raspberry Pi

As base module a Raspberry Pi is used to run the software. This dependency is derived from the use of the wiringPi library which greatly simplifies the GPIO handling. However, if the GPIO programming is ported to a standard framework like Linux GPIO sysfs, then emond should be able to run also on other embedded Linux boards.

Energy meter

Since emond uses the pulse counting method to calculate the instant power and electrical energy, an energy meter with a pulse output has to be used. There are basically two methods:

For more info on pulse counting see http://openenergymonitor.org/emon/buildingblocks/introduction-to-pulse-counting.

emond is being developed and tested with this type of energy meter that was installed in addition to the one provided by the energy company:

Energy Meter

The cabling has to be done as follows:

LCD display

The LCD display is optional. It is controlled via the lcdproc software. emond implements an lcdproc client which sends its data to lcdproc which eventually displays the data on the LCD. Therefore any display supported by lcdproc can be used. However emond is optimised for a 20x4 character display such this one:

LCD display

On the RaspberryPi, lcdproc supports this kind of display connected via the GPIO lines.

Screenshot

This is a screenshot of the EmonCMS dashboard, showing a daily power consumption chart and the current power in a gauge.

Screenshot

And this is the EmonCMS MyElectric Web application (which looks really good on a Smartphone).

MyElectric


Installation

If you don't have a cross compile environment for the RaspberryPi installed on your PC, it is easiest to build the software directly on the RaspberryPi. Follow theses simple steps from the RPi console. Make sure you have the necessary packages installed (e.g. git).

Configuration

You can customize the application to your needs via the config file emon.conf which should be placed in the /etc/ system folder. An example file is provided together with the programs source code.

# Pulse counter specific parameters
################################################
[counter]
pulse_input_pin = 25    # BCM pin number used for pulse input from energy meter
wh_per_pulse    = 100   # Wh per pulse (Energy meter setting)
pulse_length    = 100   # pulse length (in ms), leave blank for auto detection
max_power       = 3300  # max possible power (in W) provided by energy company

# Storage parameters
################################################
[storage]
flash_dir = /media/data # Folder for permanent (writable) storage

# LCD display specific parameters
################################################
[lcd]
lcdproc_port =  # Specify this if not using default lcdproc port
 
# WebAPI specific parameters
################################################
[webapi]
api_base_uri = http://emoncms.org # Public EmonCMS server
api_key      = 1234567890  # Personal EmonCMS API key 
api_update_rate = 20       # min delay (in s) between 2 API requests
node_number  = 1           # Identifier of your node in EmonCMS


Run the program

During the installation process, an init script is automatically installed in /etc/init.d/ Therefore the emond program can be started via the following command:

    sudo service emon start

If you want to autostart the program at every system reboot (recommended), issue the following command:

    sudo update-rc.d emon defaults

Contributing

Any contribution like feedback, bug reports or code proposals are welcome and highly encouraged.
Get in touch by e-mail to ondrej.wisniewski (at) gmail.com