Decoupling capacitors

Thread Starter

cmartinez

Joined Jan 17, 2007
8,762
Normally, I use decoupling 0.1 µF capacitors (X7R, SMT type) between the Vcc pin and ground for all of the chips in my 5V digital circuits.
Would using 0.2 µF caps provide even better protection against glitches caused by instabilities in the Vcc line? Or would it be overkill?
For example, I'm under the impression that a standard 2.2 µF electrolytic paired with a 0.1 µF X7R is good protection. But is using a 4.7 µF electrolytic with a 0.2 µF X7R even better?
 

crutschow

Joined Mar 14, 2008
38,506
Actually it may be worse since larger capacitors tend to have higher stray inductance. It's the parasitic inductance that generally limits the high frequency attenuation of the capacitor.
For that reason sometimes a 0.01 µF capacitor works better for decoupling high frequency noise than a 0.1 µF one.
You can go to the capacitor data sheets and look for the impedance versus frequency of the different values to see this effect.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,762
Actually it may be worse since larger capacitors tend to have higher stray inductance. It's the parasitic inductance that generally limits the high frequency attenuation of the capacitor.
For that reason sometimes a 0.01 µF capacitor works better for decoupling high frequency noise than a 0.1 µF one.
You can go to the capacitor data sheets and look for the impedance versus frequency of the different values to see this effect.
I knew that the question sounded kind of stupid when I posted it, but I just had to make sure... and it's paid off, thanks to you.
 

OBW0549

Joined Mar 2, 2015
3,566
Would using 0.2 µF caps provide even better protection against glitches caused by instabilities in the Vcc line? Or would it be overkill?
Neither; a 0.2uF capacitor might not even be as good as 0.1uF or 0.047uF, because of its high-frequency characteristics. Besides, taking care of "instabilities in the Vcc line" is properly a job for one or more bulk storage capacitors-- for me, typically, that would be aluminum electrolytics in the range of 10uF-100uF.

For example, I'm under the impression that a standard 2.2 µF electrolytic paired with a 0.1 µF X7R is good protection. But is using a 4.7 µF electrolytic with a 0.2 µF X7R even better?
I doubt it.

My general rule of thumb is for CMOS logic, one 0.1uF X7R per chip; for medium-speed opamps, one or 2 0.1uF or 0.047uf X7R's per chip (depending on whether the chip is operated off a single supply or dual supplies); for high-speed opamps, a 0.1uF X7R in parallel with a 0.01uF X7R; and for all others, capacitance according to the device data sheet recommendations.

But bigger capacitors are NOT always better, because bigger capacitors are likely to have more effective series inductance.
 

dl324

Joined Mar 30, 2015
18,326
For example, I'm under the impression that a standard 2.2 µF electrolytic paired with a 0.1 µF X7R is good protection. But is using a 4.7 µF electrolytic with a 0.2 µF X7R even better?
A larger electrolytic may help because it's also a smoothing capacitor. But the value for high frequency decoupling depends on the frequencies you're trying to decouple.
 

alfacliff

Joined Dec 13, 2013
2,458
a too large value of capacitance will cause more surge current on power up. remember all the decoupling caps are in paralell, and have to be charged up on power on.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,762
Let me be more specific then. I built this circuit that switches a solenoid valve on and off every 25 ms. The solenoid is switched on for the first 0.5 ms using 120VDC pulses (around 14 Khz) controlled by a FET. After that, it stays on for about 7 more ms powered by 12VDC and then it shuts down.

So I have three voltage levels in this circuit, that is 12, 5 and 120VDC. The primary source is 12VDC, the 5V is produced by a 7805 regulator, and the 120VDC by a switch mode power supply being fed by the 12VDC source.

When I turned the circuit on, the MCU (an AT89LP4052) would reset itself constantly every time it tried to switch the valve on. And it wasn't until I placed real heavy caps (100 µF) at both the input and output pins of the 7805 that things began to improve. They finally stabilized when I placed a 10 µF electrolytic paired with a 0.2 µF X7R at the MCU's Vcc pin and ground.

My fear is that later on as I start interfacing more things to the circuit, the MCU's input pins might be affected by this noise too.
Is there a better way to protect the digital side of this circuit other than the decoupling capacitors I just mentioned?
 

OBW0549

Joined Mar 2, 2015
3,566
Is there a better way to protect the digital side of this circuit other than the decoupling capacitors I just mentioned?
No wonder you asked about decoupling caps... yowza!!

Yes, I can think of several things.
  • Even bigger caps, like 220uF or even 470uF, fore and aft of the 7805;
  • A filter choke, like a couple of hundred microhenries, ahead of the 7805 input and its filter cap;
  • A separate choke + filter cap ahead of your 120VDC switching regulator, to isolate it from the +12V going to the 7805;
  • Very, VERY careful attention to ground topology, so that the switched currents from your solenoid don't pass through (or even near) the grounds of your digital logic; and
  • Keep all connections to your solenoid as tight as possible to avoid forming a large-area current loop on the board which could inductively couple to your digital logic.
If anything else comes to mind, I'll post it...
 

