GWE (Gas-Water-Energy) logger
1. Can we see how much electric power is used by compliancies without plug (for instance light bulbs)?
2. Is it possible to see remote if lights are turned off?
This is a rather old idea. The basic idea was from around 2000, when I gave the assignement to a group students to design this for me. They did not design a solution but stayed in reporting possible solutions, so the idea was put on the pile with ideas. Until the summer of 2016 when some friends seems to have the same idea.
Due to the fact that I still got a Arduino-Mega laying around after the 3D printer project I decided to use that as the controller. And after our main fuses were replaced and extended with more groups, beginning of 2016. I decided to measure the power per group.
There is no need to measure the voltage per group, but due to the time spend in measuring one group the voltage has a different phase during the measurement of the other groups. This could easily be solved by remeasuring the mains voltage at the same time as the current.
The design of the circuit to measure the voltage is similar as the current measurement circuit.
First impression was that the ADC of the arduino was very sensitive for the used power supply. A short investigation of the arduino datasheet showed that this is cause by the fact that default the ADC ref is the 5V power supply. For this reason an external reference is added.
I have chosen to use the AD584 also due to the fact that it has a Vref/2 (unbuffered) output available. Note that this reference requires a higher power supply than 5V. But in principle the Arduino board also requires a higher input voltage to create the 5V internal, so that voltage can be used.
At first high accurate ADCs were ordered, but for simplicity of the design I have chose to start with using the 10 bit ADCs available in the Arduino Mega. I needed 10 current measurement and 1 voltage measurement, so 11 ADC inputs, which are available on the Arduino Mega, so not a problem.
There were two reasons to add a buffer opamp between the current transformer and the ADC:
The buffer opamps for the current coil can be in principle any opamp that is available, but there are some things to consider:
The buffer opamps for the voltage measurement have similar considerations.
The buffer opamps for the reference have also similar considerations but in that case the voltage offset will result in a direct reference error and require some extra attention.
To calculate the power used you need the current, voltage and the phase difference between them.
Luckily more people are working on this, so in my case I just downloaded the arduino libraries:
https://github.com/openenergymonitor/EmonLib
First I started with logging on a local SD card. To be able to do so I needed to know the time. A standard example of getting real time in Arduino is available in the examples, so that could be easy added.
Secondly I would like to have a readout of the values remote (all over the world). For this I used:
because they had examples of Arduino available and was easy to implement.
Future idea is to use the Arduino also a web-host, but that has not been implemented.
Because the logger is always logging its power usage is also interesting.
The Arduino Mega board (assuming you use the local regulator) requires at least 6.6V. And the external reference also requires something like 7V. For this reason a 7.5V adapter is used.
Component | Current used (mA) |
Arduino Mega | 51 |
Ethernet shield + SD card | 157 |
Buffer opamps | 13 |
Reference | 1 |
Using an old stable regulator the total power used was around 4W. By using a newer switch-mode AC-DC converter the power usage dropped to around 2.5W, which was acceptable for this application.
The main consumer is the Ethernet shield.
Component | Price [Euro] | Type | Link |
Arduino Mega + Ethernet/SD shield | 11.11 | Mega2560 | AliExpress |
10 current transformers | 14.10 | CT08CL5 | Ebay |
SD card | 5.95 | Action | |
6 opamps | 2.83 |
For example: TLC2272 |
Many types available, for example: |
7.5 power supply | 9.99 | kijkshop | |
Connectors (div.) | 1.90 | <diverse> | |
Accurate reference | 2.69 | AD584 | AliExpress |
TOTAL | 48.57 | - |
AC-AC adapter, resistors and PCB were available from old electronics; and thus not mentioned in table above.
Installation of the current transformers
And the electronic (buffers + Arduino)
Due to the fact that the Arduino and the AC-DC power supply disturb the low analog signals they are replaced further away (see band cables in photo above).
Mapping of the circuit above on the photo of the interface board (for n = 10):
Extra in this figure are some small components (R, C, Diodes) that are used for filtering of the supply.
Also some LEDs were added to diagnose errors of the Arduino; also not in the circuit diagram.
The accuracy is determined by:
Lets look in more detail to the accuracy of 10 bits:
Now that the electricity logger is installed (see above) it is easy to add things. The first addition was the water logger. The water meter has a small "moon" at the lowest digit which can easily be monitored either visual or via an inductive proximity sensors. Each time the moon rotates a puls is generated. This puls is handled in the Arduino code via an interrupt, so that no pulses are missed.
The output voltage of the inductive prox sensor is just above 5V (equal to the supply of the sensor), so two resistors are added as a voltage divider.
Such a proximity switch can be bought for circa 2.50 euro.
Connection of the sensor is done via an easy wood piece connected with tie-raps around the meter (see photo above).
In the "6" of the last digits of the gas meter is a small mirror.
Via a cheap IR detector + LED (circa 0.30 euro incl. PCB and comperator) the passing of this "6" can be detected.
Only "problem" is the aligning of the sensor for exactly the mirror.
We designed a small black bracket (see photo) around the gas-meter so it is easy to remove sensor when needed.
End 2017 the gas-meter is replaced by a "smart-meter" gas meter. The previous gas-meter was no longer "allowed".
With this "smart"-gas meter an automatic readout can be done via the electricity meter. See section "smart-meter".
There is of-course nothing smart to this meter. But it has a so called P1 interface.