How do I make an LED fade in and out with just a capacitor and resistors?

Nov 20, 2026 Last reply: 20 hours ago 4 Replies

First reply

dan.quinn

I've built a few of these breathing LED circuits the lazy way, and the short answer is yes, you need separate charge and discharge paths, and a single diode gets you there. Charge the cap through resistor A, and put a diode in parallel with a second resistor B so that the…

Read the full reply

So I've got this little project where I want an LED to slowly glow up and then slowly dim back down, over and over. I know the usual way is a microcontroller or one of those 555 chips doing PWM, but I was hoping to keep it dead simple with just resistors and a capacitor charging and discharging. Feels like it shold work in theory? The problem I'm running into is that when I breadboard it, the fade-in looks okay but the fade-out is way faster than the fade-in, or the LED just sort of blinks on instead of smoothly ramping. I'm guessing it has something to do with the capacitor charging through one path and discharging through another, but I can't quite wrap my head around how to make the two directions match. Do I need two separate resistors, one for charge and one for discharge? Or is there some trick with where the LED sits in the circuit? Also not sure what value capacitor to even start with. I've got a bag of assorted electrolytics and some ceramics lying around but no scope, just a multimeter, so I'm mostly eyeballing it. If anyone has a simple circuit that does this symmetric fade thing without any chips, I'd love to hear how you wired it up.


I've built a few of these breathing LED circuits the lazy way, and the short answer is yes, you need separate charge and discharge paths, and a single diode gets you there. Charge the cap through resistor A, and put a diode in parallel with a second resistor B so that the discharge current skips the first resistor and flows through B instead. If both resistors are the same value, the two ramps will match closely enough that you won't see the difference by eye. Flip the diode around and you can make one side longer than the other if you ever want a slow rise and quick blink instead. But there's a second problem in your setup that the diode trick won't fix, and it's probably why the fade-out looks so snappy. An LED only starts glowing once the voltage across it gets past roughly two volts, and after that the brightness tracks current, not voltage. So as your cap drains, the LED holds nearly full brightness for a while and then just dies once the voltage falls under that threshold. That's the blink-on behavior you're seeing. Fading by dumping a cap straight through the LED only really works on the way down, and even then it's abrupt at the end.

The fix that made mine behave was putting a transistor between the cap and the LED. Let the cap swing all the way from supply down to zero while the transistor translates that into LED current. Now the whole ramp is visible instead of just the top sliver of it. A small MOSFET works too and barely loads the cap. For values, start with a 100k resistor feeding a 100uF electrolytic, which gives a time constant of about ten seconds, then work down from there. 47k with 47uF is a nice breathing pace. Ceramics that big are rare, so the electrolytics are the right pick. Without a scope, just count seconds and swap resistors until it looks right, that's honestly all I ever did.

One more angle if you get hooked: a relaxation oscillator naturally makes a triangle-shaped ramp between two thresholds, and you can shape that into whatever fade pattern you want later. But for a pure no-chips build, the two-resistor-plus-diode version above will get you a proper symmetric glow.

I have to push back on the 100uF electrolytic suggestion though. Electrolytics have horribly loose tolerance, sometimes 20 percent either way, plus leakage current that varies with temperature, so two caps from the same bag can fade at noticeably different speeds. That makes the 'swap resistors and eyeball it' method even more guesswork than it needs to be. When I tried a similar cap-and-transistor setup I found the leakage alone gave me a dim glow that never fully went out. A regular ceramic at a smaller value with a bigger resistor gets you the same time constant and way more predictable results, if you can find one in the drawer.

This takes me back to doing the same thing with a neon bulb flasher circuit in the 80s, same cap charging idea. One thing I found handy with no scope: put your multimeter on the cap and watch the voltage climb and fall while timing it with your watch. If the upswing and downswing take about the same number of seconds, your two paths are matched. Also, breadboard contact resistance can sneak into these slow circuits and throw things off, so don't chase weird behavior untill you've pressed the leads in firm. I ended up soldering mine onto a scrap of perfboard once it behaved.

One thing I'd add about the capacitor itself: if you go with an electrolytic, watch the polarity. The cap needs to charge with its positive leg toward whatever's feeding it, because putting reverse voltage on an electrolytic even briefly can degrade it over time, and in a breadboard setup where you're re-wiring things constantly it's easy to get the legs swapped without noticing. I did that once on a similar build and the cap slowly turned leaky, which made my fade-out weirdly sluggish and I chased the wrong resistor for an afternoon before I figured out what was actually going on. Worth double-checking before you swap values around.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required