I'm thinking of finally dipping a toe in the ESP32 water and would like some constructive criticism of my idea.
Currently my weather station has a Wemos D1 mini pro (ESP8266), plus an ATtiny85. I've never been entirely happy with this arrangement. How many times have I lectured beginners on this forum about not using 2 "Arduino" (ie. 2 MCU) in the same circuit? Yet I did it myself.
My reason was that the wind speed anemometer, wind vane and rain guage need constant monitoring. All 3 sensors are based on magnets and reed switches. Something needs to detect their signal edges or resistance continuously.
Because the weather station runs on battery power (li-ion cell), I need to minimise power usage, so the Wemos D1 mini needs to spend most of its time in deep sleep. The ATtiny monitors the wind & rain sensors continuously.
The D1 mini wakes every 15 mins, gets the readings from the ATtiny via software UART, it also reads SHT31 temp/humidity and BH1750 light level sensor over i2c, connects to WiFi and POSTs the data off to a local server on my LAN.
The D1 mini has a UFL connector to connect to an external higher gain antenna to ensure a reliable connection to the WiFi despite poor signal strength where it is located.
I'm thinking I could replace the D1 mini pro and ATtiny with an ESP32 C3 Super Mini "plus". The "plus" just means it has a UFL connector for that important external antenna.
I'm reading up about the specs and capabilities of the C3 to try to figure out if it's a good fit to replace the D1 + ATtiny.
I'm thinking that, similar to the D1 mini, the C3 will spend most of its time in deep sleep. But unlike the D1 mini, the C3 can wake from deep sleep when there are signal edges from the anemometer or rain gauge. This involves using a feature called "wake stub" which is a user-defined function that runs from its RTC memory, which is retained during deep sleep, unlike most of the RAM memory. Variables can also be stored in this RTC memory.
The wake stub function could, I think, count the signal edges from the anemometer/rain gauge, read the resistance of the wind vane and go immediately back to deep sleep.
On a timed 6 second interval, it would wake and check for a new highest wind gust speed and go back to deep sleep.
Every 150 timed wakes (15 mins), it would finally properly wake the ESP32 up to connect to WiFi and POST off the results.
So I would ideally like advice from someone with experience using the ESP32 C3 about my plan/idea. Can I use it like this? Will it wake from deep sleep fast enough for this idea too work?
Some further details: the anemometer could generate up to about 50 interrupts per second during extremely high winds. Most of the time it will be far fewer interrupts per second. The rain guage will only generate a few interrupts per minute at most even in heavy rain.