Repository navigation
Alternative Low-Power Zigbee Pulse Counter Implementation Based on ESP32-H2 #4
Replies: 1 comment 3 replies
|
Hello @vsychov Thank you for your contribution! At this stage I'm still exploring light sleep mode to fully understand it and have not made any final decision but here are my conclusions just to keep the ball rolling and share thoughts. Most probably, the best way to achieve low power consumption is to use external counter such as the one provided by @soosp in a separate discussion. And combine it with a deep-sleep Zigbee End Device that wakes up once every hour to report accumulated counter values. This means we only spend high amount of energy 24 times a day. In the meantime, using the same board I've already developed I'm trying to approach that point using only the ESP32. This means. I plan to set up the ESP32 to deep-sleep (I mention previously I'm exploring light-sleep, but I don't think that keeping the zigbee stack active is a good idea in this case). Wake up only for GPIO interruptions, count ticks and sleep again. Also, wake up every hour, join the network, transmit values and sleep again. Your suggestion to use the xiao_mg24 makes total sense too. At this stage, the code is written for the ESP32 family so I'll keep experimenting with it until I finish my tests. One of the consequences of battery powered device is that we will lose the capacity to report "power" so we will only report "energy". The code is ready to add/remove this functionality in case someone has AC available near the counter and is not limited to the battery capacity. Again, thank you for your contribution! |
Uh oh!
There was an error while loading. Please reload this page.
Hello, I needed to do essentially the same thing you did in your project, with almost the exact same gas meter. I came across your project during my research, but since it was not finished, I decided to look into the topic myself and build it on my own.
The first thing I want to note is that there are ready-made pulse counters, for example:
This one is more oriented toward electricity measurements, but it has a replaceable pulse sensor, so in theory it would not be difficult to replace it with a reed switch.
But like you, I decided to go the DIY route and also started with the same board, ESP32-C6-WROOM-1. However, I very quickly realized that it would not provide an acceptable battery life. My goal was to get at least 6 months of operation on a battery, ideally several years.
After doing some additional research, I found that among ESP32 boards with Zigbee support, the ESP32-H2 has the lowest power consumption. For the further implementation I used this board:
https://www.amazon.de/dp/B0FPCS299V
Waveshare ESP32-H2 Mini Development Board with ESP32-H2FH4S.
In the stock version without modifications, in light-sleep mode it consumes about 700 µA, unlike several mA on the ESP32-C6-WROOM-1. This is still quite a lot, but with a small modification, removing the LED together with its driver (WS2812), the consumption drops by more than half. On a bare board I managed to get 234 µA in light-sleep mode, which in ideal conditions is enough for about 7 months of operation from two LiFePO4 14500 batteries at 3.2 V. The battery ADC circuitry adds a bit more consumption, so in the end I got around 300 µA total, which corresponds to roughly 5 months of battery life. For now, that is sufficient for me.
If I were doing this now, I would choose https://wiki.seeedstudio.com/xiao_mg24_getting_started/, since it has an order of magnitude lower power consumption and can go into sleep with only about 5 µA while retaining RAM, which is important for Zigbee.
I published the source code at https://github.com/vsychov/ZigbeePulseCounter in case it is useful. The code there is AI-generated, so it is not something to treat as a reference implementation, and I suspect there are some dumb bugs in it. Still, it solves my needs and overall works with low power consumption.
All reactions