Engineering

How We Designed a 4-Layer PCB for a Smart Pen (As High Schoolers)

Logan Holby   March 16, 2026   8 min read

Eight months ago, none of us had ever designed a PCB. Today, Nexus Pen runs on a custom 4-layer board that we designed from scratch in KiCad 9.0 — crammed into a 120x18mm form factor that has to fit inside a pen barrel. Here's the full story of how we got there.

Why We Needed a Custom PCB

Early prototypes of Nexus Pen used hand-wired breadboards and development modules duct-taped together inside a 3D-printed shell. It worked well enough to prove the concept, but it was fragile, bulky, and impossible to manufacture at any kind of scale. If we were going to build a real product, we needed a real PCB.

The problem: custom PCB design is typically the domain of electrical engineers with years of experience. We were high school students who had barely finished AP Physics. But we had something better than experience — we had motivation, internet access, and no one telling us we couldn't do it.

The Constraint That Defined Everything: 120x18mm

The single hardest constraint in the entire design was size. A pen is roughly 120mm long and 14-18mm in diameter. Our PCB had to fit that envelope while housing an ESP32 module, a 1.3-inch OLED display driver, I2S microphone, I2S amplifier, lithium battery charging circuit, USB-C port, three push buttons, and all the passive components that tie it together.

Our first layout attempt failed immediately — we ran out of space before we even placed half the components. That forced us into a 4-layer stackup: signal, ground plane, power plane, and signal. The ground and power planes not only gave us space for traces on the outer layers but also dramatically improved signal integrity for the audio circuits.

The 4-layer approach added cost — roughly $0.80 per board more than a 2-layer equivalent — but it was non-negotiable for a board this dense.

Learning KiCad from Zero

We chose KiCad 9.0 because it's free, open-source, and has an enormous community. The learning curve was steep. The first two weeks were spent just learning the schematic editor — how to place symbols, draw nets, assign footprints, and run ERC (Electrical Rules Check).

Our biggest early mistake was ignoring the ERC entirely and jumping straight to layout. We spent three days routing traces before running ERC and discovering 23 errors, including several power pins incorrectly connected to ground. We had to go back to the schematic, fix everything, and start the layout over.

Lesson learned: fix ERC errors before you touch the PCB editor. Always.

Component Selection: Choosing for Size and Availability

With 38 components on a board this small, every footprint choice mattered. We standardized on 0402 passive components (resistors, capacitors) wherever possible — they're small enough to fit in tight spaces but large enough to hand-solder in a pinch. Going to 0201 would have saved a few millimeters but made hand rework essentially impossible.

The ESP32-WROOM-32E module was a natural choice — we'd been using it in prototypes since day one and knew its pinout cold. The SSD1306-based OLED driver, MAX98357A I2S amplifier, and INMP441 MEMS microphone were all familiar from breadboard work. Using parts we already understood saved enormous time in schematic capture.

The trickiest component was the USB-C connector. We needed a full-featured USB-C receptacle with CC1/CC2 pins for proper power negotiation, in a through-hole-compatible footprint that could withstand being plugged and unplugged repeatedly. After testing three different options, we settled on a mid-mount SMD variant that sits flush against the PCB edge — critical for keeping the pen diameter under 18mm.

Routing: Where the Real Work Lives

Routing a 4-layer board in KiCad is a different experience from routing a 2-layer board. Having dedicated ground and power planes means you can use vias to drop to those planes anywhere on the board, which simplifies routing dramatically — but it also means you need to be careful about via placement and stub lengths, especially for high-frequency signals.

Our I2S audio traces required the most attention. The BCLK and WS signals need to be impedance-controlled and length-matched to prevent timing skew. We aimed for 50-ohm trace impedance on those lines, which on our 4-layer stackup translated to approximately 0.15mm trace width on the outer layers. KiCad's impedance calculator was invaluable here.

The BLE antenna area on the ESP32 module required a keep-out zone — no copper pours, no vias, no traces within 3mm of the antenna. This is easy to forget when you're routing aggressively to save space, and it took us a few layout iterations before we got it right.

DRC: Our Most Humbling Experience

Design Rules Check (DRC) is the PCB equivalent of a compiler error — it catches violations that would cause manufacturing failures or electrical problems. Our first DRC run on the completed layout returned 47 violations. Forty-seven.

Most were spacing violations — traces too close together, vias too close to pads — that we'd accumulated during aggressive manual routing. A handful were silkscreen-over-pad violations that would interfere with soldering. Two were genuinely alarming: a net with no connection between the battery positive rail and the charging IC output, and a missing pull-down resistor on the ESP32 GPIO0 pin (which would have put the chip in bootloader mode on every power cycle).

Fixing those 47 violations took longer than the original routing. But every one of them was a real problem that would have caused a real failure. DRC is not optional — it's the last line of defense before you send a board to fabrication and wait three weeks to discover a mistake.

What We'd Do Differently

Looking back, a few things stand out as lessons we'd apply from the start on the next revision. First, we'd define the board outline and all keep-out zones before placing a single component. Working inside a hard constraint from the beginning forces better decisions earlier. Second, we'd use KiCad's hierarchical schematic feature from day one — our flat schematic became difficult to navigate once it exceeded 60 components. Third, we'd order a 3D-printed mechanical mock-up of the board outline before committing to fabrication, to verify fitment in the pen barrel without wasting a PCB run.

We're currently on revision 1 of the board. Revision 2 is already in design, incorporating everything we learned. The goal is a board that passes DRC clean on the first attempt — we're not there yet, but we're close.

The Bigger Lesson

Hardware is hard. Everything takes longer than you expect, costs more than you budgeted, and requires more expertise than you currently have. But none of that means you can't do it — it means you'll learn a lot in the process. We started with zero PCB experience and ended up with a working 4-layer design for a product we're proud of. If you're a student thinking about hardware, the best time to start was yesterday. The second best time is right now.

Back to Blog
Order Nexus Pen — $119