I have an ESP32 that is powered by a 12V main power supply, and I'm using a buck converter to step it down to 3.3V. In case the 12V power supply is unexpectedly disconnected, the ESP will shut down.
Now, I want to add a backup power source using three non-rechargeable AA batteries, also stepping down the voltage to 3.3V. The intention is not to run the ESP for an extended period but to use the batteries as an emergency power source to notify me when the main power supply is cut off. I'm looking for an efficient switching mechanism to ensure the AA batteries last a long time (ideally at least 1 year if unused), and the ESP continues to receive power from the 12V source.
there is not a problem if esp shut down and then restart from AA batteries.
Is there an efficient switching mechanism that can achieve this without wasting the AA batteries' power when the main power supply is still available?
