Due to the fact that my home is complete heated by electricity (water- and domestic heating), I decided to monitor the energy consumption to get a feel for where to safe some money (here in Germany ~ 0.28 €/kWh !)
In the past I worked for a company which sold energy monitoring systems and my task was to connect existing metering devices to the software part. Luckily, almost every metering device you can find has an s0-Interface — so as mine electricity meter at home (which is owned by the grid operator).
Actaris ACE3000 Type 110 (s0-Connectorsbehind the marked cover)
Design
A reliable energy monitoring solution for private purpose should meet the following requirements:
- Logging of a s0-Signal
- 24/7-operation
- Energy-saving operation
- Visualization of consumption data
- Long-term recording of consumption data
- WLAN-capable
- (affordable)
I chose the Siemens SIMATIC IOT2020 as my hardware platform because it meets the requirements almost perfectly. Here are some facts:
- Industrial equipment (>> 24/7-operation)
- 400 MHz Intel Quark x86-CPU (>> energy saving operation)
- Freely configureable Linux-based OS (>> Visualization of consumption data)
- 512 MB Ram
- Harddrive: Micro SD-card (>> Long-term recording of consumption data)
- USB-Connectors (>> for Wifi-Dongle)
- Extensible by an I/O-shield (>> s0-Logging)
- (Some) Inputs are ISR capable (>> s0-Logging)
- TTL UART for programming
- Robust housing (24/7-operation)
Siemens SIMATIC 2040 (2040 -> additional COM-ports) + I/O Shield
The Siemens SIMATIC IOT2020 comes without an SD card and therefore without an operating system. A current Yocto-based Linux OS-image and instructions how to flash the SD-card can be found in the related Siemens forum.
Beside the hardware platform, you ale need some accessory. The following material list shows the minimal configuration of necessary components. I also placed a link to a distributor where you could buy this stuff (I don’t get payed for this!) and get a feeling about the costs.
Material list
- Siemens SIMATIC IOT2020 unit
- Siemens I/O-Shield for SIMATIC IOT2000 series
- Micro SD-Card (min. 2 GB)
- CSL 300MBIT USB-WLAN adapter
- 24 V power supply (TDK-Lambda DRB50–24–1)(2A)*
- 5 terminal blocks (Weidmueller WDU 2.5)
- 2x terminal cross-connecting brideges (Weidmueller WQV)
- DIN rail (~ 300 mm)
- 220 Ω / 3 W resistor
- Some wiring
* The SIMATIC IOT 2020 has a maximum current of 1.4 A. For the s0-current we need additional 0.1 A (24 V / 220 Ω). I already owned this power supply: You could also use a cheaper one with less power.
First, lets take a look on the result:
Mounted & hooked up energy logger
Unfortunately, I didn’t had enough space at the rear wall of the cabinet, therefore the DIN rail with the mounted parts lies on the ground.
The s0-interfaces is wired as shown below: The s0-interface is a current interface: When the electricity meter triggers, a current of 0.1 A starts flowing between s0+ and s0-. On DI0, the voltage rises up to 24 V and triggers an interrupt. When the electricity meter disconnects s0+ and s0-, DI0 is grounded over the resistor.
Wiring diagram
The whole procedure happens 1000 times per kWh (depending on the electricity meter).
I made a C-program which registered an interrupt service routine on the DI0 input which counts upwards in the memory. Once a minute, the values from memory are written to a SQLite database.
Architecture
Node-RED based GUI (shown: daily overview)
For the daily overview, I calculate the hourly costs based on the consumption data (big bar chart). On the top left you can see the actual power, below is the daily consumption (energy and costs).
You can see two peaks here:
- 9.00–10.00 Daddy took a shower
- 19.00–20.00 Children took a bath
Conclusion
The whole system is now running for one year at my home — free of errors with 100% up time.
Beside of the use as energy logger, this hardware setup is also suitable for many other use cases. Especially the USB ports makes this piece of hardware universal applicable.
The free configurable Linux systems is nothing for beginners: You have to configure the whole system from the command line — there is no GUI. When this is no obstacle for you, you get a reliable and flexible system with the ability to link interrupt service routines to the I/O level.
Also important to note is that the I/O shield runs on standard control voltage (24 V) which grants you the ability to extend the functionality with the whole range of standardized components (relays, sensors, actors, …).
The CE conform housing (even with the applied I/O shield) clarifies that this is not a toy or development board — together with the right accessories it will run for decades.