Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you

Saturday, 10 March 2018

Home Automation System - Energy consumption monitor...the first test

After a little stop, I'm going to tell you about my Home Automation System.

In particular, I would like to speak about some test I made to build a power monitoring system.

I'm trying to build something easily integrable in OpenHAB. I need a system able to acquire data and send them to OpenHAB, to be remotely accessible and use them to trigger alarms and notifications.

I need a little device which can be plugged in some junction box...

Looking for it on internet I found the Eastron sdm120c Modbus...

A nice product which can be query through its RS485 serial interface to fetch data about energy consumption (voltage, current, power, etc etc). It can be easily connected to an Arduino or Raspberry.

I was buying it when I found this one: PZEM-004T Energy Module, a little device with a current clamp able to get power consumption. It has a serial interface and so its data can be read by Arduino / Raspberry. It has little dimensions and it's very cheap. I bought it for 8€, shipped at home

Currently I bought only one...if my tests will be ok, I'll buy others. Mi target is to monitor home power consumption for each floor.

Now I have to choose a MCU. I would like to use a Esp8266 NodeMCU; it's a little device, has built in wifi capabilities and is very cheap! If it will not work as expected, I will use an Arduino board.

Ok, let's begin with some experiment just to see if PZEM-004T Energy Module will work. I will use an Arduino board because it's easier to plug than the ESP8266 NodeMcu

If it will work good, I'll try the ESP8266 NodeMcu.

The device needs 5V for the low-voltage side and 220v for the power line

Let's begin to plug:
  • GND and 5V from Arduino to the device;
  • serial output from the device to 2 Arduino GPIO

To test a load, I will use a simple lamp.

I downloaded a simple software for Arduino, which writes the data acquired on the serial output. Here is the output when the lamp is switched off: no current, no power:

Switch on the lamp...

and we get the power...

Perfect. It works as expected. Next step will be to use an Esp8266 NodeMCU instead of Arduino and then use MQTT tu send data to OpenHAB.