Electricity meter
Each apartment has an electricity meter and its readings must also be taken on time. We had the same problem with this as with water meters - we constantly remembered it when we were quite far away. It was necessary to somehow solve this problem. This is the counter I have installed in the panel on the landing.
Each meter indicates how many pulses it makes per 1 kWh. I have an old electricity meter installed and it does not have special pins for counting these pulses. But it has an LED that blinks in time with these impulses. This means we need to somehow determine that the LED has blinked. To do this, I decided to use a phototransistor, which changes its resistance depending on its illumination. To make it respond only to the LED, the phototransistor was installed in a piece of a square piece of wood and taped to the meter. How it turned out can be seen in the photo below.
Even during renovations in the apartment, I installed a plinth in the common panel and ran a twisted pair cable from it into the apartment panel with a low current. I installed the device in this panel (it also has a power socket) and connected the phototransistor to my device through the plinth. And in this form everything has been working for more than six months.
Procedure for taking electricity meter readings
There are several types of electricity meters:
- induction;
- electronic;
- single tariff;
- multi-tariff.
The induction device has a single tariff and does not create difficulties in taking readings. The essence of its work lies in two electromagnets in the structure, located relative to each other at an angle of 90⁰. An aluminum disk is placed in a magnetic field.
Electronic meters have a number of advantages over induction ones, for this reason they are gradually replacing the latter:
- compactness;
- multiple tariffs;
- active and reactive power is taken into account;
- high accuracy class;
- Remote readings and automatic data sending are available.
The operating principle of the electric meter is based on a microcontroller that measures current pulses. The controller protects the device from emergency situations. The pulse passes through the sensors, then is output to the microcircuits. Next, the information converted into kilowatts is displayed on the screen.
Taking readings from an induction type meter
Accounting for consumed energy from this device is quite simple. It is enough to write off the data from the indicator, which displays the total amount of electricity consumed over the entire period of operation. To calculate the payment amount, subtract the readings of the previous month from the resulting number and multiply by the tariff established by the energy sales company.
Enter the received meter readings into the receipt. Periodically, the energy company monitors the correct operation of the device, so the user must provide employees with access to it.
Only whole kilowatts should be written off; tenths and hundredths are not needed for filing. There are counter models without indicating shares.
Taking readings from an electronic type meter
The external panel of electronic meters can be intimidating and misleading. In fact, there is nothing complicated about taking readings from electricity meters. There are several types of such electricity metering devices:
- Single tariff (T1) - takes into account the electricity used regardless of the time of day, according to a single tariff;
- Two-tariff - the day is divided into two phases: night (T2) and day (T1), calculated at different tariffs. At night, energy use is significantly cheaper.
- Three-tariff - in addition to the night (T2) and day phases (T1), there is a peak phase (T3). During this period, electricity is calculated at an inflated tariff due to the maximum use of electricity.
Finalization of the board
I modified the old board a little. Now the diagram looks like this
The following changes have been made:
- A CP2102 chip has been added to the circuit so that you can connect to the board directly without adapters
- The number of pins has been increased to 4 (M1, M2, M3, M4), which allows you to simultaneously connect a larger number of meters
- Added auxiliary resistors (R1..R8), which allowed the pins to be configured as needed
Each pin can now be configured to:
- LED connections
- button connection
- connection of meters (sensors)
When using a phototransistor and a leakage sensor, their minimum resistance may not be enough for the voltage to drop to a logical zero level. To do this, a voltage divider was added to each pin.
Let's use the example of a leakage sensor to calculate the voltage divider. Let's say the sensor is connected to pin M1. It has auxiliary resistors R1 and R2. Supply voltage(U) ESP 3.3V. The resistance of the leakage sensor (Rd) when water gets on it becomes 10 kOhm. We need to ensure that the voltage is below the logic zero voltage level. For ESP this is 0.8V, let's take 0.6V. we don’t need it, so we’ll take it equal to 0. Formula for calculating voltage:
Let's highlight:
, where is the sensor resistance
Let's substitute the known values into the formula
, round up to the nearest higher and get 47 kOhm. For a phototransistor, the calculation is done in a similar way, only Rd is equal to the resistance of the phototransistor when illuminated by an LED.
Firmware
As before, the firmware was assembled using an online constructor. The old script was modified to accommodate 2 operating modes: taking water meter readings and taking electric meter readings. Accordingly, there are 2 settings windows:
If you wish, you can combine everything and add something of your own. When debugging, I simultaneously connected 2 water meters, a leakage sensor and an LED. In the water meter reading mode, data is transmitted every 60 seconds, provided that there have been any changes in the readings. In the electricity meter reading mode, data is transmitted every 20 seconds without any conditions. Data is still transferred to thingspeak.com Because... In the new scheme there is no button to switch to the settings mode; it was decided to put the device into the settings mode for 60 seconds when loading. If no one connects to the device within 60 seconds, then we begin the reading mode. If someone has connected, then exit the settings mode either by saving the data on the page or by rebooting the device.
How to take readings from three-phase meters
There are two types of three-phase electricity meters - the old type, which requires transformers, and electronic direct connection (without transformers). If an electronic one is installed, the electricity meter readings must be taken in the same way as described above. Simply write down the values, wait until the necessary information is displayed on the screen, or “scroll” the data to the required page.
Connecting an electric meter in a three-phase network via current transformers
If a large amount of power is allocated or an old-style meter is installed, a transformer is installed on each of the phases. To take readings in this case, you need to know the transformation ratio. The readings taken must be multiplied by this coefficient. The resulting figure will be the actual expense.
But in general, you need to read the contract. The calculation procedure must be prescribed there - in some organizations they write out readings, put down the transformer data or transformation ratio, and the actual calculations are made by the operator himself. So, if you have a 3-phase meter, check the form and procedure for calculations when installing and sealing the metering device and putting it into operation.
According to the legislation of our country, the user is required to have a used electricity meter in his house/apartment. Consumption data is transferred monthly to the energy sales company for further generation of receipts.
Taking readings and transmitting them to the energy organization is the responsibility of the subscriber. Otherwise, he faces fines and penalties. Let's take a closer look at the instructions for taking readings from different types of electricity meters.
Finalization of the application
The electricity meter readings needed to be transmitted to a separate channel, so in the new version of the application I added the ability to add multiple channels. All data is stored in a local SQL database so that graphs can be built quickly and easily. Because I sent data on the electric meter every 20 seconds; this affected the amount of data, and therefore the speed of receiving it. For comparison, during the entire period of taking readings from water meters, about 72,000 records were accumulated, and about 2.6 million from the electric meter in about 7 months. After optimizing queries to the database, we managed to increase the sampling speed several thousand times (I myself did not expect such an increase). The new version has added:
- electricity meter widget
- line graphs
- ability to share widget or graph with other people
- ability to work with multiple channels
- speed optimization
Electricity meter readings can be taken by an employee of the energy supply company or by the owner of the electricity meter himself. Depending on the type of electricity meter, readings may be taken differently.
When taking readings from the electric energy meter, it is important to remember the following. For a three-digit electricity meter, one full revolution made by its counting mechanism is 1000 kWh. And for a four-digit electricity meter, such a full revolution will be 10,000 kWh. Accordingly, a three-digit counter can count up to 999, after which its readings are reset to zero and it starts counting again. A four-digit electricity meter can count up to 9999. These features should be taken into account when taking readings from such electricity meters and when issuing bills.
The amount of electrical energy consumed is determined by the difference in the electricity meter readings that were recorded during the issuance of the next invoice and during the issuance of the previous invoice. In order to find out the amount of the bill for the use of electrical energy, it is necessary to multiply the resulting amount of consumed electrical energy in kilowatt-hours by the current tariff.
Separately, you should consider the moment of taking readings from the meter during its replacement. So, for example, previously readings were taken using a three-digit electricity meter, and then it was changed to a four-digit meter. In this case, you should record the last readings that were still taken into account by the three-digit electricity meter. Then the readings on the new meter are recorded, and at the end of the month the readings received are summed up.
All data received is recorded on an invoice, which must be signed by the consumer himself. It is very important to ensure that such accounts are filled out correctly. It is not allowed to record any unnecessary data in the wrong columns, such as, for example, writing kopecks in the column for electrical energy costs. It is also not recommended to record the breakdown of the amount between several residents, the names of residents and other data that are not related to the calculation of the consumed electrical energy.
The invoice must be written out in the subscription book, after which it can be presented for payment at the city savings bank. Electricity bills are subject to mandatory payment on time.
The subscription book with all paid bills should be kept for three years from the date of its issue. The user also undertakes to present it to energy sales controllers at their first request, if necessary.
Total
After all the modifications, I can get the following information:
- current meter reading
- current consumption
- information on electricity consumption and consumption for a certain period of time
Of course, this begs the question why I didn’t make the device autonomous (there are several articles on this topic on Habré). If you make the device autonomous, then you need to transfer data several times a day, but I wanted to see the data almost in real time. The application can be used not only with my device, but also simply as a client for thingspeak.com to display any graphs or values. At the moment, the application beautifully displays the readings of water and electricity meters, if anyone has other ideas on what can be added, then write to me in a personal message.