DIY: IoT energy logger

in #diy5 years ago (edited)

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

* 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.

Sort:  

Hold up!! I have got to clear my head and run through this post and get my electrons right. I am a Lineman by trade and this stuff really intrigues me. So 0.28 € is ??? WOW!! $0.31 usd!! Dang Where I live we have a lot of dams and we only pay around $0.08 usd per KWH. Now you have gotten way farther into the electronics part than I ever got taught. I just put the big wires together. Lol. Wow!! You really seem to know your stuff. This post is worthy of a couple shoutouts!! hey @dandays check this out!!
Plus...
Yoo-hoo
@splatz...

This high price is mainly caused by political decision ( subsidization of renewable energy sources).
Electrical heating is not really common in Germany: My grandfather build this house during the oil crisis in the 70's. Originally, an oil heating was planed but due to the uncertainty in the oil supply he switched to electrical heating (electricity was much cheaper at this time).

Ya, we have a lot of that going on in The US also. It’s all about renewable/green energy. Funny thing is the State of Washington doesn’t consider the Dams a renewable/green energy. As far as the prices go, all you have to do is head a couple states to the south in California and those prices you pay aren’t that bad at all.

My current house runs Natural has for heat and the water heater, then electricity for the rest. I did live in a 100% electric house that was older and outdated appliances. My Monthly electric bill was INSANE!!

I see @curie paid you a visit, Good For you!! A well deserved reward for your effort
Cheers and Steem On

Hey @avenwedde
Your post has been determined to be Splat-Worthy!! Therefore You’ve been Splatted by the Splatz Curation Trail
E4D5E914-6CE9-4EA4-950A-18B199BC20DE.gif
source
Rewarding Your Original Work
With an Upvote
And
Resteem
If you find posts worthy of a nasty Splatin’ feel free and mention @splatz in your reply to their post. Call me out!!
SPLATZ info

Wow! This post is not for a layman like me, but this is truly informative. Hopefully it can help those who are into electronics as well. 😊

That is a slick setup. Looks super simple to wire and probably the hardest is the config of the os. I wish our meters allowed us to pull data bit they are crappy dials with minimal digital. Supposedly we are to get "smart" meters but they are nothing like yours.

Posted using Partiko Android

Many (cheap) meters have dry contacts. Sometimes also mechanical. They work (almost) similar.

wow! im not into electronics that much but im sure there are people out there who are into this kind of stuff! great work on this educational post buddy! you should post here more often!

Wiring diagram updated -> now without transparency

Hi avenwedde, did you know you can also view this post on Steemie?

I'm a bot, if you do not want these messages under your posts - just reply STOP :)

Ads (powered by Steemie)

Wow this type of Diy is very interesting because it is necessary and very important for the houses, I have always said that there are born people to be productive haha