Skip to content

Inverse Decomposition of Energy Consumption (NILM)

License

Notifications You must be signed in to change notification settings

mieskolainen/IDEC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IDEC

License: MIT

Inverse Decomposition of Energy Consumption

What is it?

The idea behind Non-Intrusive Load Monitoring (NILM) is to solve an inverse problem of decomposing a superposition of different household electrical energy loads, based on observing only the time-series of the total load. This goal was pioneered by G.W. Hart, MIT. Solving this theoretical problem has also far reaching practical motivations, spanning from understanding large industrial system loads to reducing the overall world energy consumption.


Figure 1: An embedded web interface with real-time data.

Algorithms

Embedded algorithms here include basic unsupervised and supervised machine learning techniques (K-means, Fuzzy K-means, EM-clustering, Bayes classifier), linear and non-linear signal processing (filtering, edge detection) and a genetic algorithm type combinatorial optimization for learning the finite state machine.

Figure 2: A diagram of unambiguous finite automaton (from Wikipedia).

Build it!

A working prototype was realized with an Artila iPAC5010 ARM-linux embedded development card together with a custom photodiode circuit triggering on the optical output of a standard household energy meter (1k pulses/kWh). In addition, a 1-wire network support with "hot-plugging" onewire temperature sensors is included. The user interface is provided by an embedded web-server (async Javascript front end, PHP & C++ back end). An SQL-database (SQLite3) is used for saving the measurement data. A modern ARM board with floating point support is recommended.


This prototype system was introduced and awarded in 2009 in a technical innovation competition IIDA09 at Tampere University of Technology (TUT), Finland.


Figure 3: An embedded web interface with time-series data.

(c) 2008-2009 Mikael Mieskolainen, TUT

To-Be-Done

  • Upload all data collected between 2009-2021
  • Change all code comments to English
  • Adapt the code for Rasperry Pi (only GPIO interfaces need modification)
  • Implement modern algorithms, e.g. deep learning with self-supervision / matrix factorizations

Full installation

  1. Copy everything under /mnt/ to the ARM board with SD card
  2. Use GPIO port 8 for the energy meter trigger circuit
  3. Connect ethernet
  4. Connect onewire adapter into the serial port (optional)

System startup steering

Scripts under the following paths control the startup

/mnt/disk/etc/
/mnt/disk/

Program sources

C++ real-time and web back-end programs

/source/{*.c, *.h, Makefile}

PHP web back-end + javascript front-end

/mnt/disk/home/

Databases

Database files (sqlite3) collected with the prototype. Extract .db files from .tar.xz files.

/mnt/mmc/{*.db}

Binaries

Compiled multithreaded real-time programs

/mnt/disk/powercalc
/mnt/disk/cluster

Compiled web back-end programs

/mnt/disk/home/httpd/apps/get_file_archive.cgi
/mnt/disk/home/httpd/apps/get_statistics.cgi
/mnt/disk/home/httpd/apps/socket_client.cgi

Additional standard programs utilized

/mnt/disk/php
/mnt/disk/openssl
/mnt/disk/cron
/mnt/disk/ntpclient
/mnt/disk/lighttpd/*
/mnt/disk/ntpd/*
/mnt/mmc/sqlite3 (for manually inspecting database files)

Energy meter optical output trigger circuit

The components of the read-out circuit are

  • Reverse biased photosensitive PN-diode
  • Bipolar transistor + bias resistors
  • Voltage source
  • Cabling

External libraries utilized

C-Libraries

Database: SQLite3 https://www.sqlite.org/ (Public domain)
1-Wire: Dallas/Maxim  driver C-libraries ((C) 2000 Dallas Semiconductor Corporation)

Javascript

JQuery https://jquery.com/ (MIT license)
prototype.js http://prototypejs.org/ (MIT license)
script.aculo.us https://script.aculo.us/ (MIT license)
ContentFlow http://contentflow.eu (MIT license)
DHTML calendar (LGPL license)