Custom 2-layer ESP32 PCB designed in KiCad, ready for JLCPCB fabrication

Figure 1: A custom 2-layer ESP32 PCB replaces dozens of jumper wires with a clean, reliable, and professional 5×5 cm board.

⚠️ NON-NEGOTIABLE PCB SAFETY RULES

  • Mains Voltage Clearance: If your board touches 230V AC, you need a minimum of 3 mm clearance (basic insulation) or 6 mm (reinforced) between live traces and everything else. Standard 0.2 mm design rules will arc and kill you. Keep mains off your first boards entirely.
  • Li-Ion & High Current: A trace that is too thin doesn't just fail — it heats up and can ignite the enclosure. Always size power traces for peak, not average, current.
  • Never Skip the DRC: The Design Rule Check is your last line of defense. A board sent to the fab with a short costs money and a week of your life.

Welcome to TechFix Hub! You've built the power supply, the sensor node, the amp, the tracker. They work. But they live on a breadboard held together by thirty jumper wires, two of which are one wiggle away from disconnecting forever.

Designing your own PCB is the single biggest step from "tinkerer" to "engineer." It's also cheaper than you think: in 2026, a 5×5 cm, 2-layer, professionally manufactured board costs roughly $2 for five pieces, with turnkey SMD assembly for pennies more. In this guide, we'll take a real ESP32 project from schematic to a finished, assembled board — and I'll show you every trap that burned me so you can skip it.

🔬 1. Why a PCB Beats a Breadboard Every Single Time

This isn't about aesthetics. Breadboards introduce real, measurable electrical problems:

Problem On a Breadboard On a Custom PCB
Parasitic Inductance Long wire loops → ringing, RF noise, ESP32 brownouts Short, controlled traces + ground plane
Contact Resistance Spring clips oxidize → intermittent faults Soldered = permanent
Decoupling Capacitors sit 5 cm away → useless at high frequency 1–2 mm from the pin, exactly as intended
Reproducibility You rebuild it from memory every time Order 50 identical units in one click

🛠️ 2. The KiCad Workflow: Schematic to Gerbers

