Pulse counting and Deep Sleep

ASTEG14
Posts: 1
Joined: Tue Jan 21, 2020 8:47 am

Pulse counting and Deep Sleep

Postby ASTEG14 » Tue Jan 21, 2020 9:19 am

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.

User avatar
ESP_krzychb
Posts: 396
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Pulse counting and Deep Sleep

Postby ESP_krzychb » Tue Jan 21, 2020 10:01 am

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

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 249 guests