Xiao ESP32-C3 saving data

My idea is as follows.

  1. fix all components and wiring to XIAO with adhesive to reduce the effects of vibration.
  2. Connect a capacitor to a point 3V3 pin separate from the battery.
  3. Monitor the battery voltage and determine that a power failure has occurred if the voltage drops (e.g., below 3.4 V).
  4. When a power failure occurs, write the last data to Flash and do not write any more.
  5. A large capacitor (e.g., 1.5 F) supplies the energy required for the last write.

The following sample sketches will work.
xxxxx File–Examples–Examples for XIAO_MESP32C3–EEPROM xxxx
I have tried three libraries and recommend SPIFFS.

See the following link regarding battery voltage monitoring.
Battery voltage monitor and AD conversion for XIAO_ESP32C

1 Like