# Using a capacitor to keep circuit powered for 1s after battery disconnected?

I am planning on using a 3.3V GPS module which draws 22mA. The module has a requirement that a shutdown sequence be initiated 1s before power is removed from the IC. If power is removed without allowing it to go through the shutdown sequence, the program flash memory can become corrupted and the module bricked. This seems like a really poor design to me, but that's the way it is.

The circuit I'm designing is battery powered, so the battery could die or be removed at any time. I considered using a separate battery as a backup, but it seems like capacitor would be cheaper and easier.

So, I need a capacitor to power it for 1s when the power is disconnected. I'm planning on putting a Schottky diode before the capacitor to ensure other ICs in the circuit don't draw power from the capacitor. I need to determine the capacitance to use and am unsure if my calculations are correct.

I know $Q = I \times t$. Therefore, the charge needed is $Q = 22\text{mA} \times 1\text{s} = 22\text{mC}$.

Since $C = Q/V$, the capacitance needed is $$C = \frac{22\text{mC}}{3.3\text{V}} = 6.67\text{mF}$$

Is that correct? Do you think using a capacitor like this is a viable alternative to using a backup battery?

• You have to take into account that the voltage on the capacitor will drop during this time. What is the minimum usable voltage? If it's not much brlow nominal, you will either need a huge capacitor (not unachievable for low voltages) or a more reasonable one upstream of a regulator with a usual supply well above its dropout. Finally schottky diodes leak, which would probably kill this idea for longer term memory backing, but in the short term that may be minor compared to your relatively high intended load. – Chris Stratton Feb 9 '15 at 15:32
• $$I=C\frac{dV(t)}{dt}$$ Or if we proximate: $$I=C\frac{\Delta V}{\Delta t}$$ $$C=I\frac{\Delta t}{\Delta V}$$ Where Delta t is 1 second in your case, and Delta V is the voltage drop allowed which is 0.3v in your case (3.3 - 3). Plug that in and you get: about 73.3 mF. If I were you I would at least double that. Take note that if you use a schottky diode it would drop a couple of hundreds of mil-volts so your effective allowed drop would be less. You might want to use a higher voltage supply, like 3.6v. – Mike Feb 9 '15 at 15:47

The device can work from 3.6 to 3.0 V according to the datasheet. I assume you will use a 3.6 V supply. Also I simplify the device as an impedance of 150 Ohms. So, the problem can be translated into that: In a RC circuit, what is the capacitance needed for a 150 Ohm resistance, having 3.6 V on t=0, having 3.0 V on t=1.

v(t) = V(0) * e^(-t/(R*C))

v(1) = v(0) * e^(-1/(150*C))

3 = 3.6 * e^(-1/(150*C))

C = 0.0365F = 36500 uF

It is bulky for a conventional electrolytic cap. Use a supercapacitor.

note: This formula I used is a solution of differential equation for natural response of RC circuit. For more information look at: https://en.wikipedia.org/wiki/RC_circuit

note2: It may not be bulky for electrolytic if you find a capacitor a bit higher than 3.6V volts, but I guess it is difficult to find.

• Super capacitors are usually lower voltage than this? – endolith Feb 10 '15 at 13:49
• No, 5V supercaps can easily be found: link @endolith – Ayhan Feb 10 '15 at 15:30