Interfacing coin cell back up for internal RTC of ESP32
A diode steering type setup is common. As long as the supply voltage is slightly higher than the battery voltage the diode will stay reverse biased. If the supply voltage drops out then the battery will take over automatically. Using a Schottky type diode can help reduce the forward voltage drop. Also, the device would have to detect the missing power supply and go into a hibernation type mode not to kill the battery too fast. 







simulate this circuit &ndash; Schematic created using CircuitLab