Electronic – Using supercapacitor as backup for MCU

microcontrollerpowersupercapacitor

I have this project that requires some kind of backup power supply. and I am planning to use a 5V 4F super cap.

there are my questions:

  1. I am planning to charge the cap with a diode and 100 ohm resistor to a 5V VCC (Good idea?). how can I connect the cap to the MCU. direct connection will not work because it will take some time for the cap to charge up.

  2. Normally the circuit will consume 20mA, in power-off mode, it will use about 200uA, how long will this 4F cap last?

enter image description here

Best Answer

Assuming ideal conditions i.e. no leakage current in capacitor and other parts of circuit.

Case 1: Your micro controller is running and drawing 20 mA. Lets assume your micro controller will work fine till voltage reaches 4V. However for atmega 328, you can make it run at even lower voltages if you choose to run it at a lower clock frequency.

Assuming 20 mA at 5V, your load resistance will be 5V/0.02A = 250 ohms

Here is complete theory in one image:

Cap discharge

Initial Vo = 5V and final Vc = 4V. Solving for time gives 225 seconds.

It means, your micro-controller will keep functioning for another 225 seconds after you lose power, provided the capacitor was charged to 5V.

Case 2: Your micro-controller is in power off mode consuming 200 uA.

R = 25000 ohms.

Solving for time gives 6.25 hours.

This is the theoretical max time you are getting. Things can't get better than this unless you are planning to run your controller at a lower clock frequency.

Just for you reference, Atmega328 can run from 1.8V. For this you get a time between 17 minutes and 28.33 hours

These are theoretical values. Practical values will be even lesser due to leakage in your diode, capacitor itself and other circuit elements.