Electromagnetic compatibility (EMC) means that a device does not emit electromagnetic noise into its surroundings above acceptable limits (emissions) and that it can operate without being affected by the noise around it (immunity). For electronic products sold on the European market, it is part of CE marking and is tested under the EMC Directive.
Fixing EMC after the fact is expensive: it takes extra filters, ferrites, shields and often a new PCB revision. Yet most of the noise can be prevented from the start by following a few basic rules during layout.
1. Every Signal Has a Return Path
Current always flows in a loop: wherever it goes, it somehow finds its way back to its source. At high frequencies, the return current flows in the reference plane directly beneath the signal trace, following the path of lowest impedance. That is why there must be a continuous ground plane under fast signals. A slot or void in the plane forces the return current to take a detour; the loop grows and emissions increase.
2. Keep Current Loops Small
The noise a loop radiates increases with the loop area and with how fast the current changes. Placing the source and the load close together and keeping the signal path and the return path close to each other reduces the loop area. This rule reduces both emissions and noise pickup from outside.
3. Minimize the "Hot Loop" in the Switching Power Stage
In switching regulators such as a buck converter, the most critical area is the loop between the input capacitor and the switching devices. The current in this loop changes very quickly, making it one of the strongest noise sources on the board.
- Place the input capacitors right next to the switching devices, with the shortest possible connections.
- Make the copper area of the switch node (SW) large enough to carry the current, but no larger than necessary.
- Route the feedback trace away from the inductor and the switch node.
- Start from the example layout recommended by the regulator manufacturer; these recommendations are usually layouts that have been measured and proven.
4. Place Decoupling Capacitors Correctly
Decoupling capacitors supply the instantaneous current demand of ICs locally. To be effective, they must be placed as close as possible to the supply pin, and their ground connection must go directly to the ground plane through a short via. A long, thin connection narrows the frequency range over which the capacitor is effective. Typically, a 100 nF capacitor is used on each supply pin, plus one or more larger-value capacitors on each supply rail.
5. Choose the Layer Stackup with EMC in Mind
As the layer count goes up, it becomes easier to place a reference plane right next to each signal layer. On a four-layer board, a stackup of signal, ground, power and signal layers is a common and solid starting point. On two-layer boards, one side should be devoted to a ground pour that is as continuous as possible, and traces should be planned so that they don't break up this plane. The right layer count is determined by weighing circuit density, speed and cost together.
6. Cables Are Antennas: Filter at the Connectors
Every cable leaving the board is an antenna that can both radiate and pick up noise. Noise has to be stopped before it reaches the cable connector:
- Add a ferrite, an RC filter or a common-mode choke to communication and power lines at the connector entry.
- For ESD and voltage transients, place TVS diodes right next to the connector, with a short ground connection.
- Keep fast signals and clock lines away from connectors and the board edge.
7. Slow Down Clocks and Fast Signals
The frequency content of the noise is determined more by the edge rate than by the signal frequency. Edges that are faster than necessary generate high-frequency harmonics.
- Place the crystal right next to the microcontroller, keep its traces short and don't route other signals underneath it.
- Soften the edges by adding 22–33 Ω series resistors to fast outputs.
- Keep the pin speed on the microcontroller (the GPIO speed setting on STM32) at the lowest setting that does the job.
8. Separate Analog and Digital Sections by Placement
Splitting the ground plane into analog and digital sections often creates new return-path problems instead of solving the problem. The safer approach is to use a single, continuous ground plane and separate the sections by placement: group sensitive analog circuits in one area and noisy digital and power circuits in another, and don't route fast signals between them.
9. Remove Floating Copper and Stitch Grounds Together
Floating copper islands that are not connected to ground can act as antennas; they should either be removed or connected to ground. Ground areas on different layers should be tied together with closely spaced vias, especially along the board edges and near the points where fast signals change layers.
10. Measure Early: Pre-compliance Testing
Simple measurements made before lab testing greatly reduce surprises. Noise sources on the board can be located with near-field probes and a spectrum analyzer, while noise radiated from cables can be measured with a common-mode current probe. A problem found at the prototype stage is much cheaper to fix than one found at the product stage.
EMC Checklist
- Is there a continuous reference plane under fast signals?
- Is the input loop of the switching power stage as small as possible?
- Are the decoupling capacitors close to the pins and connected directly to the plane?
- Do the connectors have filtering and ESD protection?
- Are the crystal and clock lines short and well protected?
- Are there any floating copper areas or split planes?
Conclusion
EMC is not a feature added at the end of the design; it is the result of decisions made from the first day of layout. These rules won't solve every problem on their own, but they prevent most problems before you ever get to the lab.
In our electronics and PCB design projects, we treat EMC as part of the layout from the very beginning. If you already have a finished design, we can go over the risks together in a design review before it goes to production.