# Discharge risk of an LED fade-in circuit

The simplest incarnation of the fade-in circuit I have planned is

simulate this circuit – Schematic created using CircuitLab

This gets a time constant of ~2.7s before taking into account the dynamic resistance of the amber LED with Vf=2.1V. It's to only fade in once on power-up and doesn't need additional control.

My question is: when the power is turned off and C1 discharges through D1, will I risk damage to the LED?

This graph from the specsheet:

suggests that if the capacitor had charged to 2.1V, on discharge it will momentarily be at the very top of the LED's rated current, 20mA. Adding a resistor inline with C1 would mitigate this risk but may interfere with the fade-in effect, as there would be an initial voltage over the diode at t=0. If I added this second resistor, I guess I could just choose it so that in voltage divider configuration it works out to well below the forward voltage drop of the diode?

• that might be a simple circuit, but the 10 mF make it a hard-to-source-components-for circuit. – Marcus Müller Oct 23 '20 at 20:50
• 10,000uF 6.3V or 10V is a pretty common part. A bit bulky (~7.5 x 16mm) but not rare. – Spehro Pefhany Oct 23 '20 at 21:37
• Have you tried this circuit to see how well it appears to you? I'd almost guess the current would follow an arctan function, or something like that. Might be okay, visually. Not quite, but almost linear in the log domain. With an active device you could use a smaller capacitor, too. – jonk Oct 23 '20 at 22:36
• I've made a circuit almost identical to this and found that an op-amp voltage follower gives a much nicer result, for what it's worth. – vir Oct 23 '20 at 22:59
• @vir do you have an example/reference circuit? – Reinderien Oct 23 '20 at 23:14

## 3 Answers

There is no danger to the LED from removing the voltage source V1 or shorting it to ground. The LED itself limits the voltage across the capacitor, i.e. if it was safe while the voltage source was still connected, it's also at least as safe after it has been disconnected.

However, if you allow C1 to charge up to greater than the LED forward voltage and then connect the LED across it you could quite well damage the LED.

• I'd be more concerned about what happens to the rest of the circuit after power-off. The cap will discharge through the LED, but once the voltage gets to the point where the LED is drawing e.g. microamps, the remaining voltage will flow back across R1 and into the rest of the circuit. At that point, your circuit is not totally "dead" once the power is pulled... – d3jones Oct 24 '20 at 14:27

R1 and C1 to taste. I have no idea what the general consensus is on which opamp is suitable for breadboard/protoboard casual use, but it seems like the consensus is that the 741 belongs in a museum. The MCP601 is a readily-available single-supply rail-to-rail (more on that in a second) opamp that gives 22mA Isc at 5V supply, comes in a DIP-8 package, and costs $0.44, so it seems like a fair starting point. Alternate suggestions, anyone? There is a note in the MCP601 datasheet about non-linearity when the common-mode input voltage rises to within 1.2V of supply voltage. I doubt it will be a dealbreaker for dimming an LED but if it is, you're only out$0.44.

Edit: perhaps the MCP6241?

• It's a good suggestion. Given that the PIC I'm using has an integrated op-amp, I'd probably use that instead. – Reinderien Oct 26 '20 at 16:14
• Also, the MCP6001 would be fine. – Reinderien Oct 26 '20 at 16:20

It is not a good idea to connect two voltage-type elements in parallel (here, a charged capacitor and a diode) since the current will vigorously distribute (steer) between them. In your case, this means a vigorous fade-in.

If you still want to insert a resistor, do it in series with the LED to "soften" its "hard" IV curve. This will make the fade-in smooth.