![]() Using ESP32’s proper sleep modes within a battery-powered networking application makes it possible to reduce the power strain on the system from hundreds to a few mAs. Next, we’ll discuss ESP32’s power and sleep modes, covering the different wake-up sources and how both (the sleep and wake-up sources) are managed within MicroPython’s framework. Fortunately, it offers several power-management options that help. However, ESP32’s energy consumption can pose a challenge for battery-powered IoT devices. This is why ESP32 is the ideal choice for many choosing between the two Expressif boards. Many IoT developers prefer to use the feature-packed SoC in their applications so that minimum external components are required on the board. The components on the breakout board can also add a few hundred mAs to the net power consumption. The power consumption of ESP32 can reach up to 790 mA when the Wi-Fi and Bluetooth are both operational - nearly double that of ESP8266, which maxes out at about 400 mA when highly active. It’s more feature-rich than ESP8266, but also more power-hungry. ESP32 is another popular Wi-Fi development board from Expressif systems. Its a working code I tested in HW.In a previous article, we covered sleep modes in ESP8266. I have not placing the code here, because its there in GitHub and not directly for the asked question, but simile one and can use it. I have created sample program for a water flow meter, there also we use to get pulse which needs to count to measure the water flow rate, understanding simile to kWh meter. ![]() I have not use all the API's in the official documentation but but used few of them and are working. Initially I faced lot of issue to make Pulse Counter(PCNT) work in Adrino IDE for ESP-32, After multiple attempt I make it working, And same sample code is uploaded in GitHub for reference. Its also possible to configure event when number of counts reached certain threshold and had lot of options,įor get information and available Interfaces and API's for Pulse Counter(PCNT) please follow below link, You can use Pulse Counter(PCNT) feature in ESP32 to count the number of pulse in background, Understanding by using same you can able to do some periodic wake-up and read the count. So its up to you to experiment with your specific scenario. This way you can get low power consumption (~5uA) between pulses and moderate power consumption while running the wake stub (around 13mA), for a very short time. So you use deep sleep wake stub (small piece of code which runs immediately after deep sleep, prior to loading application from flash into RAM) you can increment the pulse counter variable, and go to sleep again. However it should be easy to change that, by enabling deep sleep wake up from timer. The only difference seems to be that the example is set to wake up after a given number of pulses, rather than a fixed amount of time. ![]() So when it is awake, it will still run the counter on the ULP processor unless you stop the ULP periodic wake up timer, ULP will keep waking up and running while the main CPU is active.Īs you gave already checked with this example, it should be pretty close to what you need. Code on the ULP continues to execute when the board wakes up and goes to normal power mode. If you want to count pulses while in deep sleep youuse the ULP. I would really be glad if someone would show me how to basically use the ulp for counting pulses even when it is sleep mode and periodically wake up the main cores. I have looked at the pulse counter examples and with my limited knowledge can not tell if the interrupts are triggered when the ulp is in sleep mode or only when it is on. I would like to do hardware interrupt which when one of the rtc gpio pin goes high a counter is incremented while a seperate timer interrupt run and occasionally wakes up the main xtensia cores which fetches data from the rtc and sends it over. I have tried out examples from github using espressif idf but I would not mind an arduino equivalent. I am interested in using the esp32 since I can periodically send the data over the internet to nodered dashboard.I am also very interested in using the esp32 in low power mode and periodically wake up to send data over mqtt. I am trying to measure power usage using dds353 kWh meter. ![]()
0 Comments
Leave a Reply. |