Page 1 of 1

Pulse counting and Deep Sleep

Posted: Tue Jan 21, 2020 9:19 am
by ASTEG14
Dear All,

I am just a beginner with ESP-32 and need a tip how I solve a problem with my sensors.

Structure is as follows:
- ESP32 wakes up from deep sleep after a defined time, powers up all sensors via a MOSFET SSR and then read all attached sensors and then falls back asleep.
- after all sensors are read it sends via ESPnow the data to an indoor station.
So far all works well with temperature, humidity, pressure, but there is a problem when it comes to counting impulses for example from a anemometer or a Geiger counter. when I had the whole code separated in void setup and void loop all was working, but as I understand I can not use a loop together with deep sleep mode. Is that correct?

Second question is if there is an other way to count falling flanks for 20 seconds and then go to deep sleep again

Any tip is welcome.

Re: Pulse counting and Deep Sleep

Posted: Tue Jan 21, 2020 10:01 am
by ESP_krzychb
ASTEG14 wrote:
Tue Jan 21, 2020 9:19 am
So far all works well with temperature, humidity, pressure, but there is a problem when it comes to counting impulses for example from a anemometer or a Geiger counter. when I had the whole code separated in void setup and void loop all was working, but as I understand I can not use a loop together with deep sleep mode. Is that correct?

Second question is if there is an other way to count falling flanks for 20 seconds and then go to deep sleep again
Hi ASTEG14,

You can count pulses in deep sleep using ULP.

Using Arduino I would check https://github.com/duff2013/ulptool
Example of counting pulses in deep sleep - https://github.com/espressif/esp-idf/tr ... system/ulp