5V UPS circuit with NiMH joule thief backup
Just Don't.

instead use one of the microcontroller pins to drive a simple inductor in boost mode and have a capacitor big enough to keep the processur alive during the sleep phase.

each time you wake check the capacitor voltage and pump a few pulses into it until it's high enough 

since you need well under 1mA any micronctroller pin should be plenty strong-enough for the task.







simulate this circuit &ndash; Schematic created using CircuitLab

at the top R3 provides C/20 charge current suitable for a 800mAh NiMH cell, 
D2 and R4 provide power when ther usb charger is connected, allowing the micrcontroller to operate without using the boost converter.

below that, on the left is a boost conveerter driven by poin PA1, set PA! low for a few cycles then set it high-impedance to allow the energy from L1 to feed C1

On the right is a voltage checking circuit, when needed set PB2 high and read PB1 depending on the voltage in C1  PB1 will either read high or low, when you know enough set PB2 low to save energy. .
You will find that this circuit switches state well below the marked zener voltage, some experimentation may be needed.