I was thinking of implementing a feature for my circuit that protects it from loosing power after a 1 - 2 seconds power outage. Although a battery would do the trick, i would like to go with the capacitor route as its easy to implement to circuit, i will just add it to +/- of the circuit.

further question, how does a capacitor work in storing a charge is it like a battery? Where is starts at 0v then gradually goes up to 5v when full (assuming the circuit is 5v). and upon discharging does it gradually looses voltage too until it reaches 0? If so, how is current affected? Or is it like you power bank stays a constant 5v when charged and can dish out a constant current until its "drained"

based on observations of how a capacitor is affecting the leds i would say voltage goes slowly down, but i am not definitive.

  • \$\begingroup\$ A battery doesn't fall to 0V when it's dead. A capacitor does. A battery is dead long before it drops to 0V. For example, a lead-acid battery charges up to a maximum of 13.8V and is considered dead (can't provide current anymore) when it's 11.4V. If you are using a capacitor to power something, then you must treat it similarly: It doesn't matter if your capacitor is truly dead when it's 0V if whatever you're powering requires at least 3V. \$\endgroup\$
    – DKNguyen
    Aug 1, 2019 at 22:02
  • \$\begingroup\$ Elliott’s answer explains the physics, but to answer the “applications” question about how much time your circuit will run, more information is required. The minimum voltage that your circuit can still run? The load characteristics, is it constant current or constant resistance, or something nonlinear like a diode or a silicon chip? The capacitor’s voltage decreases as charge is removed, how fast it discharges depends on how much current the load draws depending on voltage. \$\endgroup\$
    – MarkU
    Aug 1, 2019 at 22:24
  • \$\begingroup\$ @MarkU i am not very well versed with electronics, I am still trying my best to learn. My circuit involves a microcontroller some leds, diodes, and some other modules. With the leds turning on and off that makes it not a constant current circuit, so a constant resistance i guess?? \$\endgroup\$
    – Jake quin
    Aug 1, 2019 at 22:30
  • \$\begingroup\$ @MarkU also i forgot to ask in the question what type of capacitor is best suited for this applications? Electrolytic , ceramic or something else? \$\endgroup\$
    – Jake quin
    Aug 1, 2019 at 22:32
  • \$\begingroup\$ Microcontroller is one of the most complicated kinds of loads, it’s not easy to model. \$\endgroup\$
    – MarkU
    Aug 1, 2019 at 22:44

3 Answers 3


The formula is

$$ t = C \frac{\Delta V}{I}$$

where \$t\$ is the time, \$C\$ is the capacitance in farads, \$\Delta V\$ is the maximum change in capacitor voltage that you can allow, and \$I\$ is the amount of current drawn from the capacitor.

Yes, the capacitor voltage will fall as current is drawn from it, so you must initially charge the capacitor to a higher voltage than you need and then draw current from it until it reaches the lowest voltage you can still use.

  • \$\begingroup\$ what is the unit of time good sir, is it seconds? also i do not quite understand what you mean by maximum change in capacitor voltage \$\endgroup\$
    – Jake quin
    Aug 1, 2019 at 22:11
  • 1
    \$\begingroup\$ do you mean something like this : ΔV = highest(supply voltage) - lowest(lowest voltage my circuit can funtion) \$\endgroup\$
    – Jake quin
    Aug 1, 2019 at 22:22
  • \$\begingroup\$ Also is the capacitor voltage drop linear to its capacity? for example a 5v charged capacitor when at 50% is 2.5v? \$\endgroup\$
    – Jake quin
    Aug 1, 2019 at 23:06
  • \$\begingroup\$ @Jakequin ΔV is the maximum voltage drop you can tolerate \$\endgroup\$
    – DKNguyen
    Aug 1, 2019 at 23:50
  • 1
    \$\begingroup\$ All of the quantities in the equation are in their standard SI units...volts, amperes, farads, seconds. If the the current is constant then the voltage will decrease linearly. Talking about the "charge" on a capacitor as a percentage is vague...we normally talk about the capacitor voltage or the stored energy. \$\endgroup\$ Aug 2, 2019 at 0:14

both battery and capacitor energy is \$E = ½ C (V_{init}^2-V_{cutoff}^2)= V*I*t\$ for t in seconds and V= Vavg and I= I avg.

So for a battery pack you choose (Vi-Vf) * Ah * 3600 seconds to get avearge energy. This is one way to equate Caps to batteries. But it gets more complicated with the Double-Layer Effect (memory) in both.

A 18650 Li Ion could be 10kF @ 3.6V from 3.7 to 3.0V typ. for conservative use. with cost ranging from $1.2 to $10 depending on Ah capacity and quality which is a wide range in quality.

You can lookup Supercaps which have low voltage are large values xx Farads but in 1F ( not 10 thousand Farads) the prices range from $1.5 to $15 depending on ESR which is far greater than a battery which limits your surge current.

When Supercaps used be the size of e-Caps they were good enough for NVRAM backup, but Li Coin cells are cheaper now and higher capacity. ( in Farads)

  • \$\begingroup\$ I was trying to avoid battery as much as possible because it requires additional circuits compared to just capacitors, also adding a battery pack is overkill since if power is lost for more than 3 - 5 seconds the whole systems shuts down anyway. But thank you for showing me the equation to compare battery and capacitors :) \$\endgroup\$
    – Jake quin
    Aug 3, 2019 at 9:22
  • \$\begingroup\$ @Jakequin THen a better solution is to use different thresholds for shutdown so that there is reserve power for check to see if the battery has been recharged or replaced coming out of deep sleep. There is no reason why a battery needs significant additional circuits. Unless you are just doing a RTC.= and as I have said even Supercaps have been replaced by Lithium due to cost , capacity and simplicity \$\endgroup\$ Aug 3, 2019 at 19:48

