ESP32 brownout detector

We might want to look into this.

The ESP32 has a built-in brownout detector which can detect if the voltage is lower than a specific value. If this happens, it will reset the chip in order to prevent unintended behaviour.

CONFIG_ESP32_BROWNOUT_DET

Release ESP-IDF Pre-release 3.0-rc1 · espressif/esp-idf · GitHub

A minor excursus: In the rocketscream lowpower lib for Arduino is an option to deactivate brownout detection so save even more power:

Option to disable Brownout Detector (BOD) module to further reduce current consumption by approximately 17 µA. BOD module cannot be disabled through software in idle and ADC noise reduction mode. It can only be disabled through fuse setting in these 2 modes.

i think that lib is atmel avr only.
it errors out with ‘platform not supported’ when compiled with esp8266 or esp32.

but this does not mean that similar concepts do not exist on the esp series.
they will have different registers and often different mechanisms (see the concept of sleep… esp switches off, and reboots, avr can stall the clock…)
thats why its not really abstracted well in the arduino universe inbetween such platforms.