logo elektroda
logo elektroda
X
logo elektroda

Remote LED flash detector of the electricity meter

efi222 
Hello :) .
I have been planning for quite a long time to build a device to indicate the current electricity consumption in the house. The problem was that there was no way to connect to the power supply in the meter box. Pulling additional cables meant devastating part of the building.
So a wireless LED flashing transmitter for the electricity meter was created.
I have made remote sensors for the weather station using a similar system.

Transmitter:
The processed LED flashes are sent by the ESP8266 chip using the ESP NOW protocol.
The conventional counter number and power cell status are sent.
In the idle state, the ESP is plunged into a deep sleep :) .
Current consumption in this state is about 160uA (could be less).
The photoresistor is incorporated into a comparator circuit on the LMV358, the output of which controls a transistor that provides a low state that resets the ESP circuit when the counter LED flashes. After waking up and sending data, the MCU falls into a deep sleep.
The whole thing is powered by an 18650 cell.

The transmitter software needs to be discussed. Anyone who has dealt with ESP NOW with a receiver connected to WiFi has encountered the problem of changing the channel on the transmitter. Connecting the ESP NOW receiver to a WiFi network, has the effect of changing the default 1 ESP channel to a WiFi channel.
The transmitter does not know this and transmits on channel 1 (no communication).
In this case, the transmitter has two automatic modes of operation.
In scan mode, the transmitter in ESP NOW mode looks for a receiver with a specific MAC. It sends a query to it sequentially on each channel until a response is received. After a positive response, the channel number from which the response came is stored in the RTC memory. This memory is not erased on subsequent ESP restarts. Scanning the channels takes approximately 300ms.

I have also made a small adjustment in case of interference during data transmission.
Each time data is sent, the receiver sends back an acknowledgement to the transmitter that it has received it. The next scan takes place after two unconfirmed transmissions.

Receiver:
Example demo. ESP8266 connected to a WiFi network, generates a web page. An Ajax script refreshes the data on the page.
The operation of the program is to convert to kW an incremented timer (1kHz) variable between successive received data (LED flashes) from the transmitter. This can be done in any other way. Also the calculation of kWh.

Transmitter design:
Wireless LED pulse transmitter with ESP8266 and 18650 battery .

Short demonstration video:




Diagram:
Electrical schematic of a remote LED flash detector.

ESP8266.
Current consumption. Channel scan oscillogram.
Here you can see 13 WiFi channels (about 300ms).
Oscilloscope signal waveform depicting LED blink detection. .

Oscillogram after LED flash detection:
Total time from wake-up to sleep about 180ms.
I am puzzled by this second pin....
Oscilloscope showing LED blink signal from ESP8266 device.

Transmitter and receiver sources attached. MCU software written in the Arduino IDE.

About Author
efi222
efi222 wrote 529 posts with rating 963 , helped 7 times. Live in city Toruń. Been with us since 2019 year.

Comments

miroskop 24 Jul 2024 21:06

I don't understand something though maybe it's the heat :) . If your reading is in kilowatt hours then why is this value dropping? Consumption can only increase. It is a different matter when it comes... [Read more]

efi222 24 Jul 2024 21:16

Your colleague is obviously right. I screwed up on the descriptions. What is meant is the current consumption, i.e. kW. :) . [Read more]

kjoxa 24 Jul 2024 22:01

A very interesting device. Congratulations! I too am building a station on ESP NOW that reads temperatures from several rooms. The transmitters are also in DeepSleep mode most of the time. For how much... [Read more]

efi222 24 Jul 2024 22:17

I have similar transmitters at the weather station on the ESP Now system. They transmit every minute. The transmit time is about 220 ms. They are powered by a 18650 3Ah battery. I put such a battery in... [Read more]

Sam Sung 24 Jul 2024 22:21

Congratulations, I also wanted to do something similar ~16 years ago: https://www.elektroda.pl/rtvforum/topic1086071.html but col. @adamjur1 successfully discouraged me :D . So the photoresist is not... [Read more]

efi222 25 Jul 2024 10:01

There might be a problem with the photoresist because I got them mixed up.... But I will check the light and dark resistance tomorrow and write to my colleague. The transmitter in the photo is the whole... [Read more]

gulson 25 Jul 2024 10:19

An arrangement that is even essential in these difficult times. We are talking about terrible energy increases. Immediately there will be incentives to move to hourly billing with different rates, where... [Read more]

ex-or 25 Jul 2024 10:22

. Taking into account idling alone (160uA) - just over 2 years. Considering operation, assuming 220mA (intake quoted by the internets) for 180ms every hour - approx, 2 years, every 10 minutes - 1.5 years,... [Read more]

efi222 25 Jul 2024 11:02

yes :D ... ex-or thank you for the calculations. That 220mA is basically just when the modem is transmitting. In this case it's that highest short pin (a few ms) on the second oscillogram. I measured... [Read more]

ex-or 25 Jul 2024 11:25

Well, yes, it comes out current lower by an order of magnitude. So with a pulse every 10 sec you can expect roughly about 9 months. [Read more]

acctr 25 Jul 2024 12:35

In theory, you could still extend and send less frequent but more aggregated data. [Read more]

efi222 25 Jul 2024 13:00

In this case I was concerned with updating the readings quite quickly. You can see in the video that this is still quite slow after the power consumption drops. At 100W consumption, the meter LED flashes... [Read more]

sq3evp 25 Jul 2024 13:07

I must be reading poorly - how do you access and read the measurements? A website or some kind of service? Interesting project - I also have an Apator meter and a flashing LED. [Read more]

speedy9 25 Jul 2024 13:09

And have you thought about using Zigbee on the ESP32-C6? It could be even more economical in terms of power. [Read more]

efi222 25 Jul 2024 13:12

The receiver on the ESP generates a web page on the local network on a local IP. When the receiver is started, the IP address of the page is sent to the UART. You can also assign this address or another... [Read more]

speedy9 25 Jul 2024 13:13

I understand correctly that the MCU is then awakened very frequently? For pulse counting I understand, but it probably doesn't need to send every pulse, it would be enough for it to do it every so oft... [Read more]

acctr 25 Jul 2024 13:17

. That is, the LED flashes for every Wh consumed. You connect 1kW, it will blink every 3.6 seconds. The question is, is there such a power when the diode is lit continuously? then when the blink time... [Read more]

efi222 25 Jul 2024 13:20

You could, of course, count a few flashes and send one every 5 minutes, for example. Only this misses the point of this circuit. It is all about the current power consumption. [Read more]

sq3evp 25 Jul 2024 13:20

The meter seems to have the number of flashes/kWh, not the time? The time is the resultant of the number of flashes depending on the power consumed. [Read more]

%}