Designing for power that cuts out

Power cuts and voltage dips are common in many places. A device should handle them safely and recover on its own.

Deep dive

Brown-out reset and hold-up when the supply sags or fails When the supply sags below the brown-out threshold, the processor is held in reset until the supply recovers. When the supply fails, a hold-up capacitor keeps the device running long enough to finish a write; without one the voltage drops at once. Journaling, copy-on-write or read-only filesystems survive cut-off writes. Brown-out Resets the chip when the supply sags below a safe threshold, and holds it in reset until the supply recovers Supply voltage brown-out threshold running held in reset running Hold-up A capacitor or supercapacitor keeps the device running after the supply fails milliseconds to tens of seconds Device voltage Not to scale supply fails with hold-up without Long enough to finish a write, send a last message or shut down cleanly. A cut-off write can leave flash or a filesystem inconsistent. Power-cut-tolerant designs use journaling copy-on-write read-only root
A brown-out detector holds the chip in reset while the supply sags, and a hold-up capacitor keeps it running long enough to finish a write after power fails.

Key points

  1. A brown-out detector resets the processor when its supply drops below a safe threshold and holds it in reset until the supply recovers, so the chip does not run unreliably while the voltage sags.1
  2. A write interrupted by power loss can leave flash or a filesystem inconsistent; power-cut-tolerant designs use journaling or copy-on-write filesystems, or keep the root filesystem read-only.234
  3. A hold-up capacitor or supercapacitor can keep a device running for the milliseconds to tens of seconds needed to finish a write, send a last message or shut down cleanly after the supply fails.56

Sources

  1. RP2350 datasheet · Raspberry Pi · Datasheet
  2. Linux kernel: UBI File System · kernel.org · Project docs
  3. littlefs design · littlefs project · Project docs
  4. Preventing Filesystem Corruption in Embedded Linux (updated 17 Dec 2020) · Technologic Systems (embeddedTS) · Vendor page
  5. TIDA-00304: 'Last Gasp' Hold Up Energy Storage Solution (TIDU506) · Texas Instruments · Reference
  6. Effective Ways to Implement Backup Power from Supercapacitors (SSZT121) · Texas Instruments · Reference