The 0.1uF filter capacitor – A Tradition or a Wise Choice?
If you have ever examined a PCB, specifically those containing a switch mode converter, you must have noticed multiple 0.1uF capacitors present all over the PCB.

When consulting the designer about how did they arrive at the 0.1uF value, the answer is often “This is the traditionally used value”. Sometimes, the 0.1uF caps are connected in parallel to a larger capacitor, 1uF or even 10uF. At first glance this may seem strange, how much can the 0.1uF cap add to 10uF cap? And, again, when asking designers what is the purpose of the parallel 0.1uF caps, you come across variety of reasons ranging from “It is customary to do so” to “the 0.1uF cap filters the high frequency while the 10uF cap filters the low frequency”. It thus appears to me, that in many cases the 0.1uF value is chosen by tradition rather than by an engineering design solution, based on the required ripple and power loss of the cap in the given application. To me, it seems impossible that for the millions, if not billions of circuits that require capacitor filters, the 0.1uF capacitor is exactly the correct value. Why not 0.6uF or 1.2uF? I think the reason is that we feel more comfortable with rounded off numbers. I would dare to guess that the number of 0.1uF capacitors sold worldwide is at least an order of magnitude larger than the number of, say, 0.15uF capacitors sold. On top of that, there is of course no engineering reason for that. The probability that most circuits require exactly a 0.1uF capacitor is clearly zero.
So, what happens if a 0.1uF cap is chosen “by tradition”. Well, if it is too large for the application then the circuit will probably work OK but the Bill Of Materials will become more expensive due to the larger than needed capacitors. If, however, the cap is too small, then either this will be caught in final testing or when the products are being returned due to malfunctioning. In either way selecting a component by tradition rather by the design is costly.
We often forget how unstable input voltages can be, despite how sturdy that power supply might look. And when dealing with microcontrollers, the slightest fluctuation in voltage can lead to disastrous results. So what can we do to keep our ICs running with smooth, clean voltage? Use decoupling capacitors!

What Are Decoupling Capacitors?
A decoupling capacitor or a bypass capacitor, behaves like an energy reservoir. When fully charged at steady state, it just has to oppose any abrupt change in the input voltages. It can help you in 2 ways: If there is a slight drop in the input voltage, then a bypass capacitor will provide enough power to an IC to maintain stable voltage. If there is a voltage spike, then a decoupling capacitor will absorb the excess energy trying to flow through to the IC, which again maintains a stable voltage. In a DC circuit, a capacitor acts as an open circuit so there is no problem with shorting there. As your device is powered up (VCC=5V), the capacitor is charged to capacity and waits until there is a change in the voltage between VCC(=4.5V) and GND. At this point, the capacitor will discharge to try to bring the voltage back to the level of charge inside the capacitor (5V). This is called "smoothing" because the change in voltage will be less pronounced.
Ultimately, the voltage will not ever return to 5V through a capacitor, rather the capacitor will discharge until the charge inside it is equal to the supply voltage to attain equilibrium. A similar mechanism is responsible for smoothing if VCC increases too far beyond its average (VCC=5.5V).
Circuit assembly:

Here we have a 10uF capacitor placed far away from the IC, which helps to smooth out any low frequency changes in the input voltage. And there is the 0.1uF capacitor placed closest to the IC to smooth out the high frequency noise in the circuit. On combining these together, we get a smooth, uninterrupted voltage to IC to work with. When working with decoupling capacitors one should keep these three things in mind:
Placement: You always connect decoupling capacitors between your power source, whether its a 5V or 3.3V, and Ground.
Distance: You always place decoupling capacitors as close as possible to your IC. The farther away they are, the less effective they’ll be.
Ratings: As a general guideline of IEEE, it is recommend adding a 100nF ceramic capacitor and a larger 0.1-10uF electrolytic capacitor for each integrated circuit on the board.
By using decoupling capacitors next to your ICs, you’ll ensure that they’re always getting a smooth input voltage, regardless of what kind of electrical noise is on your PCB.