Or use a real RC circuit, and measure voltage decay with an analogue input.
And drive the LED with corresponding PWM and/or display the graph on the serial plotter.
Leo..
Never connect a capatitor directly to an Arduino I/O pin.
The discussion here about ESR is totally wrong.
In this case, @AlexA is connecting to the 5V pin, not a GPIO pin. And per @Wawa's explanation in Comment #28 and #32, connecting the capacitor there will not harm the Uno (due to the polyfuse)...
Surely, you are indulging in some hyperbole. Not one thing I have said about ESR is valid?
Edit: As far as I can tell, the main error in my analysis is that I didn't account for the fact that ESRs on the order of 0.1 mΩ will be swamped by trace resistance effects, and therefore not contribute significantly to the current estimate.
Other than the fact that a capacitor has ESR, yes.
ESR is almost never specified in a capacitor datasheet but can be computed from tan δ, which is given. No need to make guesses, or assumptions based on ideal components
Should we really depend on trace and polyfuse resistance to not blow up a digital output feeding a large capacitor?
OK, thanks for pointing out an error in my calculation, which I have now fixed. I am more used to doing impedance calculations in the Laplace domain, so I had neglected the phase angles; with the correction, my estimated ESR value increased by about 10% from what I had previously stated.
Using the tan(δ) method specification*, the datasheet specifies a value tan(δ)=0.12+0.02 = 0.14 for a 1000-µF 35-V capacitor at 120 Hz. The ideal capacitor reactance would be (2π×0.001F×120Hz)–1 = 1326 mΩ at this frequency, so the ESR should be 0.14×1326 mΩ = 186 mΩ at 120 Hz.
Yet the datasheet also states that the total impedance is only 15 mΩ when the frequency is 100 kHz. Since the 100-kHz behavior is going to be much more relevant than the 120-Hz performance when it comes to determining the step response (inrush current), I would think that the using the 15-mΩ value would be more accurate than the value based on the tan(δ) method specification*.
*Edit: Revised some apparently distracting word choices.
You and @jim-p are the only ones in this thread suggesting that the capacitor would be connected to a digital output pin.
The tan d is not a method. That is how ESR is specified. Simple as that.
Nevermind the terminology strawmen, let's get to the nitty gritty: if you have two of these Panasonic 1000-µF 35-V capacitors (at 20°C), one at 0 V and the other charged to, say 3 V, what do you think would happen if you join them together? Will the inrush current into the uncharged capacitor be closer to 10 A (based on the tanδ specification) or closer to 100 A (based on the total impedance specification)? Will the equilibration time be closer to 500 µs (based on the tanδ specification) or closer to 50 µs (based on the total impedance specification)?
Capacitor is NOT connected to an I/O pin. Please see photo in post # 9.
Seems pretty unlikely that a 0.5mm wire can do 100A...
For 50 µs? Assuming that you are talking about the capacitor leads (which have a 0.6-mm diameter), it would take about 5 mJ to heat the metal leads by a single degree kelvin (or 1°C). Thus, there would need to be about 100 W of joule heating on average (over the 50-µs charging interval) to heat the leads by 1°C, or 3000 W to raise the temperature by 30°C. So unless the leads have a resistance on the order of hundreds of mΩ, I don't think its "unlikely" that the capacitor leads could carry a 100-A current. The capacitor's datasheet also indicates that inrush currents up to 100 A are possible (it warns against allowing inrush currents greater than 100 A).
Apparently my intuition is wrong...
So, if capacitor inrush currents of up to 100 A are possible, then my Arduino would be up in smoke?? Correct??
Not according to what @Wawa claimed above.
Probably, there's something that will limit the current (which means the voltage will drop until the capacitor charges-up a bit) unless your power supply also has a huge capacitor or unless you are powering it from a car battery.
Usually these very-short bursts of current while a capacitor charges are not problem in the real world.
There is some possibility of frying the voltage regulator.
If you connect the capacitor to your Arduino while it's running the drop in voltage may cause a reset.
With apologies to OP for this off-topic and low-value comment, but I couldn't resist posting the following (based on discussion in another thread):
This thread is getting silly.
Did anyone already mention that there is a 47uF cap on the 5volt rail of an Uno R3.
I still don't see a reason for OP's circuit.
If you would want to light a LED for a long time with a cap, then a supercap (Farads) would make more sense. You would always limit charge current for this type/size cap (diagram post#27).
Leo..
Just for a sec or two, MAX

