Problem
Design a compact, 4-layer PCB integrating an STM32F411 MCU with an MPU-6050 IMU, USB-C, and a 128×64 OLED for low-noise motion-sensing applications. Constraints: outer dimension under 50×35 mm, single-button programming via USB, signal integrity sufficient for USB Full-Speed.
Approach
A 4-layer stackup (SIG / GND / PWR / SIG) with a continuous ground reference under every high-speed trace. USB D+ / D- routed as a length-matched 90 Ω differential pair with 22 Ω series resistors. The MPU-6050 sits over a stitched ground plane, its I²C lines kept short and away from the LDO switching node.
| Qty | Part |
|---|---|
| 1 | STM32F411CEU6 |
| 1 | MPU-6050 |
| 1 | USB Type-C receptacle |
| 1 | 3.3V LDO regulator |
| 1 | 128x64 OLED |
| 2 | 22 ohm resistors |
| 1 | 4-layer FR4 PCB |
Implementation
Power: TI TLV75533 LDO at 500 mA, decoupled with 10 µF + 100 nF directly under the MCU. Crystal: 25 MHz HSE with matched 18 pF load capacitors. Programming via SWD broken out to a 4-pin header. I ran a manufacturer-provided DRC and verified controlled impedance with the JLCPCB impedance calculator before tape-out. Full manufacturing pack: Gerbers, drill files, assembly drawings, BOM with DFM validation.
IMU sample-rate stability (1 kHz target)
Results
The first run came back error-free. IMU sample rate held a stable 1 kHz with under 0.3 % jitter. USB enumerated reliably across three host OSes.
Lessons
Spending an extra evening on stitched-via fences around the USB pair paid for itself — the assembled board passed an informal EMC sniff test without retries. Next iteration will move to a 4-layer pour pattern that lets me drop one of the signal layers.
Gallery

