Electrical – Do I need decoupling capacitors when I’m PWMing an LED

capacitordecoupling-capacitorhobbyistpcb-designpwm

I'm a hobbyist (well, less than a hobbyist really) trying to layout my first PCB design. I'm somewhat familiar with the concept of decoupling capacitors. I'm fading 3 LEDs in and out (really, it's an RGB LED and I'm trying to create blended colors). I'm using ATTiny's PWM pins to accomplish this.

I'm planning to add a 100nF ceramic disk capacitor between the VCC and GND on the IC, but I'm not sure if I also need to decouple the LED signals. If so, do I put them close to the LED or close to the IC? What size caps do I use?

Best Answer

Just a warning about putting large capacitors on MCU output pins.

Modern FETs can be laid out very compactly while providing 100mA output pin drives, and the thermal time constant is very fast (about 10 nanoseconds) because of shallow channels. The 3_D silicon size (volume) provides little ability to store heat, to the point of over 1,000 degree Centigrade heating per microsecond of short-circuit (driving a large capacitors) operation.

Large capacitors will be way too slow to charge and discharge, causing the FETs to operating in HIGH_CURRENT and HIGH_VOLTAGE modes simultaneously, melting the FETs.

How large a capacitor is dangerous? If the capacitor cannot be charged to 90% of final value (2 timeconstants) in 100 nanoseconds, then rethink your values or circuits.

1uF and 1 amp will charge the capacitor voltage by 1 volt per 1 microsecond.

0.1uF and 0.1 amp will charge the capacitor voltage by 1 volt per 1uS.

0.01uF and 0.1 amp will charge the capacitor voltage by 1 volt in 0.1uS. This begins to be safe.

Thus I suggest you not use more than 1,000pF (1nF) on MCU outputs.