Energy alerter/meter con Arduino

(English version below)
A tutti o quasi sarà capitato di aver superato la potenza elettrica prevista dal nostro contratto con il fornitore di energia elettrica con conseguenti spiacevoli puntatine al contatore per "riattaccarlo". L'ultima volta che ho fatto su e giù per le scale (abito al secondo piano), ho pensato che sarebbe stato veramente utile un "aggeggio" che mi permettesse di visualizzare la potenza istantanea fornita all'impianto elettrico casalingo e che mi avvisasse quando il contatore stia per "staccarsi".

Da questa idea è nato l'Energy Alerter che presento in questo post. Il progetto si compone di due parti, un server ed un client, entrambi realizzati con un Arduino, ed alcuni componenti esterni. Si ispira all'Open Energy Monitor del quale peraltro utilizza una versione leggermente modificata dell'EmonTx V2.

Lo scopo è quello di misurare la potenza istantanea assorbita dall'impianto elettrico e di inviarla tramite un semplice server socket, tramite la rete LAN domestica, ad un client, che ha lo scopo di visualizzarla su un display. Il client inoltre ha un cicalino che avvisa se viene superata la potenza massima prevista dal fornitore di energia elettrica.

Questo è il client:
Energy Alerter, lato client

Questa versione del client è collegata tramite uno shield ethernet alla LAN di casa e deve essere posizionato vicino ad una presa ethernet disponibile (per esempio quelle dietro al router wifi).
Il client è costruito con:
  • un "sandwich" composto da un Arduino Uno ed un shield LCD con una pulsantiera 
  • una mini board Ethernet con ENC28J60
  • un cicalino piezo
La versione wireless del client è equipaggiata con un modulo ESP8266 invece della board ethernet e può essere piazzata veramente ovunque in casa.
Una versione più evoluta del client costruita con il case di un vecchio router ADSL

Il server, vicino al contatore, è messo in rete LAN e comunica con il client tramite una coppia di adattatori powerline, quindi usa la stessa linea elettrica per trasmettere i dati e non c'è bisogno di posare nuovi cavi o di ripetitori wifi.

Server dell'Energy Alerter
E' realizzato all'interno di una scatola stagna IP55 ed è composto da:
  • un modulo EmonTx V2, con montati i soli componenti necessari per il funzionamento (in alto)
  • uno shield ethernet di Seeedstudio 
  • un alimentatore 5V 1A (in basso a sx)
  • un adattatore powerline (in basso a dx, all'esterno della scatola)
  • un trasformatore di corrente (vedi qui sotto) collegato al cavo di rete elettrica che esce dal contatore.

Particolare del trasformatore di corrente

Come si vede dalla foto, lo shield ethernet è utilizzato in maniera "inusuale", in quanto l'EmonTx non è predisposto per ospitare gli shield classici dell'Arduino. Il bus SPI dell'Atmega, normalmente usato per il modulo RF sull'EmonTx, in questo caso è collegato con dei fili volanti allo shield ethernet, secondo lo schema classico. Niente sandwich, quindi, ma funziona.

Un particolare del server.
Gli sketch Arduino di Client e Server li trovate su Github.
Il progetto si presta a varie estensioni e miglioramenti, che saranno oggetto di un prossimo post.


English translation:

Energy Alerter: an Arduino home energy monitoring system

Some of us may have too many electric appliances operating at the same time so to pass the electrical power limit provided by our contract with the electric supplier. This leads to unpleasant "travels" to the energy meter to reattach the breaker. At least this is what happens in Italy. The last time I made up and down the stairs (I live at the second floor), I thought it would be really useful to have some device that would allow me to display the instantaneous power supplied to the household electric plant. So I would have been warned when the meter is going to "break away".

From this idea the Energy Alerter was born. The project consists of two parts, a server and a client, both made with an Arduino, and a couple of ethernet shields. It is inspired to Open Energy Monitor of which uses a slightly modified version of EmonTx V2.

The purpose is to measure the instantaneous power absorbed by the domestic electrical system and send it via a simple socket server, to a client, that has the purpose to display it. The client also has a buzzer that warns if the maximum power is exceeded.
This version of the client is connected via an ethernet shield to the home LAN and must be located close to an available Ethernet port (for example, those behind the wifi router).
The client is built with:

  • a "sandwich" consisting of an Arduino One and a shield with a LCD panel
  • a mini Ethernet board with ENC28J60
  • a piezo buzzer

A wireless version of the client could be equipped with a ESP8266 form instead of ethernet board that can be really placed anywhere in the house.

The server, near the meter, is put into the LAN and communicates with the client via a pair of powerline adapters, so it uses the same power line to transmit data and it doesn't have to lay any new cables or wireless repeaters.
The server is assembled inside a IP55 watertight box and is composed of:

  • a module EmonTx V2, assembled with the only components necessary for the operation (top)
  • one ethernet shield from Seeedstudio
  • a 5V 1A power supply (bottom left)
  • a powerline adapter (bottom right, outside of the box)
  • a current transformer connected to the electrical network cable that comes out from the power meter.

As seen from the photos, the ethernet shield is used in an unusual way because the EmonTx is not designed to accommodate the Arduino classic shields. The SPI bus of the microcontroller is connected using flying leads to the ethernet shield, according to the classical scheme. No sandwich here, but it works.
You can find the Arduino sketch of Client and Server on Github.
The project is suitable for various extensions and improvements, which may be the subject of a future post.

Commenti