Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
Raspberry Pi PCB Layout: Complete Pico & Pi 4 Custom Board Design Guide
After spending the better part of three years designing custom boards around Raspberry Pi silicon, I’ve learned that the difference between a board that works on the first spin and one that becomes an expensive coaster often comes down to a handful of critical layout decisions. Whether you’re working on a raspberry pi pico pcb layout for a compact IoT sensor or building a raspberry pi 4 pcb layout using the Compute Module 4 for an industrial application, this guide covers the practical knowledge you need to get your design right.
The Raspberry Pi ecosystem offers incredible flexibility for embedded systems. The Pico gives you the RP2040 microcontroller with dual ARM Cortex-M0+ cores running at 133MHz for under $5. The Compute Module 4 brings full Raspberry Pi 4 power in a form factor designed specifically for custom carrier boards.
But here’s the thing: using a development board is convenient for prototyping, but production demands something more. Custom PCB design lets you optimize for your specific requirements, whether that’s form factor constraints, cost reduction through component consolidation, or interface customization that standard boards simply can’t provide.
Understanding the Raspberry Pi Pico PCB Layout
RP2040 Microcontroller Overview
The RP2040 sits at the heart of the Raspberry Pi Pico, and understanding its requirements is essential for any custom raspberry pi pico pcb layout. Unlike many microcontrollers you might have worked with, the RP2040 has some unique characteristics that directly impact your layout decisions.
Feature
Specification
Layout Impact
Package
QFN-56 (7×7mm)
Requires fine-pitch capability (0.4mm pitch)
Core Voltage
1.1V (internal regulator)
Needs external 1μF capacitor on VREG output
I/O Voltage
3.3V
Multiple decoupling capacitors required
Flash Memory
External QSPI
High-speed traces, 20mm max length
Crystal
12MHz recommended
Careful placement away from high-speed signals
USB
Full-speed (12 Mbps)
90Ω differential impedance required
Essential Components for RP2040 Custom Boards
Building a functional RP2040 board requires several supporting components beyond the microcontroller itself:
Power Supply Circuit The RP2040 needs two voltage rails: 3.3V for I/O and 1.1V for the digital core. The 1.1V supply can be generated internally using the chip’s built-in regulator, which simplifies the design considerably. For the 3.3V supply, the XC6206 or similar LDO works well and is typically available as a basic part from most PCB assembly services.
External Flash Memory This is non-negotiable. The RP2040 has no internal flash, so it requires an external QSPI flash chip to store your program. Stick with Winbond W25Q series flash chips (W25Q16, W25Q32, W25Q64, or W25Q128). I learned this the hard way when a Macronix chip that looked pin-compatible refused to boot. The RP2040 has specific command set requirements that not all flash chips meet.
Crystal Oscillator While the RP2040 has an internal oscillator, you need an external 12MHz crystal for reliable USB operation. The crystal’s load capacitors should be calculated based on the formula:
C = 2 × (C_load – C_stray)
For a typical 20pF load capacitance with 3pF stray capacitance, you’d need approximately 34pF capacitors (use 33pF standard value).
Raspberry Pi Pico PCB Layout Guidelines
Getting the layout right on an RP2040 board requires attention to several critical areas. Here’s what I’ve found works reliably across multiple production designs:
Decoupling Capacitor Placement
The RP2040 requires 0.1μF capacitors on each IOVDD pin, each DVDD pin, and the ADC_AVDD pin. Place these as close as physically possible to the power pins. The official hardware design guide recommends 9 vias on the central ground pad to provide a good current return path and help with heat dissipation.
QSPI Flash Layout Rules
Parameter
Recommended Value
Notes
Trace Length
< 20mm
Shorter is better
Trace Width
0.15mm (6 mil)
Match all data lines
Length Matching
Within 2mm
Critical for reliable operation
Ground Plane
Solid underneath
No splits or gaps
The BOOTSEL resistor (used to enter programming mode) needs to be positioned close to the flash chip, not near the button. This is a detail that’s easy to miss in the datasheet but is clearly stated in the hardware design guide. Long traces from the resistor to the flash can interfere with the high-frequency clock signal.
USB Differential Pair Routing
For USB connections, you need controlled impedance traces targeting 90Ω differential. On a standard 1.6mm FR4 board with a ground plane directly beneath the signal layer, this typically means:
Board Thickness
Trace Width
Trace Spacing
Impedance
1.6mm
0.8mm
0.15mm
~90Ω
1.0mm
0.5mm
0.1mm
~90Ω
If your USB traces are shorter than 25mm (about 1 inch), you can get away with simpler 6-8 mil traces routed closely together. The length mismatch between D+ and D- should be less than 100 mils (2.5mm).
Crystal Oscillator Area
Keep the crystal and its load capacitors away from high-speed signals, particularly the QSPI flash lines. Create a local ground area around the crystal to minimize noise coupling. The XIN and XOUT traces should be short and direct.
Using the Pico as a Module
If you’re not ready to design around the bare RP2040, the Raspberry Pi Pico itself is designed to be used as a module. Its castellated edges allow direct soldering to a carrier board. This approach gives you the proven power supply and USB circuit of the Pico while letting you customize the surrounding interfaces.
The Pico module footprint uses standard 2.54mm pin spacing with 40 pins total. Chapter 2 of the Pico datasheet provides the exact mechanical dimensions needed to create a proper footprint in KiCad or your EDA tool of choice.
Raspberry Pi 4 PCB Layout with Compute Module 4
CM4 Architecture and Carrier Board Concept
The Raspberry Pi Compute Module 4 takes a fundamentally different approach than the Pico. Instead of a microcontroller, you’re working with a full Linux-capable system-on-module that requires a carrier board for connectivity.
The CM4 uses two 100-pin Hirose connectors on the underside of the module. This design was a deliberate choice by Raspberry Pi to improve signal routing compared to the previous SODIMM form factor. Having connectors on two edges means you don’t need to route signals all the way across the board, which saves PCB layers and improves signal integrity.
CM4 Feature
Specification
Design Consideration
Connectors
2× 100-pin Hirose
High-density, requires careful footprint
PCIe
Gen 2.0 x1
Differential pairs, controlled impedance
USB
USB 2.0 Host
90Ω differential, ESD protection recommended
HDMI
Dual HDMI 2.0
100Ω differential pairs
CSI/DSI
Up to 2 cameras, 2 displays
MIPI differential pairs
Ethernet
Gigabit capable
Magnetics and transformer required
Raspberry Pi 4 PCB Layout Considerations
Designing a CM4 carrier board is significantly more complex than a Pico-based design. Here’s what you need to consider:
Connector Footprint
The Hirose connectors (part number DF40C-100DS-0.4V(51) or equivalent) have 0.4mm pitch and require precise PCB fabrication. Most budget PCB services can handle this, but verify your manufacturer’s minimum capabilities before committing to the design.
Power Delivery
The CM4 requires 5V input and handles all internal voltage regulation. However, you need to ensure your carrier board can supply adequate current. For a fully loaded CM4 with peripherals, plan for at least 3A capacity on the 5V rail.
High-Speed Signal Routing
Many CM4 interfaces use differential signaling with specific impedance requirements:
Interface
Impedance
Routing Notes
USB 2.0
90Ω differential
Length match within 5mm
HDMI
100Ω differential
Critical timing, keep traces short
PCIe
85Ω differential
AC coupling capacitors required
Ethernet
100Ω differential
External magnetics required
CSI/DSI
100Ω differential
Connect control pins to GPIO
Layer Stack Considerations
While a 2-layer board is technically possible for simple CM4 carriers, I strongly recommend at least 4 layers for any design using high-speed interfaces. The layer stack I typically use:
Layer 1: Signal (top)
Layer 2: Ground plane (continuous)
Layer 3: Power plane
Layer 4: Signal (bottom)
This provides good return paths for high-speed signals and adequate power distribution.
When adding USB ports to your CM4 carrier, don’t forget ESD protection. The USBLC6-2SC6 is a commonly available TVS diode that protects both data lines with minimal capacitance impact. Place it as close to the USB connector as possible.
HDMI Output
HDMI routing is perhaps the most demanding aspect of CM4 carrier design. The differential pairs need to maintain 100Ω impedance throughout their length, and the four data pairs should be length-matched within 5mm of each other. Most designs place the HDMI connector on the same edge as the CM4 to minimize trace lengths.
Camera and Display Interfaces
If you’re implementing CSI camera or DSI display interfaces, you’ll need the appropriate FPC connectors (typically 15-pin or 22-pin). These interfaces also require GPIO connections for control signals. The exact GPIO assignments are up to you, but you’ll need to create a custom device tree file to tell the operating system which pins you’ve chosen.
PCB Design Software and Tools
KiCad for Raspberry Pi Projects
KiCad has become the standard for open-source hardware development, and for good reason. It’s free, cross-platform, and powerful enough for complex designs. Both Raspberry Pi official designs and most community projects use KiCad.
For RP2040 designs, you can download the minimal viable board example directly from Raspberry Pi in KiCad format. For CM4 designs, the official CM4IO board design files are available as KiCad projects.
Essential KiCad Features for These Designs:
Differential pair routing with length matching
Impedance calculator (built into newer versions)
3D model viewer for fit checking
Fabrication output generation for common manufacturers
Alternative Design Tools
Tool
Pros
Cons
Best For
KiCad
Free, open source, widely supported
Learning curve for complex features
Most hobbyist and professional use
EasyEDA
Browser-based, integrated with LCSC/JLCPCB
Less powerful for complex routing
Quick prototypes, JLCPCB orders
Altium Designer
Industry standard, powerful features
Expensive licensing
Professional/commercial work
Eagle
Established user base
Being phased out by Autodesk
Legacy projects
Manufacturing Your Custom Board
PCB Fabrication Services
Modern PCB fabrication has become remarkably affordable. For prototypes, expect to pay $5-15 for 5-10 boards in standard 2-layer configurations. Here’s what to specify:
Parameter
Typical Value
Notes
Layers
2 or 4
4 recommended for CM4
Thickness
1.6mm standard
Affects impedance calculations
Copper Weight
1oz
Adequate for most designs
Surface Finish
HASL or ENIG
ENIG better for fine-pitch
Minimum Trace
6 mil (0.15mm)
Check manufacturer capability
Minimum Drill
0.3mm
For standard vias
Assembly Options
If you’re not comfortable soldering QFN packages, consider using PCB assembly services. JLCPCB, PCBWay, and others offer SMT assembly for minimal additional cost. The key is to use their “basic” parts whenever possible, as extended parts add significant cost.
For RP2040 designs specifically, all critical components (the microcontroller, flash chip, crystal, and LDO) are typically available as basic parts from major assembly services.
Common Mistakes and How to Avoid Them
After reviewing dozens of community designs and troubleshooting my own failures, here are the most frequent issues:
RP2040 Design Mistakes
Flash Chip Selection Using a non-compatible flash chip is probably the most common issue. Stick with Winbond W25Q series. If you must use an alternative, verify it supports the exact command set the RP2040 expects.
BOOTSEL Resistor Placement The 1kΩ resistor on the QSPI_SS line needs to be close to the flash chip, not the BOOTSEL button. This is counterintuitive but important for signal integrity.
Missing Decoupling The RP2040 needs proper decoupling on all power pins. Missing or poorly placed capacitors can cause random crashes, USB enumeration failures, or complete failure to boot.
Crystal Circuit Issues Load capacitors calculated incorrectly or placed too far from the crystal pins will cause unreliable operation. Use an oscilloscope to verify the crystal is oscillating cleanly if you have boot problems.
CM4 Carrier Design Mistakes
Incorrect Connector Orientation The two Hirose connectors have specific pinouts. Using a mirrored connector footprint will result in a non-functional board. Double-check against the CM4 datasheet before ordering.
Missing Power Sequencing Unlike some modules, the CM4 handles its own power sequencing. However, if you’re adding voltage regulators for peripherals, ensure they don’t power up before the CM4’s internal rails stabilize.
Impedance Mismatch on High-Speed Signals If USB or HDMI isn’t working, impedance issues are often the cause. Use your EDA tool’s impedance calculator and verify your manufacturer can achieve the required trace geometry.
Testing and Debugging Your Custom Board
Initial Power-On Tests
Before connecting a Pico or CM4, verify your power rails:
Check for shorts between power and ground
Apply power and verify voltage levels
Check current draw (should be minimal with no module installed)
RP2040 Debugging
The RP2040 supports Serial Wire Debug (SWD), which allows you to step through code and inspect memory. Break out the SWDIO and SWCLK pins to a header on your board. A $5 Pi Pico running the picoprobe firmware makes an excellent debugger.
If your board won’t enter BOOTSEL mode, check:
Flash chip is properly connected
Crystal is oscillating (check with oscilloscope)
Power rails are stable and at correct voltage
BOOTSEL button is actually pulling QSPI_SS low
CM4 Debugging
For CM4 carrier boards, the UART console is your primary debugging tool during early bring-up. Connect a USB-to-serial adapter to GPIO14 (TX) and GPIO15 (RX). This gives you boot messages and a login prompt before any other interfaces are working.
Resources and Downloads for Raspberry Pi PCB Design
Official Documentation
Resource
Link
Description
RP2040 Datasheet
datasheets.raspberrypi.com
Complete electrical specifications
Hardware Design with RP2040
datasheets.raspberrypi.com
Official layout guide with examples
Pico Datasheet
datasheets.raspberrypi.com
Module dimensions and pinout
CM4 Datasheet
datasheets.raspberrypi.com
Compute Module specifications
CM4IO KiCad Files
raspberrypi.com
Official carrier board design
Community Resources
Resource
Description
Raspberry Pi Forums
Active community for troubleshooting
GitHub rpi-pico-debugger-shoe
Example RP2040 KiCad project by Shawn Hymel
rpi-cm4-carrier-template
KiCad template for CM4 carrier boards
RP2040 Design Guide
Community-maintained design checklist
Design Files and Templates
The Raspberry Pi Foundation provides official design files, but note that the Pico’s original files were created in Cadence Allegro. The RP2040 hardware design guide includes KiCad-compatible minimal viable board files that are more accessible for most designers.
For CM4 projects, start with the official CM4IO KiCad files and modify them for your needs. This approach is faster than starting from scratch and ensures you have proven reference circuits for complex interfaces like HDMI and USB.
Frequently Asked Questions
What PCB software can open Raspberry Pi Pico design files?
The original Raspberry Pi Pico design files were created in Cadence Allegro, which is professional-grade software with expensive licensing. However, Raspberry Pi provides KiCad-format design files for the minimal RP2040 board in their hardware design guide, which is what most hobbyists and small companies use. For CM4 projects, the official CM4IO board files are available in KiCad format directly from the Raspberry Pi documentation site.
Can I design a raspberry pi pico pcb layout on a 2-layer board?
Yes, 2-layer boards work well for RP2040 designs. The Raspberry Pi Pico itself is a 4-layer board, but this was primarily for manufacturing efficiency at scale rather than electrical necessity. For hobby projects and low-volume production, a 2-layer board with proper ground plane management is entirely adequate. Keep your ground plane as continuous as possible under high-speed signals (USB and QSPI), and use stitching vias to connect top and bottom ground areas.
What’s the minimum trace width for RP2040 USB connections?
For USB differential pairs on a 1.6mm thick 2-layer board, typical trace widths are 0.8mm (about 31 mil) with 0.15mm (6 mil) spacing to achieve 90Ω differential impedance. However, if your USB traces are very short (under 25mm), you can use simpler 6-8 mil traces routed closely together. The key is matching the length of D+ and D- within 2.5mm (100 mil) of each other.
Do I need a 4-layer PCB for a raspberry pi 4 pcb layout using the CM4?
While technically possible on 2 layers, a 4-layer stackup is strongly recommended for CM4 carrier boards, especially if you’re implementing high-speed interfaces like HDMI, PCIe, or Gigabit Ethernet. The continuous ground plane on layer 2 provides proper return paths for high-frequency signals, which is difficult to achieve on a 2-layer board with multiple high-speed interfaces. For simple carriers with just USB and GPIO, 2 layers can work if you’re careful with your routing.
Why won’t my custom RP2040 board boot?
The most common causes of boot failure are: (1) incompatible flash chip – use Winbond W25Q series; (2) missing or poorly placed decoupling capacitors – ensure 0.1μF caps are close to all power pins; (3) crystal circuit issues – verify correct load capacitor values and short trace lengths; (4) flash not programmed – the flash must contain valid code for the RP2040 to boot normally. If BOOTSEL mode doesn’t work either, check that power rails are correct, the crystal is oscillating, and the QSPI_SS line can be pulled low by the button.
Advanced Layout Techniques for Production Boards
Thermal Management Considerations
Both the RP2040 and CM4 generate heat during operation, and your PCB layout can significantly impact thermal performance. For RP2040 designs, the central ground pad beneath the QFN package should connect to a solid ground plane via multiple vias. The hardware design guide recommends 9 vias minimum, but more is better for thermal dissipation.
For CM4 carrier boards, consider adding copper pour areas on both sides of the PCB beneath where the module sits. These areas, connected through thermal vias, create additional heat sinking. If your application demands heavy processing loads, plan for adequate airflow or external heatsink mounting.
EMC and Signal Integrity
When designing for production, electromagnetic compatibility becomes important. A few layout practices that help:
Ground Plane Integrity: Avoid slicing your ground plane with signal traces. If you must cross the ground plane, do so at a single point and add stitching vias on either side of the crossing.
Filter Critical Interfaces: Add ferrite beads on power inputs for noisy environments. For USB interfaces, consider adding common-mode chokes to reduce EMI emissions.
Keep High-Speed Signals Short: Every millimeter of trace length adds inductance and potential for noise coupling. Route QSPI flash connections as direct as possible. The same applies to USB, HDMI, and PCIe on CM4 designs.
Design for Manufacturing (DFM)
Production boards need additional considerations beyond just electrical functionality:
DFM Aspect
Recommendation
Reason
Fiducials
Add 3 global fiducials
Pick-and-place machine alignment
Panel Rails
5mm minimum edges
Assembly handling and depanelization
Component Spacing
0.5mm minimum
Avoid solder bridging during reflow
Test Points
Critical signals accessible
Post-assembly testing and debugging
Silkscreen
Clear polarity markings
Reduce assembly errors
Adding test points for power rails, reset lines, and key signals will save enormous time during prototype debugging and production testing. Even if you don’t plan to use them, the cost is negligible compared to the troubleshooting time they save.
Cost Optimization Strategies
For production volumes, small design decisions can have significant cost impact:
Component Selection: Use common part values. A 10kΩ resistor costs the same as a 9.53kΩ, but inventory complexity is reduced. Similarly, standardize on 0.1μF and 1μF capacitors where possible.
Assembly-Friendly Design: If using pick-and-place assembly, orient all polarized components in the same direction. This reduces machine programming time and assembly errors.
Panelization: Design your board outline to panel efficiently. A 50×50mm board panels better than a 45×55mm board on standard panel sizes.
Conclusion
Designing custom PCBs for Raspberry Pi platforms has become remarkably accessible. Whether you’re creating a compact raspberry pi pico pcb layout for a sensor project or building a sophisticated raspberry pi 4 pcb layout carrier board for the CM4, the key is understanding the specific requirements of each platform and following established layout guidelines.
Start with the official documentation and reference designs. The Raspberry Pi Foundation has done an excellent job providing the resources needed for custom hardware development. When you encounter issues, the community forums and GitHub repositories offer troubleshooting help from people who have solved the same problems.
The investment in learning proper PCB design for these platforms pays dividends. Once you’ve successfully completed your first custom board, you’ll have the skills and confidence to tackle increasingly complex projects. And there’s something deeply satisfying about holding a custom circuit board that does exactly what you need, in exactly the form factor you want.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.