Home Wiki Electricity & Electrons PCB Layout Rules: Routing, Grounding, and Electromagnetic Interference
Electricity & Electrons

PCB Layout Rules: Routing, Grounding, and Electromagnetic Interference

Trace Width and Current Carrying Capacity

One of the most important decisions in PCB design is choosing trace widths. A trace that is too thin for the current it carries will heat up and fail. In industrial environments where currents can reach several amperes, this decision is critical.

The basic rule for calculating trace width: The required width depends on three factors: the current flowing through the trace, the copper layer thickness, and the allowable temperature rise. Use KiCad's built-in calculator or IPC-2221 formulas for accurate calculations.

Common values in industrial design:

  • Digital signals (mA range): 0.2mm - 0.3mm
  • I2C and SPI data lines: 0.25mm
  • Microcontroller power supply (up to 500mA): 0.5mm
  • Sensor power supply (up to 1A): 0.8mm - 1.0mm
  • Motor drive lines (up to 5A): 2.0mm or more
  • Main power lines (10A+): Use copper pours instead of traces

Practical tip: On industrial boards, use wider traces than theoretical calculations require. A safety margin is essential in environments subject to vibration and heat.

Trace spacing (Clearance):

  • Between signal traces: 0.2mm minimum
  • Between power traces: 0.3mm or more
  • Between high-voltage traces (24V+): 0.5mm or more depending on standards
  • Ensure the manufacturer supports the minimum clearance you have chosen

Ground Planes

A Ground Plane is a full or near-full copper layer connected to the GND net. Its presence drastically improves board performance.

Benefits of a Ground Plane:

  • Provides a low-impedance return path for all signals.
  • Acts as a shield against electromagnetic interference.
  • Improves heat distribution across the board.
  • Reduces noise in analog signals.

Implementation on a two-layer board:

  • Dedicate the bottom layer (B.Cu) as a continuous ground plane.
  • Route traces on the top layer (F.Cu) as much as possible.
  • When using vias, ensure they do not split the ground plane in a way that blocks current return paths.

On a four-layer board:

  • Layer 1: Signals and components
  • Layer 2: Ground (complete Ground Plane)
  • Layer 3: Power (Power Plane)
  • Layer 4: Signals and components

This stack-up is the gold standard for industrial design.

Separating Analog and Digital Signals

Industrial boards often combine analog sensors (4-20mA, 0-10V) alongside digital controllers. Mixing the two types causes noise that affects measurement accuracy.

Separation principles:

  • Physical separation: Place analog components on one side and digital components on the other side of the board.
  • Ground separation: Use separate ground regions (AGND and DGND) that meet at a single point near the microcontroller.
  • Power separation: Feed analog circuits from a separate regulator with additional filtering.
  • Signal guarding: Surround sensitive analog traces with ground traces on both sides (Guard Traces).

Practical example: A 4-20mA pressure sensor reading module with an STM32 controller. The analog-to-digital converter (ADC) sits at the boundary between both regions, with RC filters on its analog inputs.

Electromagnetic Compatibility (EMC)

Electromagnetic Compatibility means your board does not interfere with nearby equipment and is not affected by external interference. In factories, this is vital because motors and transformers generate strong electromagnetic noise.

Basic EMC rules in layout:

  • Keep signal loop areas as small as possible. Every loop acts as an antenna.
  • Do not route fast signal traces along the board edge.
  • Add filters on all incoming and outgoing cables.
  • Use shielded connectors for external communications.

Common EMC components:

  • Ferrite Beads: Block high-frequency noise on power lines.
  • Feedthrough Capacitors: Filter signals at the board boundary.
  • Common Mode Chokes: For differential communication lines such as RS-485 and CAN Bus.

EMC testing: Industrial boards need to pass standards such as EN 61000-6-2 (industrial immunity) and EN 61000-6-4 (industrial emissions).

Decoupling Capacitors: Protecting Every IC

A decoupling capacitor is a small capacitor (typically 100nF ceramic) placed between the power pin (VCC) and the ground pin (GND) of every integrated circuit.

Why is it necessary? When an IC operates, it draws rapid current pulses from the power line. Without a nearby capacitor, these pulses cause momentary voltage drops and noise that propagates to the rest of the circuit.

Rules for placing decoupling capacitors:

  • At least one 100nF capacitor for every VCC pin on each IC.
  • Place it as close as possible to the power pins, no more than 5mm away.
  • Connect it to the ground plane via a nearby via.
  • For microcontrollers, add an additional 10uF capacitor near the component.
  • For voltage regulators, follow the datasheet capacitor values precisely.

Common mistake: Placing decoupling capacitors far from the IC or routing them through long traces. A long trace adds inductance that negates the benefit of the capacitor.

Practical Example: Layout for an STM32 Board With Sensors

Let us apply all the previous rules to an industrial control board:

Board specifications:

  • STM32F103 microcontroller in the center
  • 4 analog inputs for 4-20mA industrial sensors
  • 4 relay outputs at 24V
  • RS-485 communication for Modbus network
  • 24V industrial power input

Component placement:

  • Left side: Power supply circuit (voltage regulators, filter capacitors)
  • Center: STM32 with decoupling capacitors and crystal
  • Upper right: Analog zone (input resistors, RC filters, separate analog ground)
  • Lower right: Digital zone (relay circuits, driver transistors)
  • Top edge: Sensor and power connectors
  • Bottom edge: RS-485 connector with common mode choke

Traces:

  • Power traces at 1mm width with additional copper pours
  • Signal traces at 0.25mm width
  • Analog traces surrounded by ground guard traces
  • Bottom layer dedicated entirely as a ground plane

Summary

Layout and routing rules are the difference between a board that works reliably in a factory environment and one that suffers from continuous problems.

Golden rules summary:

  • Calculate trace widths based on expected current with a safety margin.
  • Use a complete ground plane on at least one side.
  • Separate analog and digital zones both physically and electrically.
  • Add a 100nF decoupling capacitor next to every IC within 5mm.
  • Follow EMC rules to ensure the board works in the industrial environment.

Investing in understanding and applying these rules saves hours of debugging and prevents costly failures. In the next lesson, we will dive into industrial power supply circuit design.

layout routing ground-plane EMI EMC decoupling توزيع اللوحة التوصيل التأريض التداخل الكهرومغناطيسي التوافق فك الاقتران