Hello,
I’m making Arduino based data logger board and designing PCB in KiCad, everything routed but I realized some decoupling caps are bit far from the IC pins because of routing space.
Now I’m wondering if this is bad practice like some caps are maybe 1.5–2cm away from microcontroller VCC pin..
Should I reroute whole board to place caps closer?? or is this distance acceptable?..
Also do decoupling caps need direct via to ground plane or can share ground trace??
Also do decoupling caps need direct via to ground plane or can share ground trace??
What do you mean by "share a ground trace"? Maybe an image of your circuit board might help. A long and shared narrow connection to ground can have resistance and induction issues and components sharing that "trace" might interact because of that. When I look at commercial boards they all seem to have wide traces and a big area where the components are essentially connected to the same point in terms of resistance and induction effects. They are double sided boards so plenty of room for a large ground area.
I remember when learning and experimenting with the first digital ICs that it was important to have lots of decoupling capacitors to make sure there was no interference between components. I did a quick search and see the topic is covered online and how to take it into account when designing with KiCad.
In the image below you can see the wide area of shared ground of this motor encoder PCB from which I removed the slotted wheel and motor to trace the at the time unknown connections.
Hi @eva_402,
@robotbuilder has provided some useful guidance, to which I would like to add a few details.
---------
'Acceptable trace length' tends to depend on the speed, and hence the technology of the chip. Many chips have transitions in the MHZ region, whilst others achieve frequencies in to the GHz region. At these frequencies, even short lengths of wire or PCB trace have enough inductance to create a significant reactance. At the higher frequencies in this range, even 1 millimetre of wire/trace can be too much. Lower frequencies are more tolerant, but even a few millimetres is significant for many common logic devices.
Over simplifying, at these frequencies, even a short wire behaves more like a substantial resistance, reducing the ability of the capacitor to perform its intended function. This applies to both of the connections to the capacitor. Hence, particularly for higher frequency devices, it is good practice to connect the capacitor to the integrated circuit with as short a wire as possible, and similarly for the other capacitor lead to the main 'ground'.
Hence, it is generally good practice to have a ground plane, with decoupling capacitors connected directly to the plane and the integrated circuit.
This does not mean every circuit will fail if you do not follow this practice, but it considerably increases the chances of problems occurring. For example, with logic/computing circuits, it may produce a system which intermittently crashes or fails.
Sharing a ground trace further complicates the situation, since it can have the effect of conducting signals from one part of the circuit to another, also causing circuits to misbehave.
Yeah, both points above are spot on. In general, 1.5–2 cm is definitely on the longer side for decoupling caps, especially for MCUs. It might still work, but you’re reducing how effective the capacitor is at handling fast transients. Read this guide on decoupling caps: https://learn.sparkfun.com/tutorials/capacitors/application-examples If possible, I’d try to reroute at least the critical ones (main VCC pins) closer, even if the layout gets a bit tighter.
For ground, it’s better to avoid long shared thin traces. Ideally, connect the cap directly to a ground plane with a via close to the pad, so the loop area is as small as possible. Sharing a long trace can introduce impedance and couple noise between parts of the circuit. I would recommend you t use seperate GND and power planes, though its a bit lengthy but makes it pro level .... read this guide to understadn planes: https://www.pcbway.com/blog/PCB_Design_Layout/Power_and_Ground_Plane_Design_Considerations_in_PCB_Layout_862aaa8c.html
