I've run into a problem that I can't seem to solve.
Since I'm not a HW guy, maybe there's a simple solution that I'm unaware of.
I have a project where I need to maintain time.
Using 32.768KHz crystal mounted to TOSC1.2.
If Mains power is lost I need to keep RTC running.
Mains will probably be back after some hours.
Decided to use a Supercap to run AVR in sleep mode only awakening to tick time.
Sleep mode consume only 0.3ÂµA. Very nice.
Since other devices are connected to 5v I need to isolate them from AVR 5v.
I have tried two different approaches.
1. Using a Schottky in btw "main" 5v and AVR 5v supply.
This works but AVR supply voltage is 0.3 V smaller than "outside" 5v.
Supercap never get charged to 5v, so I loose some of its capacity.
Having signals fed into AVR 0.3 V higher than AVR's supply feels uncomfortable. Datasheet says Vcc +0.5 is the limit.
8 ADC inputs are used, with bias reistors connected to main 5v. Not using same voltage for AVR means all my thermistor calculated values will be off and need recalculation.
I believe Schottky diodes have a small leakage that will consume some of the stored charge in Supercap(not sure about this).
2. Decided to use a relay.
This would give AVR same voltage as "main" 5v.
All disadvantages described above gone.
Problem is I can't turn off the relay...
Since Supercap is connected to "main" supply it will feed relay coil with its charged current.
Am I missing something obvious?
What would you suggest?