Which bypass cap to use?

Hi, I am nearly ready to make my "real" first project but when finishing "easy stuff" I noticed (power supply) bypass capacitors. On Google I have found many articles describing how they work and why they are needed. But I don't know: which one to use? Some someone doesn't address the question at all, someone says 0.1 uF ceramic. So my questions are:

How I decide which cap to use? Is it needed at all (never encountered a problem with stand alone chip without the cap). Is ANY 0.1 uF ceramic good in most of applications at 1-20 MHz speeds? Is 0.1 uF good value for such applications or I should use larger when switching "load" (such as LEDs)?

My "project" will be ATTiny sending Ir commands (38 kHz carrier frequency, around 10mA ON current) in 0.1 sec intervals powered by 2 NiMH AAAs directly connected to the MCU (so supply power 2-3V).

Thanks for answers/link to an article addressing this issue.

A bypass capacitor has 2(or many more!) possible purposes :

it reduces the effect of pulses on the supply when digital devices switch which could cause noise . For this small caps such as 0.1uF are generally used.

it reduces the effect of suddenly switching on large loads = eg motors, big LED’s etc. For this much larger values are used - 10’s to 1000’s of uF. Electrolytic or tantalum( smaller and better, but much more expensive)

Also some devices eg regulators need capacitors to ensure stabilty - see the data sheets.

Often combinations are used.

I’m sure my fellow arduinos will pile in with 100’s more ideas and suggestions, but it’s a start!

regards

Allan

Dave Jones made an excellent video explaining the different purposes of a bypassing capacitor, and why they use multiple values and types.

I know basics and hate "educational videos". They are basicly so boring because you cannot quickly skip known basics and in fact they rarely go deeper. Do you have a link to some text instead? I don't have an oscilloscope and I have no idea if I can measure noise on supply lines without it. Since the MCU seems working flawlessly without the filtering cap I cannot try some and watch the improvement. So I have no clue which cap to choose. I know that large caps have high parasitic inductance and resistance so they cannot filter high frequencies. On the other hand small cap cannot filter large spikes because it cannot store enough energy. But I don't know how I can calculate (guess) if the cap is large/fast enough. There are different types of (ceramic) caps. Does it matter which one I choose? I have read capacity of some ceramic caps decreases a lot under DC voltage. Is it possible to determine it from the cap name/markings? Neither eBay not our local store has useful datasheets in this matter.

What he says in the video is basically that a capacitor is not ideal (it has a series resistance and inductance) and you want the least amount of impedance. (To output the maximum amount of power when necessary) The impedance, however, depends on a lot of factors: switching frequency, current draw, type of capacitor, capacity, wire length, inductance of the PCB traces, even package size of the cap itself, can change the frequency at which this impedance is at its lowest.

To have a wider range of frequencies at which your bypassing is effective, you can add multiple in parallel. However, he shows that in practice, it is sometimes better to use only 1 or 2 caps, instead of 3 or more, in other cases, 3 or more different values are desired.

So in conclusion, unless you are designing a professional product, don't worry too much about it, just make sure you have some ceramic cap for the higher frequencies (10-100nF seems fairly common), and a larger electrolytic one for sudden peaks of load current (10-2200µF, depending on how much current you expect it to draw).

PieterP: The impedance, however, depends on a lot of factors: switching frequency, current draw, type of capacitor, capacity, wire length, inductance of the PCB traces, even package size of the cap itself, can change the frequency at which this impedance is at its lowest. ... So in conclusion, unless you are designing a professional product, don't worry too much about it...

It is what puzzles me. For me it looks like there is nearly unlimited amount of combinations of capacity/material. It must be a miracle if a randomly chosen cap is the right one for given application. Is there at least some rule of thumb? Is there a way other than oscilloscope that can make power supply noise "visible"? I would like to compare the effect of different caps and their combinations on the noise. How professionals determine right cap specs?

Provided I have only one IC (the MCU) why should I be afraid of the supply noise after all? It may disturb ADC. It may cause supply voltage leave specs if voltage is too close to borders. Provided I will stop CPU and other peripherals while doing conversion and the supply will have safety margin is there a risk anyway?

The adrduino boards have both regulators and decoupling capacitors, and are a fairly robust.

Don't worry too much - build something and try it!

regards

Allan

I am proto-prototyping via Arduino. But for "final product" I want to use standalone ATTiny powerd from 2 AAAs - no regulators and similar stuff to save current, space, cost, work. So far I am building on solderless breadboard and I have no problem even without any caps (but solderless breadboard have relatively large parasite capacitance). For future possibly larger projects I am afraid proper power filtering will be needed. So I would like to learn it and gain "good habits" while it is small and easy.

The Digispark (small ATtiny85 board) uses a 100nF and a 4.7µF capacitor in parallel. That should do the job, again, it's not that critical: ATtinies are fairly stable, use relatively low frequencies and do not have to switch heavy loads.

I can only encourage that "good habbits" thing you mentioned, however, this one is just really difficult (read: impossible) for a hobbyist to measure.

Pieter

Smajdalf: I know basics and hate "educational videos". They are basicly so boring because you cannot quickly skip known basics and in fact they rarely go deeper.

Dave Jones' videos are never boring! (Well, perhaps if you compare him to Colin Furze you could make the point)

MarkT: Dave Jones' videos are never boring! (Well, perhaps if you compare him to Colin Furze you could make the point)

Hmmm, I don't think Colin bothers to use bypass caps in his projects ... ;)

Smajdalf: (never encountered a problem with stand alone chip without the cap)

Specious reasoning. You and Homer.

This may help... https://www.baldengineer.com/a-1uf-decoupling-capacitor-is-too-much.html