Use KiCad (free, open-source, no page limits, no nagging). The mental model is: a schematic is a list of connections, a PCB is a physical placement of those connections.

  1. Schematic Capture (Eeschema): Place symbols, wire them, assign reference designators (R1, C3, U1). Add a Power symbol for each net (3V3, GND, 5V) — this is what makes nets globally connected.
  2. Assign Footprints: Every symbol needs a physical package. A 10 kΩ resistor is not a rectangle — it's a 0603 or 0805 footprint. For your first board, use 0805: small enough to be neat, big enough to solder by hand and rework with an iron.
  3. Board Setup → Design Rules: Set your fab house's limits before routing. JLCPCB's safe defaults for a hobbyist: Track/Gap 0.2 mm, Via 0.8 mm / drill 0.4 mm, Min annular ring 0.15 mm.
  4. Layout (Pcbnew): Place parts first, route second. Group by function: connector → protection → regulator → MCU → peripherals. Good placement makes 80% of the routing disappear.
  5. Routing: Signals first, then pour copper for GND. Prefer 45° bends over 90° (cosmetic, but it's a good habit). Keep high-current paths short and wide.
  6. Copper Pour: Draw a filled zone on both layers connected to GND. This single action fixes more EMC and noise problems than any other technique in this article.
  7. Run DRC (F8): Fix every violation. Zero errors. Then run Clearance and Unconnected checks separately — KiCad hides some until you ask.
  8. Export Fabrication Files: Fabrication Outputs → Gerbers + Drill Files. Zip everything. That's what you send to the fab.

⚡ Pro shortcut — export from the command line (KiCad 7+):

kicad-cli pcb export gerbers board.kicad_pcb -o ./gerbers/ \
  --layers F.Cu,B.Cu,F.Paste,B.Paste,F.Silkscreen,B.Silkscreen,F.Mask,B.Mask,Edge.Cuts

kicad-cli pcb export drill board.kicad_pcb -o ./gerbers/

kicad-cli pcb export pos board.kicad_pcb -o ./bom/pos.csv --format csv
      

The pos.csv (pick-and-place file) is what lets the factory assemble the board for you automatically.

📐 3. The Four Layout Rules That Actually Matter

A. Trace Width vs. Current (1 oz copper, external layer, ~10 °C rise)

Current Min Trace Width Typical Use
< 0.5 A0.2 – 0.3 mmSignals, SPI, I²C, GPIO
1 A0.6 – 0.8 mmESP32 3V3 rail, USB 5V
2 A1.2 – 1.5 mmServo bus, LED strip feed
5 A3 mm+ or 1 oz + solder floodBattery main, motor driver

💡 Trick for high current on a cheap 2-layer board: make the trace as wide as the board allows, then open the solder mask over it and flood it with extra solder. Solder is a very good conductor, and it's free.

B. Decoupling: The 2 mm Rule

A 100 nF capacitor 5 cm away from your ESP32's VDD pin is not a decoupling capacitor — it's a decorative object. At 100 MHz, that 5 cm of trace is an inductor, and the whole point of the capacitor is defeated. Place one 100 nF within 1–2 mm of every single power pin, then a 10 µF bulk capacitor near the regulator output.

C. The Ground Plane Is Not Optional

Current doesn't travel through the wire you routed — it returns via the lowest-impedance path, which is directly under the trace, through the ground plane. If you cut that plane with a slot, the return current detours, the loop area explodes, and you've just built an antenna. Never let a high-speed signal cross a split in its ground reference.

D. Crystal & Oscillator

Keep the 32.768 kHz or 40 MHz crystal traces short (<10 mm), symmetric, and surrounded by a ground guard ring. Never route anything underneath it. A badly laid-out crystal is the #1 cause of "my board works but the RTC drifts 5 minutes a day."

📡 4. ESP32-Specific Rules (This Is Where Everyone Gets Burned)

The ESP32 is the most common source of first-PCB heartbreak, and almost always for the same reason: the antenna.

  1. USE A MODULE, NOT THE BARE CHIP — for your first board. An ESP32-WROOM-32 / ESP32-S3-MINI is a pre-certified, pre-tuned module with its own antenna. Designing a PCB for the bare ESP32-S3 chip means designing a 2.4 GHz antenna and matching network, which is a completely different profession.
  2. The Keep-Out Zone Is Sacred: The antenna section of the module needs a clear area on every layer — no copper, no ground plane, no components, no traces, and absolutely no battery or USB metal shell behind it. Typical requirement: 15 × 15 mm minimum. Violate this and your WiFi range drops from 20 m to 2 m while the board "works perfectly" on the bench next to the router. You will blame the code. It's the copper.
  3. Put the antenna at the board edge. The module's antenna end must overhang toward the edge of the PCB, pointing into open air — never buried in the middle of the board or facing a metal enclosure wall.
  4. USB Differential Pair: Route D+ and D− together, parallel, same length (±0.1 mm), targeting ~90 Ω differential impedance. Keep them away from the crystal and the antenna, and never let them cross a ground split.
  5. Boot Straps: Wire GPIO0 to a button (for flashing) and GPIO2/8 with correct pull-ups/pull-downs, or your board will boot into download mode and you'll think the firmware is broken.

🏭 5. Sending It to the Fab: What to Choose and What to Skip

Setting Recommended for Your First Board Why
Layers 2 layers, 1.6 mm Cheapest, most robust, and enough for any ESP32 project.
Copper Weight 1 oz (35 µm) 2 oz only if you're pushing 3 A+ on thin traces.
Surface Finish HASL (lead-free) — or ENIG for fine pitch HASL is cheap and fine for 0805. ENIG is flat and essential for QFN/BGA, but costs more.
Min Drill 0.3 mm Standard; smaller drills cost extra.
Stencil Stainless steel, 0.15 mm thick 0.15 mm is the sweet spot for 0805 and QFN. 0.12 mm is for 0201.
PCB Color Green or Black Free. Matte black looks stunning in photos, but makes traces harder to see when debugging.
Assembly Turnkey, top side only, extended parts library The factory places SMD for ~$8 setup + cents per part. Do it at least once.

🔧 6. First Power-On: The Bring-Up Procedure That Saves Boards

Never, ever power a brand-new board from a wall adapter. Follow this sequence religiously:

  1. Visual + Continuity Check First: With the board unpowered, set your multimeter to continuity and check VCC-to-GND on every rail. You should read a rising resistance as the capacitors charge, then settle. A dead 0 Ω reading means a short — find it before you apply power.
  2. Current-Limited Supply: Use a bench supply (or a DIY constant-current load in reverse) set to your expected voltage and a current limit of 100–200 mA. If there's a short, it will limit and get warm instead of smoking.
  3. Touch Test: After 30 seconds, power off and feel the regulators, the ESP32 module, and the MOSFETs with your finger. Anything noticeably warm with no load is your suspect.
  4. Then, and only then, program it. If the firmware fails, check GPIO0/strap pins before you blame your code.
  5. The Flux Is Not Clean: After hand soldering, wash the board with isopropyl alcohol (99%) and a stiff brush. Leftover flux is slightly conductive and hygroscopic — it will cause phantom faults weeks later that you will never be able to reproduce.

🚀 7. The "TechFix Hub" Upgrade: From Functional to Professional

  • Castellated Edges: Design your board with half-plated holes on the edges so it can be soldered flat onto another board like a giant SMD component. Perfect for building a modular sensor carrier that plugs into your main controller.
  • Test Points Everywhere: Add bare copper pads (0.8 mm) on every critical net: 3V3, 5V, GND, EN, GPIO0, TX, RX, SWD. Debugging a board with test points is 10× faster than probing a QFN pin with a hair-thin probe. It costs nothing.
  • Design for the Enclosure, Not the Other Way Round: Model the 3D-printed case before you finalize the board outline. Put the mounting holes, the USB cutout, and the display window in the PCB outline (Edge.Cuts) in KiCad, and export a STEP file to give to your CAD software. Nothing is more demoralizing than a perfect board that doesn't fit the box.
  • Low-Power by Design: If this board runs on battery, add a load switch or P-FET that can hard-cut power to the RF section, pull every unused pin to a defined level, and add a solder-jumper to disconnect the charging IC. A well-designed ESP32 board can sleep at 10–20 µA; a careless one wastes 15 mA in standby and kills a 3000 mAh battery in 9 days.
  • Silkscreen Is Documentation: Label every connector, mark polarity on capacitors, print the board name, version (v1.0), and date. Six months from now, you will not remember which pad was GND.

🔗 Put Your New PCB to Work on TechFix Hub

Every one of these projects deserves a custom board. Here are the best first candidates:

✅ Conclusion

Your first PCB will not be perfect — mine wasn't either. I forgot the antenna keep-out zone, and I spent two weeks debugging "bad WiFi" on a board that was electrically flawless. But for the price of a coffee, you get five boards, a professional result, and a skill that transforms every single project you will ever build. Learn KiCad, respect the ground plane, give the antenna its space, run the DRC, and never power up a fresh board without a current limit. From that moment on, you're not making prototypes anymore — you're making products.

🛠️ Designing your first PCB?

Struggling with KiCad footprints, the ESP32 antenna keep-out, Gerber export errors, or choosing a surface finish? Drop your questions in the comments below — the TechFix Hub community will help you get it right the first time.

Keywords: KiCad Tutorial Custom PCB Design ESP32 PCB Layout JLCPCB PCB Manufacturing

Bottom Ad [Post Page]