Project: Custom IoT Sensor PCB
Complete custom PCB design: schematic, layout, fabrication, assembly, and bring-up for LoRa sensor node.
This capstone combines all PCB design skills: hierarchical schematic, 4-layer layout with impedance control, RF design, power management, and manufacturing-ready outputs.
Project Overview
Target: LoRa Environmental Sensor Node
├── MCU: ESP32-WROOM-32E (WiFi + BLE)
├── Radio: RFM95/SX1276 (LoRa 915 MHz)
├── Sensors: BME280 (I2C), MPU6050 (I2C)
├── Power: USB-C + LiPo + Charger + 3.3V LDO
├── Debug: SWD, UART, GPIO Header
├── Form Factor: 50×50 mm, 4-layer
└── Enclosure: IP67 rated, PCB mount
Project Structure
custom_iot_pcb/
├── hardware/
│ ├── custom_iot_pcb.kicad_pro
│ ├── custom_iot_pcb.kicad_sch
│ ├── custom_iot_pcb.kicad_pcb
│ ├── sym/
│ │ └── custom_symbols.kicad_sym
│ ├── fpt/
│ │ └── custom.pretty/
│ ├── 3dmodels/
│ ├── lib/
│ │ ├── sym-lib-table
│ │ └── fp-lib-table
│ └── fabrication/
│ ├── gerber/
│ ├── bom.csv
│ ├── pos_front.csv
│ ├── pos_back.csv
│ └── fab_drawing.pdf
├── firmware/
│ └── (ESP-IDF project)
├── enclosure/
│ ├── case.step
│ └── case.stl
└── docs/
├── schematic.pdf
├── assembly.pdf
└── test_plan.md
Hierarchical Schematic
custom_iot_pcb.kicad_sch (Root)
├── Power.kicad_sch
│ ├── USB-C Connector (J1)
│ ├── ESD Protection (D1-D4)
│ ├── PTC Fuse (F1, 500mA)
│ ├── Ideal Diode / Power Path (U1: TPS2115)
│ ├── LiPo Charger (U2: TP4054)
│ ├── 3.3V LDO (U3: AP2112K-3.3)
│ ├── Battery Connector (J2)
│ ├── Power LEDs (D5: CHG, D6: PWR)
│ └── PWR_FLAG on +5V, +3V3, VBAT, GND
├── MCU.kicad_sch
│ ├── ESP32-WROOM-32E (U4)
│ ├── 40 MHz Crystal (Y1, internal to module)
│ ├── Reset Circuit (R1, C1, SW1)
│ ├── Boot Strapping (R2, R3 on GPIO0, GPIO45)
│ ├── UART Header (J3: TX, RX, GND, 3V3)
│ ├── SWD Header (J4: SWCLK, SWDIO, GND, 3V3)
│ └── Decoupling (C2-C9: 0.1µF/1µF per VDD pin)
├── Radio.kicad_sch
│ ├── RFM95W (U5)
│ ├── SPI Connection (GPIO5,19,27,18,26)
│ ├── Antenna Matching (L1, C10, C11)
│ ├── U.FL Connector (J5)
│ ├── RF Ground Fence
│ └── 50Ω Trace (calculated width)
├── Sensors.kicad_sch
│ ├── BME280 (U6, I2C 0x76)
│ ├── MPU6050 (U7, I2C 0x68)
│ ├── I2C Pull-ups (R4, R5: 4.7k)
│ ├── Sensor Power Switch (Q1: 2N7002)
│ └── ADC Light Sensor (R6, R7 divider)
├── Connectors.kicad_sch
│ ├── I2C Expansion (J6: JST-PH 4-pin)
│ ├── GPIO Header (J7: 2×10, 2.54mm)
│ └── Mounting Holes (MH1-MH4, 3mm)
└── Net Ties / Cross-References
Key Schematic Decisions
| Decision | Rationale |
|---|---|
| TPS2115 Power Path | Seamless USB/Battery switching, no dropout |
| TP4054 Charger | Simple, 500mA charge current, small footprint |
| AP2112 LDO | 600mA, low quiescent (55µA), enable pin |
| Sensor Power Switch | Cut power in deep sleep (saves ~1mA) |
| U.FL + Matching | Flexible antenna options, tuneable |
| GPIO Header | 20 pins for expansion, prototyping |
| SWD Header | Professional debug, no USB-UART needed |
4-Layer Stackup
Layer Stack (1.6mm FR4, Tg170):
┌────────────────────────────────────┐
│ F.Cu Signals + Components │ 35µm (1oz)
├────────────────────────────────────┤ Prepreg 0.18mm (Er=4.2)
│ In1.Cu GND Plane (Solid) │ 35µm
├────────────────────────────────────┤ Core 0.8mm (Er=4.5)
│ In2.Cu Power Plane (Split) │ 35µm
├────────────────────────────────────┤ Prepreg 0.18mm (Er=4.2)
│ B.Cu Signals + Components │ 35µm
└────────────────────────────────────┘
Impedance Targets:
├── USB D+/D-: 90Ω diff (F.Cu, W=0.18mm, S=0.15mm)
├── SPI: 50Ω SE (F.Cu, W=0.38mm)
├── RF: 50Ω SE (F.Cu, W=0.5mm, ground fence)
└── I2C: No impedance control needed
Power Plane Split (In2.Cu)
+3V3 Main (80%): MCU, Sensors, Radio, Headers
+3V3 RF (10%): RFM95 PA supply (isolated via ferrite bead)
+5V USB (10%): USB section only, near connector
Component Placement (Top View)
50mm
┌────────────────────────────┐
│ J1(USB) MH1 MH2 J5(U.FL) │ ← Top edge
│ │
│ [ESP32] [RFM95] │ ← Center: MCU + Radio
│ │
│ [BME280] [MPU6050] │ ← Sensors
│ │
│ [TPS2115] [TP4054] [AP2112]│ ← Power section
│ │
│ J2(BAT) MH3 MH4 J3(UART)│ ← Bottom edge
│ J6(I2C) J7(GPIO) │
└────────────────────────────┘
50mm
Critical Routing
# RF Trace (F.Cu, 50Ω)
# U5 pin 16 (RF_IN) → π-match → J5
# Width: 0.5mm, Ground fence vias 2mm spacing
# Length: < 15mm, no vias, no crossovers
# USB Differential Pair (F.Cu, 90Ω)
# J1 D+/D- → U4 GPIO19/20
# Length matched: < 0.5mm skew
# Ground pour on both sides
# SPI (F.Cu, 50Ω)
# U4 GPIO5/18/19/23/27 → U5
# CLK (GPIO5) length matched to MOSI/MISO
# Ground reference on In1.Cu
# I2C (F.Cu/B.Cu)
# U4 GPIO21/22 → U6/U7/J6
# Pull-ups near U4
# Short as possible
# Power Traces
# TPS2115 → AP2112: 1mm wide (In2.Cu pour)
# AP2112 → Decoupling caps → MCU: Short, wide
# Battery path: 0.5mm wideGround Via Stitching
Perimeter: 5mm spacing, all layers
RF Section: 2mm spacing, F.Cu to In1.Cu
USB Connector: Ring of vias around shield pins
Layer Transitions: 2 vias per signal via (F.Cu ↔ B.Cu)
Thermal Vias: 3×3 array under TPS2115, AP2112, TP4054
BOM Summary (Key Components)
| Ref | Value | Footprint | MPN | Qty |
|---|---|---|---|---|
| U4 | ESP32-WROOM-32E | RF_Module:ESP32-WROOM-32 | ESP32-WROOM-32E | 1 |
| U5 | RFM95W | RF_Module:RFM95W | RFM95W-915S2 | 1 |
| U6 | BME280 | LGA-8 | BME280 | 1 |
| U7 | MPU6050 | QFN-24 | MPU-6050 | 1 |
| U1 | TPS2115 | VQFN-16 | TPS2115ADRCR | 1 |
| U2 | TP4054 | SOT-23-5 | TP4054 | 1 |
| U3 | AP2112K-3.3 | SOT-23-5 | AP2112K-3.3TRG1 | 1 |
| J1 | USB-C | USB_C_Receptacle | 12401610E4#2A | 1 |
| J5 | U.FL | U.FL-R-SMT | U.FL-R-SMT-1(10) | 1 |
| Y1 | 32.768 kHz | 3215 | ABS07-32.768kHz | 1 |
Total: ~65 unique parts, ~85 placements
Manufacturing Outputs
# Generate all outputs
kicad-cli sch export pdf custom_iot_pcb.kicad_sch -o docs/schematic.pdf
kicad-cli pcb export gerbers custom_iot_pcb.kicad_pcb \
--layers "F.Cu,B.Cu,In1.Cu,In2.Cu,F.Silkscreen,B.Silkscreen,F.Mask,B.Mask,Edge.Cuts" \
--output fabrication/gerber/
kicad-cli pcb export drill custom_iot_pcb.kicad_pcb \
--output fabrication/gerber/ \
--excellon-units mm
kicad-cli pcb export pos custom_iot_pcb.kicad_pcb \
--format csv --units mm --side front -o fabrication/pos_front.csv
kicad-cli pcb export pos custom_iot_pcb.kicad_pcb \
--format csv --units mm --side back -o fabrication/pos_back.csv
kicad-cli sch export python-bom custom_iot_pcb.kicad_sch \
--fields "Reference,Value,Footprint,MPN,Manufacturer,Datasheet" \
-o fabrication/bom.csvAssembly Notes
Special Instructions:
□ U4 (ESP32): Moisture sensitive (MSL 3), bake if >1 year
□ U5 (RFM95): Orient pin 1 per silkscreen, RF ground critical
□ U1/U2/U3: Thermal pads need solder paste (home plate stencil)
□ J1 (USB-C): Support during reflow (heavy connector)
□ C2-C9 (0.1µF): Place within 1mm of U4 VDD pins
□ L1/C10/C11 (RF Match): DNP until tuned (provide BOM for tuning)
□ Q1 (2N7002): Verify orientation (pin 1 = Gate)
□ No-clean paste preferred (hard to clean under RF shields)
□ X-ray BGA/QFN if available (U4 is module, U1 is QFN)
Bring-Up Test Plan
Phase 1: Bare Board
□ Continuity: Power rails not shorted
□ Voltage: +5V_USB, +3V3, VBAT present
□ Crystal: 32.768 kHz oscillating
Phase 2: MCU Only
□ ESP32 boots (UART log)
□ WiFi scan works
□ BLE advertising works
□ GPIO toggle test
Phase 3: Radio
□ SPI communication with RFM95
□ Register read/write verify
□ TX test (spectrum analyzer)
□ RX sensitivity test
Phase 4: Sensors
□ I2C scan finds 0x76, 0x68
□ BME280: T/H/P readings valid
□ MPU6050: Accel/Gyro readings valid
Phase 5: Power Management
□ USB power only: +3V3 from LDO
□ Battery only: +3V3 from TPS2115
□ Charge current: ~500mA
□ Deep sleep current: < 20µA
Phase 6: Integration
□ Full sensor + LoRa cycle
□ Battery life test (accelerated)
□ Thermal test (-20 to +70°C)
□ Enclosure fit check
Enclosure Design
Case: 55×55×20mm, IP67
├── PCB Mounts: 4× M2.5 standoffs
├── USB Cutout: Side wall
├── Antenna: U.FL → SMA bulkhead or internal PCB antenna
├── Sensor Vent: Gortex membrane for BME280
├── Mounting: 4× corner tabs for wall mount
└── Material: ASA (UV resistant) or Polycarbonate
Key Takeaways
- Hierarchical schematic for complex designs
- 4-layer stackup: Sig/GND/PWR/Sig
- Impedance control for USB, SPI, RF
- Power path IC for seamless USB/battery switching
- Sensor power switching for ultra-low sleep current
- Complete manufacturing package: Gerber, Drill, BOM, CPL
- Phased bring-up reduces debug time
- Enclosure design concurrent with PCB
Portfolio Checklist
- Hierarchical schematic (6+ sheets)
- 4-layer PCB with impedance control
- RF layout with 50Ω trace + ground fence
- Power management (USB + Battery + Charger)
- Complete BOM with MPNs
- Gerber + Drill + CPL files
- Fab drawing with stackup
- Assembly drawing
- Bring-up test plan
- Enclosure design (STEP/STL)
- Git repo with all files
Resources
- KiCad Project Templates: https://github.com/kicad/kicad-template
- RFM95W Datasheet: https://www.hoperf.com/upload/rf/RFM95W-V2.0.pdf
- ESP32 Hardware Design Guidelines: https://www.espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf
- TPS2115 Datasheet: https://www.ti.com/product/TPS2115
- TP4054 Datasheet: https://www.njrc.co.jp/products/E62112.pdf
- AP2112 Datasheet: https://www.diodes.com/assets/Datasheets/AP2112.pdf
- BME280 Datasheet: https://www.bosch-sensortec.com/products/environmental-sensors/humidity-sensors-bme280/
Wiring Diagram
See schematic.pdf for full schematic
See assembly.pdf for placement/assembly
Tech Stack
- KiCad 7+, ESP32, RFM95, BME280, MPU6050, TPS2115, TP4054, AP2112
Difficulty Note
Fast-track: 6 weeks · Deep-dive: 10-14 weeks