How does a capacitor "know" it's voltage

Say you have a simple 5v circuit, with a 1k resistor and LED. Then you add a capacitor before the resistor and after the LED. When the 5v is disconnected, how does the capacitor "know" to provide 5v, and not just dump it's full charge into the circuit?

Basic law of physics. The definition of capacitance C = Q/V = (stored charge)/(applied voltage)

Hold on. You mention two capacitors (or the description is vague enough to be misunderstood). Now I'm not sure about your circuit. Please draw it.

Just so the answers you get, are actually in response to the question you have in your head.

What confuses me is, "before the resistor and after the LED". Where is that?

Normally, if you connect a capacitor to a passive load, it will dump its full charge into the circuit.

The discharge rate depends on the current which depends on the resistance (including the resistance of the LED).

With nothing connected (no current path) the capacitor may hold a charge for several seconds depending on the capacitor value (uF) and it's internal leakage resistance,

If you are connected to an Arduino output that's high and then you write a low, current will flow back-into the Arduino discharging the capacitor faster than if you just disconnect it from the power source.

You can add a diode in series that allows to flow into the capacitor but not back-into the Arduino.

This page shows the capacitor discharge curve. You can see that capacitors make bad "batteries" because they discharge very quickly at first and then the voltage levels-off the more it discharges. An ideal battery holds most of its voltage until it's almost dead and real world batteries are better in this regard than capacitors.

Here ya go. Just one capacitor.
cap

Thanks!

This is a good bit of additional info. Thanks!

Check out the "Leyden Jar". You can pickle electrons!

1 Like

When your DC voltage is applied, the capacitor will charge till the voltage across its pins equals the input voltage. Once you disconnect the power source, it discharges and starts with its voltage (so your 5V) which then drops based on current consumption.

Kind of what @J-M-L said but you asked why all the charge doesn't go into the circuit.

  • "Charge" is supplied at a rate controlled by the load (resistor + LED)
  • If the resistor were removed the capacitor would stay charged indefinitely **
  • If you shorted the capacitor the charge will dissipate very quickly.

So basically the limiting factors are the resistor and LED, which also limits the current draw from your 5V supply.

** not literally but a simplification.

The LED would likely be killed during the charging process.

1 Like

Only if you add a short :slight_smile: But I understand my statement could be misinterpreted.
So to restate:

If the resistor were removed leaving an open circuit, the capacitor would stay charged indefinitely.

1 Like

Right I see what you meant

It's interesting to think about what happens to the discharge of the capacitor as Res approaches 0 and the impedance of the diode increases due to change in Vcap.

No, it can't because there are no perfect insulators. All capacitors, like all batteries have leakage resistance. The air around the capacitor will also discharge a capacitor over time because some water vapor in the air will pick up an electron or will supply an electron to the capacitor terminals.
There are also radiation particles coming from space that will do the same.

So, there is nothing indefinitely, but may be a long time.

so an indefinite long time? :grinning:

Sort of, but not an infinite long time.

Hence my annotation that I'm guessing you didn't read or decided to comment anyway.

** not literally but a simplification.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.