JohnInTX

Joined Jun 26, 2012
4,787
First, I'd be sure that you aren't getting noise into the RST input. Temporarily strap it to the power supply pin (depending on whether its active high or low) then try your test.

The big caps on the 7805 may help any droop but be sure your power/ground paths are separate i.e. don't share uC power wires with big loads. Run power/GND for each on separate wires to the regulator with heavy decoupling there.

FWIW, an old Intel Apnote decscribed decoupling cap selection. Small, high freq caps e.g. ceramics close to the power pins of the logic with low-inductance wiring to provide a local source of switching current. Bigger tantalum caps nearby to recharge the small decoupling caps and a large Al electrolytic near the power input to provide a local supply downstream of power supply wiring etc. The types and values are somewhat dependent on what the demands of the device(s) are but .1 ceramic || 1uF tant is my starting point for all power pins.

I did a lot of PIC work for a process analyzer with lots of 24bit ADC's sharing the board with 5V PICs. The engineers used spectrum analysis to select the types and values of the decouplers - 8 caps of various types and values on each power pin. It was quiet enough to get a genuine 24bits of data out of it.

Good luck!

EDIT: OBW got in under me - you can reduce the effects of magnetic coupling by twisting the coil wires.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,762
  • Even bigger caps, like 220uF or even 470uF, fore and aft of the 7805;
  • A filter choke, like a couple of hundred microhenries, ahead of the 7805 input and its filter cap;
  • A separate choke + filter cap ahead of your 120VDC switching regulator, to isolate it from the +12V going to the 7805;
  • Very, VERY careful attention to ground topology, so that the switched currents from your solenoid don't pass through (or even near) the grounds of your digital logic; and
Thanks! it's good to know that bigger is better, at least in this case. I hadn't considered the chokes. Would you please clarify what you mean with the word ahead? Native spanish people like me tend to interpret things backwards sometimes when they're described in a foreign language.

First, I'd be sure that you aren't getting noise into the RST input. Temporarily strap it to the power supply pin (depending on whether its active high or low) then try your test.
Actually, the AT89LP4052 reset pin works at logic high. But that pin's already taken care of, by it being tied to ground through an 8k2 resistor, and decoupled to Vcc with a 10 µF cap.

EDIT: OBW got in under me - you can reduce the effects of magnetic coupling by twisting the coil wires.
Twisted pair cabling to the solenoid, and from the 120VDC power supply is something that I hand'n considered. Thanks for mentioning it.
 
Last edited:

OBW0549

Joined Mar 2, 2015
3,566
Thanks! it's good to know that bigger is better, at least in this case. I hadn't considered the chokes. Would you please clarify what you mean with the word ahead? Native spanish people like me tend to interpret things backwards sometimes when they're described in a foreign language.
"Ahead of" = "at the input to", or "between the +12V source and the input to"
 

JohnInTX

Joined Jun 26, 2012
4,787
Actually, the AT89LP4052 reset pin works at logic high. But that pin's already taken care of, by it being tied to ground through an 8k2 resistor, and decoupled to Vcc with a 10 µF cap.
I would tie it to GND as a test. PICs used to be very sensitive on MCLR/, even with an RC attached. uCHIP eventually put in a digital delay on MCLR which helped. Don't know about the AT.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,762
Couple of hundred microhenries, not a couple hundred millihenries. The value was meant as a minimum, so what you have available there (20 mH) will probably do the trick nicely.
:eek: I wasn't paying attention to the M vs m thingy here... but hey... what's three orders of magnitude among friends? :D

So I'll place that choke between the 12VDC power source and the 120VDC PSU, plus a filter cap between the choke and the 120VDC PSU, or a filter cap between the 12VDC source and the choke, or both? or there would be no difference as to which side I mount them on?
I have a few 1000 µF @ 63V electrolytic caps laying around... would that do the trick?
 

OBW0549

Joined Mar 2, 2015
3,566
Connect the choke between the 12VDC source and the input to your 120V switcher, and your filter cap between the switcher input and ground. 1000μF should be more than enough...
 

ronv

Joined Nov 12, 2008
3,770
@cmartinez
I have another 2 cents worth of ideas.
There are a few things that are just good to do. For example you don't want the high current passing thru the 12 volts or ground for the logic. So the old star ground thing applies.
Since everything is "made" from the +12 and power supply decoupling seems to fix it one thing to look at is the distance of the 12 volt supply from the board. Twisting these wires will help reduce the inductance in those lines. Also a "big cap right at the board. I'm not so sure about the inductor as now the decoupling caps on the 12 volts have to supply the current for a while.
The 120 volts flying around at 14Khz could easily couple into logic signals if their lines are close.
I think you have a scope so it might be useful to see what part of the cycle the noise is getting in. It's probably still around even when it's working. Might be able to fix it at it's source if we knew what it was.
 

shortbus

Joined Sep 30, 2009
10,050
I know ceramic caps are cheap and that you guy's all say one for each chip, but the TTL and CMOS cookbooks recommend one cap for every six chips. Is there a reason why there is such a discrepancy?
 
Top