alvinkigs/Bonyo-final
A 90×70 mm two-layer carrier PCB for ESP32, SIM800C cellular, NEO-6M GPS, and TP4056 Li-ion charger modules, with protected power switching, modem level shifting, antenna, controls, indicators, connectors, and mounting hardware.
- Version
- 0.0.1
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone alvinkigs/Bonyo-final # download the package files into ./Bonyo-final
tsci add alvinkigs/Bonyo-final # add it to your project as @tsci/alvinkigs.Bonyo-finalIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
index.tsx
PCB
Schematic
// Preliminary module carrier: qualify the off-board adapters and all dimensions before fabrication.
export default () => {
// SIM800C stagger offsets (2.54mm = 1 perfboard hole)
const SIM_LEFT_DX = -20.32 // 7 empty columns between rows (8 pitches)
const SIM_LEFT_DY = -2.54 // Right side (NET..GND) starts 1 row higher than left side
// TP4056 center X (matches OpenSCAD USB-C cutout at px(26.5))
const TP_X = 26.5
// 3D PREVIEW ONLY. true = grey boxes where the plug-in modules (ESP32, SIM800C,
// GPS, charger) sit, for fit checks. They are not part of the PCB and never
// appear in Gerbers. Keep false for the default render sent to fabs/assemblers.
const SHOW_MODULE_ENVELOPES = false
const envelope = (vector: number[], size: number[]) =>
SHOW_MODULE_ENVELOPES ? { jscad: { type: "translate", vector, shape: { type: "cuboid", size } } } : undefined
// Fabrication rules: conservative values every fab's STANDARD 2-layer service
// accepts (JLCPCB/PCBWay standard is 5-6 mil track/space, 0.3 mm via drill).
const REVISION = "REV A 2026-11"
return (
<board width="90mm" height="70mm" layers={2} thickness="1.6mm" title="Bonyo carrier"
minTraceWidth="0.15mm" minTraceToPadEdgeClearance="0.15mm" minTraceToHoleEdgeClearance="0.2mm"
minPadEdgeToPadEdgeClearance="0.15mm" minBoardEdgeClearance="0.3mm"
minViaHoleDiameter="0.3mm" minViaPadDiameter="0.6mm" minViaEdgeToPadEdgeClearance="0.15mm"
pcbStyle={{ viaHoleDiameter: "0.3mm", viaPadDiameter: "0.6mm", silkscreenFontSize: "0.8mm" }}
autorouter={{ local: true, traceClearance: "0.15mm" }}>
{/* ================= 1. 4x CORNER M3 PCB MOUNTING HOLES (82mm x 62mm) ================= */}
<hole name="H_PCB_TL" diameter="3.2mm" pcbX="-41mm" pcbY="31mm" />
<hole name="H_PCB_TR" diameter="3.2mm" pcbX="41mm" pcbY="31mm" />
<hole name="H_PCB_BL" diameter="3.2mm" pcbX="-41mm" pcbY="-31mm" />
<hole name="H_PCB_BR" diameter="3.2mm" pcbX="41mm" pcbY="-31mm" />
{/* ================= 2. 38-PIN ESP32 SOCKETS (TOP-RIGHT, LANDSCAPE, 25.4mm) ================= */}
<pinheader
name="J_ESP_TOP" cadModel={envelope([0, -12.7, 9.8], [52, 28, 1.6])} schX={-1} schY={11}
pinCount={19}
pitch="2.54mm"
gender="female"
pcbX="12.5mm"
pcbY="26.7mm"
showSilkscreenPinLabels
pinLabels={[
"GND1", "G23", "G22", "TX0", "RX0", "G21", "GND2", "G19", "G18",
"G5", "G17", "G16", "G4", "G0", "G2", "G15", "D1", "D0", "CLK"
]}
/>
<pinheader
name="J_ESP_BOT" schX={8} schY={11}
pinCount={19}
pitch="2.54mm"
gender="female"
pcbX="12.5mm"
pcbY="1.3mm"
showSilkscreenPinLabels
pinLabels={[
"3V3", "EN", "VP", "VN", "G34", "G35", "G32", "G33", "G25",
"G26", "G27", "G14", "G12", "GND", "G13", "D2", "D3", "CMD", "5V"
]}
/>
{/* Service connectors sit on free board edges (J_REG: right edge above the load
switch), never under the plugged-in ESP32 board where no cable can reach them. */}
<pinheader name="J_REG" pinCount={3} pitch="2.54mm" gender="male" pcbRotation="90deg"
pcbX="42mm" pcbY="10mm" pinLabels={["VIN", "GND", "V3V3"]} showSilkscreenPinLabels schX={-12} schY={1} />
<pinheader name="J_LOAD_SWITCH" pinCount={2} pitch="2.54mm" gender="male"
pcbX="37mm" pcbY="-3.5mm" pinLabels={["IN", "OUT"]} showSilkscreenPinLabels schX={-17} schY={1} />
{/* Modem UART level matching = SIMCom SIM800C Hardware Design V1.02 Figure 19 (3.3V host):
1k series on each line, 5.6k to GND at the modem RXD (3.3V * 5.6/6.6 = 2.8V). Reference is
for the bare module: confirm against the core board's own RXD/TXD circuit and receiver
thresholds (build guide B6). Under the SIM board, beside its TXD/RXD pins. */}
<resistor name="R_MRX_SER" resistance="1k" footprint="0603" pcbX="-24mm" pcbY="-18.6mm" schX={3} schY={-8} />
<resistor name="R_MRX_PD" resistance="5.6k" footprint="0603" pcbX="-24mm" pcbY="-22.5mm" schX={0} schY={-8} />
<resistor name="R_MTX_SER" resistance="1k" footprint="0603" pcbX="-30mm" pcbY="-20mm" schX={-3} schY={-8} />
{/* ================= 4. TOP-LEFT HMI: LEDS & FEMALE-HEADER BUTTON RISERS ================= */}
{/* LED 1 (Green, Tracking) at (-34, +25) */}
<pinheader
name="LED_TRACK" schX={-15} schY={12}
pinCount={2}
pitch="2.54mm"
gender="female"
pcbX="-34mm"
pcbY="25mm"
showSilkscreenPinLabels
pinLabels={["ANODE", "CATHODE"]}
/>
<resistor name="R_LED1" schX={-15} schY={8} resistance="220" footprint="axial_p0.3in" pcbX="-34mm" pcbY="20mm" />
{/* LED 2 (Red, Capacity) at (-20, +25) */}
<pinheader
name="LED_CAP" schX={-10} schY={12}
pinCount={2}
pitch="2.54mm"
gender="female"
pcbX="-20mm"
pcbY="25mm"
showSilkscreenPinLabels
pinLabels={["ANODE", "CATHODE"]}
/>
<resistor name="R_LED2" schX={-10} schY={8} resistance="220" footprint="axial_p0.3in" pcbX="-20mm" pcbY="20mm" />
{/* Button 1 (Tracking) at (-34, +9.5): 2x 3-pin female headers @ 6.5mm spacing */}
<pinheader name="SW1_TOP" schX={-23} schY={13} pinCount={3} pitch="2.54mm" gender="female" pcbX="-34mm" pcbY="12.75mm" showSilkscreenPinLabels pinLabels={["A1", "NC", "A2"]} />
<pinheader name="SW1_BOT" schX={-23} schY={10} pinCount={3} pitch="2.54mm" gender="female" pcbX="-34mm" pcbY="6.25mm" showSilkscreenPinLabels pinLabels={["B1", "NC", "B2"]} />
{/* Button 2 (Capacity) at (-20, +9.5): 2x 3-pin female headers @ 6.5mm spacing */}
<pinheader name="SW2_TOP" schX={-23} schY={6} pinCount={3} pitch="2.54mm" gender="female" pcbX="-20mm" pcbY="12.75mm" showSilkscreenPinLabels pinLabels={["A1", "NC", "A2"]} />
<pinheader name="SW2_BOT" schX={-23} schY={3} pinCount={3} pitch="2.54mm" gender="female" pcbX="-20mm" pcbY="6.25mm" showSilkscreenPinLabels pinLabels={["B1", "NC", "B2"]} />
{/* ================= 5. SIM800C 12-PIN STAGGERED SOCKETS + ANTENNA HOLE ================= */}
{/* 90deg rotation: GND at bottom (-Y), NET at top (+Y = -9.65mm). The cadModel offset is
rotated with the part, so [-1.27,10.16] lands the 24x25 envelope at (-28.66,-17.27). */}
<pinheader
name="J_SIM_RIGHT" cadModel={envelope([-1.27, 10.16, 8], [25, 24, 1.6])} schX={18} schY={1}
pinCount={6}
pitch="2.54mm"
gender="female"
pcbX="-18.5mm"
pcbY="-16mm"
pcbRotation="90deg"
showSilkscreenPinLabels
pinLabels={["GND", "TXD", "RXD", "BOOT", "VCC", "NET"]}
/>
<pinheader
name="J_SIM_LEFT" schX={24} schY={1}
pinCount={6}
pitch="2.54mm"
gender="female"
pcbX={`${-18.5 + SIM_LEFT_DX}mm`}
pcbY={`${-16 + SIM_LEFT_DY}mm`}
pcbRotation="90deg"
showSilkscreenPinLabels
pinLabels={["SPKN", "SPKP", "MICM", "MICP", "DTR", "RING"]}
/>
{/* Dedicated Through-Hole Pad for Separate SIM800C Helical Spring Antenna (4.15mm above NET) */}
<pinheader
name="ANT_SIM" schX={24} schY={-6}
pinCount={1}
pitch="2.54mm"
gender="female"
holeDiameter="1.2mm"
pcbX="-18.5mm"
pcbY="-5.5mm"
showSilkscreenPinLabels
pinLabels={["ANT"]}
/>
{/* Modem power key = SIMCom SIM800C Hardware Design V1.02 Figure 10: NPN, 4.7k base
resistor, 47k base-emitter pull-down. Released by default (ESP32 resets never touch
the modem); GPIO32 HIGH presses the key. Open collector: it can only pull BOOT low.
Q/R_B/R_BE sit under the SIM core board between its header rows (low SMD parts). */}
<transistor name="Q_PWRKEY" type="npn" footprint="sot23" pcbX="-24mm" pcbY="-14.7mm"
pinLabels={{ pin1: "base", pin2: "emitter", pin3: "collector" }} schX={12} schY={-8} />
<resistor name="R_PWRKEY_B" resistance="4.7k" footprint="0603" pcbX="-29mm" pcbY="-12mm" schX={9} schY={-8} />
<resistor name="R_PWRKEY_BE" resistance="47k" footprint="0603" pcbX="-28.5mm" pcbY="-16.5mm" schX={6} schY={-8} />
{/* NET -> spring-antenna link (prototype: direct 4.15mm stub). FITTED: owner continuity
check 20 Nov 2026 found NET routes to the antenna path with no short to GND. */}
<resistor name="R_ANT_LINK" resistance="0" footprint="0603" pcbX="-15mm" pcbY="-7.5mm" schX={24} schY={-9} />
{/* Bulk capacitor: 8 mm diameter x 20 mm max can, 3.5 mm lead pitch (radial standard for
8 mm). Sits directly above the modem VCC pin column for a short burst path; clears the
modem envelope by 0.77 mm and the SW2 header by 0.98 mm (the old 10 mm can had 0.27 mm). 680-1000 uF, low-ESR, 105 C, >=6.3 V. */}
<capacitor name="C_BULK" capacitance="1000uF" maxVoltageRating="6.3V" polarized
pcbX="-21.5mm" pcbY="0mm" pcbRotation="-90deg" schX={-9} schY={-4}
footprint={<footprint>
<platedhole shape="circle" holeDiameter={0.9} outerDiameter={1.8} pcbX={-1.75} portHints={["pin1"]} />
<platedhole shape="circle" holeDiameter={0.9} outerDiameter={1.8} pcbX={1.75} portHints={["pin2"]} />
<silkscreencircle radius={4} strokeWidth={0.15} />
</footprint>}
cadModel={{jscad: {type:"translate", vector:[0,0,10], shape:{type:"cylinder", radius:4, height:20}}}} />
<capacitor name="C_MODEM_HF" capacitance="100nF" footprint="0805" pcbX="-13mm" pcbY="-11mm" schX={-6} schY={-4} />
<capacitor name="C_MODEM_MID" capacitance="10uF" footprint="0805" pcbX="-13mm" pcbY="-14mm" schX={-3} schY={-4} />
<capacitor name="C_LOGIC" capacitance="10uF" footprint="1206" pcbX="23mm" pcbY="10mm" schX={-9} schY={1} />
{/* ================= 6. NEO-6M GPS SOCKET + 4 CORNER M2 HOLES ================= */}
<pinheader
name="J_GPS" cadModel={envelope([0, -11.5, 8], [25, 35, 1.6])} schX={18} schY={10}
pinCount={4}
pitch="2.54mm"
gender="female"
pcbX="2.5mm"
pcbY="-7.5mm"
showSilkscreenPinLabels
pinLabels={["VCC", "RX", "TX", "GND"]}
/>
{/* 20.32mm x 27.94mm center-to-center M2 standoff holes */}
<hole name="H_GPS_1" diameter="2.2mm" pcbX="-7.66mm" pcbY="-5.03mm" />
<hole name="H_GPS_2" diameter="2.2mm" pcbX="12.66mm" pcbY="-5.03mm" />
<hole name="H_GPS_3" diameter="2.2mm" pcbX="-7.66mm" pcbY="-32.97mm" />
<hole name="H_GPS_4" diameter="2.2mm" pcbX="12.66mm" pcbY="-32.97mm" />
{/* ================= 7. TP4056 CHARGER (24.5mm PAD-TO-PAD) + RIGHT-ANGLE JST-XH ================= */}
{/* Rear 4 pads (OUT+, B+, B-, OUT-) at Y = -8.5mm */}
<pinheader name="TP_OUT_P" cadModel={envelope([6.5, -12.25, 2], [17, 26, 1.6])} schX={-17} schY={-4} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X - 6.5}mm`} pcbY="-8.5mm" showSilkscreenPinLabels pinLabels={["OUT_P"]} />
<pinheader name="TP_BAT_P" schX={-23} schY={-1} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X - 2.5}mm`} pcbY="-8.5mm" showSilkscreenPinLabels pinLabels={["BAT_P"]} />
<pinheader name="TP_BAT_N" schX={-23} schY={-8} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X + 2.5}mm`} pcbY="-8.5mm" showSilkscreenPinLabels pinLabels={["BAT_N"]} />
<pinheader name="TP_OUT_N" schX={-17} schY={-8} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X + 6.5}mm`} pcbY="-8.5mm" showSilkscreenPinLabels pinLabels={["OUT_N"]} />
{/* Front 2 mechanical anchor pads at Y = -33.0mm (24.5mm span, isolated for DW01A safety) */}
<pinheader name="TP_IN_P" schX={-23} schY={-12} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X - 6.5}mm`} pcbY="-33mm" showSilkscreenPinLabels pinLabels={["IN_P"]} />
<pinheader name="TP_IN_N" schX={-17} schY={-12} pinCount={1} pitch="2.54mm" gender="female" pcbX={`${TP_X + 6.5}mm`} pcbY="-33mm" showSilkscreenPinLabels pinLabels={["IN_N"]} />
{/* Charger cell-temperature cut-off. TP4056 datasheet: charging pauses while TEMP is below
45 % or above 80 % of VIN. 10k B3950 NTC on the pack (J_NTC) parallel with R_NTC_BOT 47k,
R_NTC_TOP 4.7k from VIN: window ~0.5-46 C. Divider ground is the module's IN-/B- (chip
GND), NOT carrier GND (OUT-, after the protection FETs). TP_TEMP takes a short wire from
the module's TP4056 pin 1 after lifting it from the module's TEMP-to-GND link. */}
<resistor name="R_NTC_TOP" resistance="4.7k" footprint="0603" pcbX="38mm" pcbY="-27.5mm" schX={-20} schY={-14} />
<resistor name="R_NTC_BOT" resistance="47k" footprint="0603" pcbX="38mm" pcbY="-24mm" schX={-17} schY={-14} />
<pinheader name="J_NTC" pinCount={2} pitch="2.54mm" gender="male" pcbRotation="90deg"
pcbX="42mm" pcbY="-19mm" pinLabels={["NTC_TEMP", "NTC_RET"]} showSilkscreenPinLabels schX={-14} schY={-14} />
<pinheader name="TP_TEMP" pinCount={1} pitch="2.54mm" gender="male" pcbX="38mm" pcbY="-12.5mm"
pinLabels={["TEMP"]} showSilkscreenPinLabels schX={-11} schY={-14} />
{/* Straddle zip-tie strain-relief holes */}
<hole name="H_TP_TIE_L" diameter="1.8mm" pcbX={`${TP_X - 9.8}mm`} pcbY="-21mm" />
<hole name="H_TP_TIE_R" diameter="1.8mm" pcbX={`${TP_X + 9.8}mm`} pcbY="-21mm" />
{/* 2-Pin Right-Angle JST-XH (2.54mm) — SOLDER ON UNDERSIDE facing under-PCB battery bay */}
<pinheader
name="J_BAT"
pinCount={2}
pitch="2.50mm"
gender="male"
pcbX={`${TP_X}mm`}
pcbY="-3.5mm"
layer="bottom" pcbRotation="180deg"
schX={-23} schY={-4}
showSilkscreenPinLabels
pinLabels={["BAT_PLUS", "BAT_MINUS"]}
/>
{/* Protected return only: never join CELL_N to GND on the carrier. */}
{([
["CELL_P", ["TP_BAT_P.pin1", "J_BAT.BAT_PLUS"], 1.6],
["CELL_N", ["TP_BAT_N.pin1", "J_BAT.BAT_MINUS"], 1.6],
["VBAT_PROTECTED", ["TP_OUT_P.pin1", "J_LOAD_SWITCH.IN"], 1.6],
["VBAT_SWITCHED", ["J_LOAD_SWITCH.OUT", "J_REG.VIN", "J_SIM_RIGHT.VCC", "C_MODEM_HF.pin1", "C_MODEM_MID.pin1"], 1.6],
["V3V3", ["J_REG.V3V3", "J_ESP_BOT.3V3", "J_GPS.VCC", "C_LOGIC.pin1"], 0.6],
["GND", ["J_REG.GND", "J_ESP_TOP.GND1", "J_ESP_TOP.GND2", "J_ESP_BOT.GND", "J_GPS.GND", "J_SIM_RIGHT.GND", "C_BULK.pin2", "C_MODEM_HF.pin2", "C_MODEM_MID.pin2", "C_LOGIC.pin2", "SW1_BOT.B1", "SW1_BOT.B2", "SW2_BOT.B1", "SW2_BOT.B2", "LED_TRACK.CATHODE", "LED_CAP.CATHODE", "Q_PWRKEY.emitter", "R_PWRKEY_BE.pin2", "R_MRX_PD.pin2"], 1.6],
["ESP_TX", ["J_ESP_TOP.G22", "R_MRX_SER.pin1"], 0.3],
["MODEM_RX", ["R_MRX_SER.pin2", "R_MRX_PD.pin1", "J_SIM_RIGHT.RXD"], 0.3],
["MODEM_TX", ["J_SIM_RIGHT.TXD", "R_MTX_SER.pin1"], 0.3],
["ESP_RX", ["R_MTX_SER.pin2", "J_ESP_TOP.G21"], 0.3],
["MODEM_PWRKEY_CTL", ["J_ESP_BOT.G32", "R_PWRKEY_B.pin1"], 0.3],
["MODEM_PWRKEY_BASE", ["R_PWRKEY_B.pin2", "Q_PWRKEY.base", "R_PWRKEY_BE.pin1"], 0.3],
["MODEM_BOOT", ["Q_PWRKEY.collector", "J_SIM_RIGHT.BOOT"], 0.3],
["MODEM_RF", ["J_SIM_RIGHT.NET", "R_ANT_LINK.pin1"], 0.8],
["ANT_FEED", ["R_ANT_LINK.pin2", "ANT_SIM.pin1"], 0.8],
["CHG_VIN", ["TP_IN_P.pin1", "R_NTC_TOP.pin1"], 0.3],
["CHG_TEMP", ["R_NTC_TOP.pin2", "R_NTC_BOT.pin1", "J_NTC.NTC_TEMP", "TP_TEMP.pin1"], 0.3],
["CHG_GND", ["TP_IN_N.pin1", "R_NTC_BOT.pin2", "J_NTC.NTC_RET"], 0.3],
["GPS_TX", ["J_GPS.TX", "J_ESP_TOP.G16"], 0.3],
["GPS_RX", ["J_GPS.RX", "J_ESP_TOP.G17"], 0.3],
["BTN_TRACK", ["SW1_TOP.A1", "SW1_TOP.A2", "J_ESP_TOP.G18"], 0.3],
["BTN_CAP", ["SW2_TOP.A1", "SW2_TOP.A2", "J_ESP_TOP.G19"], 0.3],
["LED_TRACK_DRIVE", ["J_ESP_BOT.G25", "R_LED1.pin1"], 0.3],
["LED_TRACK_A", ["R_LED1.pin2", "LED_TRACK.ANODE"], 0.3],
["LED_CAP_DRIVE", ["J_ESP_BOT.G26", "R_LED2.pin1"], 0.3],
["LED_CAP_A", ["R_LED2.pin2", "LED_CAP.ANODE"], 0.3],
] as [string, string[], number][]).flatMap(([net, pins, width]) => pins.map(pin => {
const [component, label] = pin.split(".")
return <trace key={`${net}_${component}_${label}`} name={`${net}_${component}_${label}`}
from={`.${component} > .${label}`} to={`net.${net}`} thickness={`${width}mm`} />
}))}
{/* TP_IN anchors carry only the charger temperature divider (never carrier GND). NET reaches
ANT_SIM through R_ANT_LINK; BOOT is only ever pulled low by Q_PWRKEY. */}
{/* Bulk capacitor feeds the modem's 2 A bursts: a hand-routed full-width trace (left of
the cap's own GND pin, down the clear x=-24 column, into VCC). Autorouted runs necked
to 0.325-0.55 mm (13-17 mV at 2 A). */}
<trace name="VBAT_BULK_TO_MODEM" from=".C_BULK > .pin1" to=".J_SIM_RIGHT > .VCC" thickness="1.6mm"
pcbPath={[".C_BULK > .pin1", { x: -1.75, y: -2.5 }, { x: 8.5, y: -2.5 }, { x: 11, y: 0.7 }, ".J_SIM_RIGHT > .VCC"]} />
{/* Charger protected return (TP_OUT_N) to the ESP32 GND pin, hand-routed: the autorouted
stub crossed the switched-battery corridor (a VBAT-GND short). Top to a via at (30,-5),
then bottom (GND pour layer) up to y=-0.5, under the ESP32 row, into its GND pin; >2 mm
from the underside battery-connector pins. Offsets are relative to TP_OUT_N (33,-8.5). */}
<trace name="GND_CHARGER_RETURN" from=".TP_OUT_N > .pin1" to=".J_ESP_BOT > .GND" thickness="1.6mm"
pcbPath={[".TP_OUT_N > .pin1", { x: -3, y: 3.5 }, { x: -3, y: 3.5, via: true, fromLayer: "top", toLayer: "bottom" },
{ x: -3, y: 8 }, { x: -9, y: 8 }, ".J_ESP_BOT > .GND"]} />
{/* pcbPath offsets are in C_BULK's rotated frame (origin = its centre, x' = y, y' = -x):
board waypoints (-24, 1.75) -> (-24, -8.5) -> (-20.8, -11) -> VCC (-18.5, -12.19). */}
<copperpour connectsTo="net.GND" layer="bottom" padMargin="0.35mm" boardEdgeMargin="0.5mm" />
<silkscreentext text={`BONYO CARRIER ${REVISION}`} pcbX={-22} pcbY={-33.6} fontSize={0.9} />
{/* Electrolytic polarity: pin1 (+, VBAT) is at board (-21.5, +1.75). */}
<silkscreentext text="+" pcbX={-23.6} pcbY={1.75} fontSize={1.4} />
<silkscreentext text="VIN NC / EXT REG 3V3" pcbX={12} pcbY={5} fontSize={0.8} />
</board>
)
}