To provide output at constant current and voltage there are two main answers

  • When discharging using a linear regulator

  • When discharging using a switching requlator.
    There are two subsets.

    • Vcap >= Vout = buck regulator

    • Vcap falls to less than Vout = buck-boost regulator.

The energy in capacitor = 0.5 x C x V^2
If voltage falls from V1 to V2 then the energy extracted =
0.5 x C x V1^2 - 0,.5 x C x V2^2
= 0.5 x C x (V1^2 - V2^2)
[= for interest : 0.5 x (V1-V2) x (V1+V2)

If Vcap falls by a factor of 4 from Vstart to Vstart/4
E total = 0.5 x C x Vs^2
Energy fro Vs to Vs/4 extraction = 0.5 x C x Vs^2(1-1/16)
= 15/16ths of available energy = most of it.
ie for voltage falling to 1/nth of initial the energy left is Eoriginal x 1/N^2.
This means that say V falling from 12v to 4V (N=3) means only 1/9th is left.
Even for V falling from say 10V to 5V, N=2. Energy left = 25%. Energy used = 75%!

With a Buck converter:

This assumes that Vcap falls to Vout+Vdropout.

The equations below also work for a buck-boost converted with Vcap < Vout. For a buck-boost converter Vcao can fall to below Vout.
Efficiency in boost mode is usually lower than buck efficiency and usually falls further as Vcal gets very low. As for Vcap = Vinial/4 remaining energy is only 1/16th of initial , there is not usually great advantage in using very low cap voltages.
even for eg 5V6 to 3v3 Out + 0.2 V dropout, remaining energy at the start of boost mode is only 40% of initial. For say 10V to 3.3 + 0.3 remaining efficiency is only 12% of initial.

Energy available = total capacitor loss x efficiency.
0 < efficiency < 1 -> usually in the 0.7 - 0.9 range.
In the following calculations efficieny is assumed as 100%.
Scale answers down linearly by actual efficiency - say start with 0.8 as typical.
Real world efficiencies of some converters can be in the 0.90 - 0.95 range (or even better) BUT this is usually across a restricted load and Vin/Vout range. Starting at 80% and increasing if a "sweet spot" can be managed for a given application is less liable to lead to disappointment.

Assume regulator has NO dropout voltage. Assume regulator proper is 100% efficient . Energy will be lost as heat when voltage drops across regulator.

Energy available = 0.5 x C x (Vstart^2 - Vreg_out^2)
For a low dropout regulator with Vin_min is say Vout+0.2V then the above is about right.
If dropout voltage is significant then Energy available = 0.5 x C x (Vstart^2 - (Vreg_out+Vdropout)^2)

eg using:
10,000 uF = 10 mF = 0.01F capacitor Vstart = 5.4. Vout = 3V3.
Vdropout = 0.2V
Energy available = 0.5 x C x (5.4^2 - (3.3+0.2)^2)
= 0.5 x 0.01 x (29.16-12.25) = 0.08455 Joule
= 84.55 mJ
1J = 1A x 1V x 1S = 1 A.V.s
or 1 mA.V.S
So 84.55 mJ = 25.6s x 1 mA x 3.3V
Or 2.56s x 10 mA x 3.3 V or ...

Increase the capacitor to say 1F and you get about 8.5J or 8500 mJ and it starts to "get useful"

eg 8500 / 3.3V / 3600s = 0.715 mA for 1 hour.


For a given Vout and Out, current is drained at constant I.
Energy lost is (Vin-Vout-Vdropout) x Iout.
As cap voltage approaches Vout efficincy approaches 100%.
Initially Efficiency is Vout/Vin_initial.
Total cap energy remaining is 0.5 x C x (Vout+Vdropout)^2
As a fraction of total initial energy = (Vout+Vdropout)^2/Vinitial^2

For small Vinitial/Vout drops much energy remains when Vcap = Vout.

Delta_V_cap = dV = T x I / C

dV = V = drop in capacitor voltage - Volts T - Time - seconds I - current - Amps C - Capacitance - Farad

V = TI / C T = VC / I C = TI / V
I = VC / T

Allowed drop = Vinitial - Vout - dropout_voltage

Eg 10 F cap, 20 mA, allowed drop = 5V6 to 3V3, dropout = 0.2V.

T = V/IC = (5.4-3.3-0.2) /(0.02 x 10) = 1.9 /0.2 = 9.5 seconds.
or, using above buck converter example:

10,000 uF = 10 mF = 0.01F capacitor Vstart = 5.4. Vout = 3V3.
Vdropout = 0.2V
I = 1 mA

T = VC/I = 1.9 x 0.01 /0.001 = 19 seconds
Compared with the 25.6s with the buck regulator AT 100% efficiency
To "break even" the buck regulator would need an efficiency of > 19/25.6 ~= 74% This would usually be achievable BUT the difference is closer than may be expected.

As Vinitial to Vout ratios rise the buck converter becomes a clear winner.


  • \$\begingroup\$ Thank you for taking your time to write everything. you even did write examples. I will keep this in mind if i ever need to have a constant current and voltage for my circuit \$\endgroup\$
    – Jake quin
    Aug 3, 2019 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.