📜 ⬆️ ⬇️

We connect Arduino to the electric power meter

No, this article is not about another way to deceive this ill-fated device. Here we will talk about how to use your Arduino and LabView environment to turn your electricity meter into a power consumption monitoring tool or even an ammeter!



The very first electricity meter was induction. The principle of its operation is ridiculously simple - in fact, it is an electric motor, the rotor of which is an aluminum disk rotating the dial. The more current consumed, the faster the disk turns. The device is purely analog.


')
Today, however, induction meters are losing ground, giving way to their cheaper electronic counterparts. And just one such will become experimental:



The principle of operation has not changed much - in this case, the disk is replaced by electronics, which generates pulses in accordance with the amount of electricity consumed. As a rule, in most devices, these pulses are indicated by an LED indicator. Accordingly, the faster this light flashes - the more precious kW is burned.
In addition, on the front panel of any device there is a gear ratio of the counter A - the number of pulses per 1 kW * h. As can be seen from the photo, the experimental A = 12800. From this information we can draw the following conclusions:

- With each pulse, the meter records consumption equal to 1/12800 parts from 1 kW * h. If you turn on the load to the meter and just start counting the pulses, then it is easy to get the amount of electricity consumed by it (kWh), dividing the number of pulses by the gear ratio.

- Since the indicator changes the speed of its blinking, it is possible to derive the relationship between the power (kW) and the time of a single pulse of the counter, which will provide data on the power / current.
We will not load the article calculations, but if you need something
here they are
Truly, the gear ratio of the counter is a great thing, since knowing it can express both power and current:
Compose the proportion of our gear ratio (A = 12800 imp / kW * h) and the unknown gear ratio, which will be under load X and during one single impulse (blinking light bulb):



Here X is the unknown power, and t is the time of one pulse. We express the unknown power from here and here it is:



The current is calculated using the following proportion of ratios and currents of known and unknown under X load .:


Which in general leads to an identical formula, but for current (current is measured in amperes and indices mean the load at which the current will be):



Here you can see the underwater stone - you need to know the current at an ideal load of 1 kW. If good accuracy is necessary, it is better to measure it yourself, and if not, then approximately it can be calculated by the formula (voltage and power are known), but it will be more crude because the power factor is not taken into account.


Thus, everything rests on the measurement of the time of a single pulse (the indicator blinks). In my research, I relied on this great project . An Italian made an interface for monitoring power in the Labview environment and came up with a scheme for measuring pulses. But there was a huge flaw in his project - he was only suitable for meters with a gear ratio of 1000 imp / kWh.



The top chart is the average power in 5 minutes, the bottom one in real time. The interface is quite flexible and easily modified to fit your needs. If you have not dealt with the LabView environment yet, I recommend to get acquainted.

To make it work, it was enough to add a single block to the program's algorithm, in accordance with the formula above.
It looks like this

It would seem simple, but before that we still have to think!


So, if you decide to implement power monitoring, then there are two options:

1. Your meter is closed and sealed at the most do not play about. This means that pulses can only be read using a photoresistor that reacts to a blinking light bulb. It must be attached with blue electrical tape opposite the LED indicator on the front panel of the meter.
The scheme will look like this:
Scheme for contactless removal of pulses

The program simply compares the resistance value on the photoresistor and potentiometer. And the latter allows you to set the sensitivity of such a sensor in order to avoid false triggering and tune to the brightness of the indicator.

2. You have access to the pulse output of the counter. Many models have a pulse output that duplicates the flashes of the sweetheart. This was done in order to be able to connect the device to the automated accounting system. It is a transistor that opens when the indicator is on and closes when it goes out. Connecting directly to it is not difficult - for this you need only one pull-up resistor. However, before you do this, make sure that this is a pulse output, and not anything else! (there is always a scheme in the passport)
Diagram for connecting to the telemetry output

In my case, access is full, so I didn’t bother much. Install LabView and measure forward! All graphics represent power (W) in real time.
The first to distribute was a long-suffering kettle. The cap says that it has a power of 2.2 kW, but judging by the schedule, regularly consumes only 1700 watts. Note that consumption is more or less constant in time. This means that the heating element (most likely nichrome) very little changes its resistance during the whole boiling process.



The glue gun is quite another matter - the declared power is 20 W. It behaves in accordance with the laws of physics - when heated, the resistance of the heater increases, and the current decreases accordingly. Checked with a multimeter - everything is as it is.



Old radio "Spring". Here the graph went up at the beginning due to the fact that I started the measurement during the impulse, respectively, this affected the data. The slides on the chart show how I turned the volume knob. The louder - the more the radio eats.



Punch with a declared power of 700 watts. He pressed the button until it stops, waited a little bit and released, but not smoothly. The graph clearly shows the inrush current when the engine is started. That is why the light blinks when a good neighbor begins to peck his favorite wall.



And now the fun part. I conducted a small experiment with my old laptop, the result of which is shown in the picture:



The orange dot marks the time when I launched several “heavy” programs at once. As you can see, the graphics of the CPU and increased consumption have something in common with each other. Recently there was one interesting article that gives some thoughts. I'm not sure that using power monitoring, you can drain encryption keys, but the fact is obvious.
(Tremble paranoid!)

In general, from the usual counter and cheap Arduino, you can make a fairly simple and interesting solution for a homemade "smart home". In addition, in fact, monitoring of electricity consumption is quite a good opportunity to organize a monitoring system of the included devices, which, based on the change in consumption and its nature, will guess what was included. Without any additional sensors.

Sketch sources for Arduino and LabView file can be downloaded on the author’s page . After installation, modify the file to add a block in accordance with the description above.

Source: https://habr.com/ru/post/234679/


All Articles