Skip to content

Circuit Design and Device Engineering

github-actions[bot] edited this page Nov 29, 2026 · 3 revisions

Hardware Hacking ยท Repository Index

Design a low-voltage embedded device from a block diagram through PCB bring-up. The running example is a handheld environmental and GNSS logger with USB-C, an ESP32-S3 module, an IยฒC sensor, a small SPI display and microSD. A first revision can run from USB. Add battery power once the basic board works.

In This Guide

Requirements & Architecture

Write down the available input power, run time, peak current, USB role, display resolution, logging rate, connector positions and firmware recovery method. Draw a pin map with GPIO number, net name, voltage, direction, reset state and peripheral assignment. Reserve boot straps, flash/PSRAM pins and the programming interface before assigning the display and storage.

flowchart TD
  USB["USB-C receptacle"] --> Protect["Input protection"]
  Protect --> Path["Charger and power path"]
  Cell["Protected 1S battery"] <--> Path
  Path --> Rail["3.3 V regulator"]
  Rail --> MCU["MCU module"]
  USB --> PHY["USB data and ESD protection"]
  PHY --> MCU
  MCU --> UI["Display and controls"]
  MCU --> SD["microSD"]
  MCU --> Sensors["IยฒC sensors and UART GNSS"]
Loading

The battery branch is optional. A USB-only board feeds the regulator from protected VBUS. Give each schematic block a named supply and annotate its maximum voltage and current. Track worst-case simultaneous loads, such as a backlight at full brightness, a card write and MCU activity.

Power Supplies, Charging & Protection

Circuit When to use it What to review
LDO Small voltage drop, modest current or a low-noise sensor rail Verify dropout at peak current and temperature, allowed output capacitor and heat. Dropping 5 V to 3.3 V at 300 mA dissipates about 0.51 W in the regulator.
Buck Input stays above the output with enough headroom and efficiency matters Use the reference layout. Keep the input capacitor and high-current switching loop close, and keep feedback away from the switch node.
Boost Output must exceed input across its operating range Check input current at minimum battery voltage, output disconnect and how a short is handled.
Buck-boost Input crosses the output voltage in normal operation A 1S cell can cross a 3.3 V rail as it discharges. Size for peak current at low cell voltage and check quiescent draw.
Load switch A display, card or sensor needs sequencing or power cycling Check inrush, reverse current and whether GPIOs can back-power the device while its rail is off.
Fuse or eFuse An input can be overloaded or shorted Match its ratings to the source and downstream parts. Check current-limit tolerance, startup behavior, thermal limits and fault recovery.
Ideal diode or power mux More than one supply can feed the board Check reverse blocking, priority and switchover. Verify that external power cannot feed into USB VBUS.
TVS or ESD diode User-accessible connectors can receive transient discharges Match the working voltage and clamp behavior to the protected circuit. Use low-capacitance protection on fast data lines and a short return path near the connector.

Use local decoupling at each IC and size bulk capacitance for actual load steps and regulator stability. Account for DC-bias derating of ceramic capacitors. For runtime, estimate usable battery energy in Wh, multiply by average conversion efficiency and divide by average load power in W. Measure actual sleep and active current at the battery input to refine the estimate.

For a rechargeable handheld, start with a documented protected single-cell pack and a charger matched to its chemistry, termination voltage, charge current and temperature limits. Pack protection and charger regulation serve separate functions. Prefer a charger with a system power path for charge-while-running. A load attached directly across the battery can confuse termination on a basic charger. Follow the charger reference schematic for the thermistor, input limit, thermal pad and system output. Check the system output range against the downstream regulator. A linear charger can throttle when the battery is low and the enclosure traps heat. For initial bring-up, leave the pack disconnected and use a current-limited bench source on the designated input. Verify charger behavior with a suitable battery simulator or the specified pack and manufacturer test procedure.

TI BQ24074 power-path charger & datasheet

Turn Power Calculations Into Bench Checks

  • Power budget. A 180 mA logic load on a 3.3 V rail uses 594 mW. At 85% conversion efficiency and 3.7 V input, the converter draws about 189 mA before accounting for separate loads. Repeat at minimum input voltage and peak simultaneous load, then measure the rail under load.
  • Capacitor response. For an ideal capacitor, a 100 mA load step lasting 20 ยตs discharges 47 ยตF by about 43 mV. Add the immediate ESR drop and account for effective capacitance, wiring inductance and regulator response. Scope at the load rather than only at the regulator output.
  • Transistor as a switch. For a low-side MOSFET driving a backlight or buzzer, pick a part with on-resistance specified at your actual gate drive voltage. Add a gate bias that keeps it off during reset. Use an appropriate flyback path for inductive loads.

USB-C Data, Power & PD

Port role Schematic decisions Bench checks
USB-C sink with USB 2.0 device data For a fixed sink with resistor-based CC detection, use a separate nominal 5.1 kฮฉ Rd from CC1 and CC2 to ground. Join each duplicate receptacle USB 2.0 signal to its matching D+ or Dโˆ’ net near the connector. Use the MCU vendor's PHY circuit, VBUS-sense scheme and ESD guidance. Enumerate with both plug orientations and more than one known data cable. Check attach, detach and backfeed with external power present.
USB-C sink with PD Choose a sink controller whose requested profiles match the load. Design the VBUS path for the highest negotiated voltage and the startup state before a contract. Feed high-voltage VBUS to input stages rated for it. An MCU USB PHY still handles USB data. Test default 5 V startup, unsupported profiles, renegotiation and detach. Verify VBUS before enabling a load that needs a higher contract.
USB host or dual-role port Budget a protected VBUS source switch, current limiting and role control. Confirm that the controller, PHY and firmware support the required roles. Test role transitions, overcurrent behavior and a powered peripheral.

USB data capability, Type-C current advertisement and USB PD contracts are separate. Make the board work within the source's allowed current and do not assume that seeing 5 V grants 3 A. Keep D+/Dโˆ’ over a continuous reference plane and follow the PHY and fabricator stackup for differential impedance. Minimize stubs and avoid routing through plane gaps. Place connector-side protection first in the signal path. A power-only Type-C sink still needs valid CC termination.

USB-IF specifications ยท Espressif ESP32-S3 Hardware Design Guidelines

Wiring, Network Connectors & Data Cables

Choose the link by what both endpoints need to do. Record the connector at each end, electrical interface or protocol, required data rate, power or PoE, and cable length. Make a separate pin map for any custom harness. A connector that fits can still carry a different signal or voltage.

flowchart TD
  Job{"What must the cable do?"}
  Job --> Network["Network link ยท media, rate, optics or PoE"]
  Job --> Computer["Computer peripheral ยท data, display and power"]
  Job --> Bench["Board harness ยท pinout, voltage and return"]
  Network --> Verify["Check both endpoints and test with a known-good link"]
  Computer --> Verify
  Bench --> Verify
Loading

Copper Network Wiring

Connector Common use What to check
8P8C, commonly called RJ45 Twisted-pair Ethernet Confirm the port is Ethernet. Serial console ports may use the same connector with a different pinout. Check cable category, link rate, length and PoE.
RJ11-style six-position modular plug Telephone or DSL Check the actual line assignment and number of fitted contacts. An analog phone line can carry ringing voltage. Keep it away from low-voltage GPIO test equipment.
BNC Coaxial video, test gear and legacy 10BASE2 Ethernet Confirm the required impedance and termination. Legacy 10BASE2 uses 50 ฮฉ coax. Many video systems use 75 ฮฉ. Matching the plug shape alone can produce reflections.
SFP-family direct-attach copper Short switch-to-switch or switch-to-server links Match the port form factor, supported rate, vendor compatibility, passive/active cable support and length.

For new twisted-pair runs, Cat 5e is a common choice for 1000BASE-T and Cat 6A supports a standards-compliant 10GBASE-T channel up to 100 m. Follow the installation rating and channel requirements, especially for patch lead length, PoE bundles and existing Cat 6 runs. Use solid conductors for permanent runs and flexible stranded patch leads where movement is expected. Match terminations to cable construction and follow the installation design for shielding and bonding.

Wiring standard Pins 1 through 8 in order
T568A White/green, green, white/orange, blue, white/blue, orange, white/brown, brown
T568B White/orange, orange, white/green, blue, white/blue, green, white/brown, brown

Use the same scheme at both ends for a straight-through cable. Confirm connector orientation on the manufacturer's drawing before counting pins. Keep the twists close to the termination. A split pair can pass a basic continuity check, so use a wiremap tester with split-pair detection. On a production run, certify the channel for its intended category. If a gigabit link negotiates at 100 Mb/s, check both port settings and test all four pairs with a known-good patch lead and wiremap tester before changing switch configuration. Match IEEE PoE compatibility across switch, injector and device. Verify vendor-specific passive injectors separately, since they can apply power without IEEE PoE detection.

For selecting a monitoring point after confirming the physical link, see Network TAPs & Packet Visibility.

Fiber & Optical Transceivers

Connector What it looks like or how it mates Common uses
LC Small latch, 1.25 mm ferrule, simplex or duplex Many SFP-family optical modules
SC Push-pull housing, 2.5 mm ferrule, simplex or duplex Telecom and premises links, including some fiber-to-the-home systems
ST Bayonet twist, 2.5 mm ferrule per connector Legacy building links and industrial equipment
FC Threaded coupling, 2.5 mm ferrule per connector Legacy single-mode systems and optical instruments
MT-RJ Small latch with two fibers in a shared rectangular ferrule Legacy duplex premises links
MPO / MTP Keyed push-pull array with a multifiber ferrule Parallel optics and high-density trunks. MTP is a branded implementation of MPO.

The supplied connector chart is a visual starting point. LC and SC can be used with one or two fibers, and the MT-RJ and MPO entries use shared rectangular ferrules. A single-fiber connector such as ST or FC can still be used as a pair for a duplex link. Connector choice follows the installed optics and cabling, so match transceiver type and rate, wavelength, fiber class, polish and polarity before buying.

  • Duplex link. Match both transceivers and connect each transmitter to the opposite receiver. Match multimode or single-mode fiber to the specified optics and calculate optical loss across the complete path.
  • Single-fiber BiDi. Order complementary transmit/receive wavelengths as a matched pair. Confirm the connector and polish at each end. APC and UPC terminations must not mate directly.
  • Parallel MPO link. Verify the required fiber count, pinned or unpinned ends, key orientation and end-to-end polarity using the transceiver and trunk documentation. A matching shell provides no assurance of lane alignment.
  • First inspection. Disable optical sources before handling or inspecting the link. Use appropriate fiber inspection tools and the inspect-clean-inspect procedure. Never look into a connector or transceiver. Check the switch's optical diagnostics against the supported range, and verify the path with optical test gear as needed.

The Fiber Optic Association reference guide ยท Chart publisher

USB, USB-C, Thunderbolt & Lightning

Cable or interface Selection rule Quick verification
USB-A to USB-B, Mini-B or Micro-B Match the device receptacle precisely. Select a data cable for instruments, serial adapters and firmware recovery. SuperSpeed USB-B and Micro-B have distinct connectors from their USB 2.0 counterparts. Verify device enumeration before starting a flash or acquisition.
USB-A to USB-C Useful for USB peripherals or firmware tools on an older host. Check the cable and devices for data rate and charging compatibility. A successful charge does not establish that data works. Verify enumeration.
USB-C to USB-C Check the required data rate, wattage and display or tunneling support separately. USB 2.0-capable C-to-C cables can still carry high charging power. USB4 and display features depend on the equipment and cable. Check the vendor or USB-IF markings and the negotiated rate or display mode. Try both orientations while diagnosing a suspect port.
Thunderbolt 1 or 2 Mini DisplayPort-shaped connection. Verify explicit Thunderbolt support and any required adapter. A Mini DisplayPort cable or port alone provides no Thunderbolt connection.
Thunderbolt 3, 4 or 5 USB-C-shaped connection. Select a certified cable for the required generation and length and verify host and peripheral support. Thunderbolt 4 supports 40 Gb/s link capability. Thunderbolt 5 supports 80 Gb/s bidirectionally and up to 120 Gb/s in one direction with Bandwidth Boost. Confirm the dock or SSD enumerates as intended. Verify downstream display, USB and charging independently.
Lightning Apple connector used by specific devices and accessories. Use a compatible data-capable Apple or MFi cable for sync and recovery. Check any adapter's supported functions. Verify the phone or accessory appears on the host. For USB-C Apple devices, check the model's documented USB rate.

For a recovery kit, label a known-good USB 2.0 data lead, a cable rated for the SSD or dock, and any dedicated charging cable separately. Check connector fit, data support and negotiated speed before treating a failure as firmware or storage trouble. On Linux, compare lsusb -t before and after connecting a known device. Avoid relying on an adapter chain for first bring-up.

USB-IF cable markings ยท Intel Thunderbolt technology ยท Apple USB-C to Lightning adapter capabilities

Custom Wiring & Board Harnesses

  1. Record the pinout from both ends. Label connector IDs, pin 1, mating-face view, voltages, direction and return paths. Use a keyed housing with strain relief when a reversed connector could cause damage. Check every conductor, including ground and shield, against the harness drawing before powering the board.
  2. Size power conductors and contacts for peak current. Evaluate wire gauge, connector rating, installed length, voltage drop and temperature. Include the return conductor in the loop resistance. On the two-board logger, measure 3.3 V at the panel with the backlight at full brightness.
  3. Keep signal types separate. Short jumper leads suit slow bench signals. For a longer link, use the interface and cable specified for that environment, such as a matched differential pair for RS-485. Keep USB and Ethernet pairs intact. For a USB-to-UART adapter, check TTL voltage versus RS-232 levels, cross TX/RX, connect signal ground and verify whether the adapter's power pin should remain disconnected.
  4. Test unpowered, then under load. Check continuity, shorts, polarity and end-to-end orientation. Apply current-limited power and check voltage at the load. Use the oscilloscope or protocol-specific tester for intermittent or speed-dependent faults.

O.MG Cables, USB Data Blockers & Forensic Write Blockers

Comparison of data-capable, charge-only and forensic write-blocked USB paths

For device selection, validation and imaging workflows, see Drive Assessment & Forensic Write Blocking.

Item Purpose Verification
O.MG cable or another cable with embedded electronics A cable can look ordinary and still present an unexpected USB device. Treat unknown or unattended cables as untrusted. Use known inventory and a trusted charger. For suspected exposure, preserve the cable and review USB device events and endpoint alerts. Do not test the cable on a production or evidence workstation.
Charge-only cable or USB data blocker Prevents supported data paths from reaching the host while allowing compatible charging. Test with a trusted host and known data device. Confirm charging and absence of device enumeration in both orientations where applicable. Verify which data lanes and PD modes the exact product supports.
Forensic hardware write blocker Allows a compatible evidence drive to be read while blocking writes from the acquisition host. Match the evidence interface and blocker firmware. Validate first on sacrificial media, record model and firmware, and check applicable NIST test results. Preserve acquisition logs and hashes.
Filesystem read-only mounting Controls how the OS mounts a filesystem for routine inspection. Record acquisition controls separately. Read-only mounting alone does not provide the same enforcement as a validated forensic write blocker.

Use data blocking for charging and write blocking for reading evidence. If a data blocker stops a drive from enumerating, it cannot serve as a forensic write blocker. On the evidence bench, verify your specific drive, bridge and blocker combination with test media before attaching the original. For incident response, disconnect a suspect cable, label it and preserve it under your evidence process. Retain connection timestamps and USB events when investigating an unexpected keyboard, network or storage device.

Hak5 O.MG cable product reference ยท NIST CFTT hardware write-blocker test reports ยท Cyberdeck evidence handling

Memory, Storage & Displays

Block Design choices First test
NOR flash & PSRAM Select an MCU module with the required flash and RAM for the first revision. Verify the specific SKU, memory voltage, reserved GPIOs and boot configuration. Budget flash for firmware, two update slots if required, and configuration. Budget RAM independently for queues and framebuffers. Read the detected capacity and run a memory test before connecting peripherals.
EEPROM or FRAM Use for settings, calibration or counters. Check voltage, addressing, write endurance, and persistence under brownout. Use versioned records and a checksum. Interrupt power during a settings write and verify recovery to a valid record.
microSD in SPI mode Uses clock, MOSI, MISO and chip select. Verify startup bias, card supply range and socket detection. On shared SPI check MISO release, inactive chip selects and per-device clock/mode settings. Mount a known card, write and read back a file, then repeat while refreshing the display.
microSD in native SD mode Use an MCU host supporting the chosen bus width. Follow host guidance for bias, routing, I/O voltage and supported speed modes. Check card power transients at the socket. Test multiple supported cards, sustained writes and recovery after abrupt power loss.
eMMC Consider for soldered storage when the MCU supports it. Check I/O and core rails, package assembly and manufacturing access. Verify cold boot, sustained transfers and failure reporting.
SPI TFT or IยฒC OLED Verify controller, supply and logic voltage, reset timing and pinout. A TFT may need a separate backlight current driver. For SPI, account for display refresh traffic sharing the bus. Draw color bars and verify full-brightness current and sleep current.
Parallel RGB, MIPI DSI or HDMI Match the processor's display peripheral and the panel's exact timings, pinout and voltage. DSI and HDMI require compatible PHYs or bridges and vendor routing guidance. Check panel enable, reset and backlight sequencing. Start with a fixed test pattern, then test across power cycles and cable movement.

A 320 ร— 240 RGB565 framebuffer uses 153,600 bytes before alignment or double buffering. A clipped update or line buffer can reduce RAM use and bus load. For removable storage, keep write batches bounded and close or sync files at defined intervals. Test removal and sudden power loss using disposable media. A filesystem sync request alone cannot guarantee that a card has finished internal writes.

SD Association simplified specifications

Signal Chains, Buses & External Interfaces

Interface Typical circuit Layout or bring-up check
IยฒC Open-drain SDA/SCL with one effective pull-up per line for each voltage domain. Use a suitable bidirectional translator between incompatible domains. Account for all breakout pull-ups in parallel and all bus capacitance. Check address conflicts, voltage and rise times with an oscilloscope.
SPI SCLK, output, input and one chip select per peripheral. Park inactive selects during reset. Check mode, clock limit and MISO tri-state. Provide source-series resistor footprints where edge ringing warrants tuning.
UART Cross TX/RX between endpoints and share ground. Use the correct logic level or a transceiver for RS-232/RS-485. Verify idle polarity, baud and reset output. Give GNSS time pulse a dedicated input if the application uses it.
CAN or RS-485 Use a bus transceiver and follow its reference design for protection and termination. Terminate at the physical ends as specified for the network. Verify topology, polarity, common-mode range and reference path.
Analog input Sensor or divider โ†’ protection and/or buffer โ†’ RC anti-alias filter โ†’ ADC. Verify input range, source impedance against ADC acquisition time, reference noise and calibration. Keep sensitive traces away from switching nodes and digital clocks.
Buttons, LEDs & buzzers Define input bias during reset. Set LED current with a resistor or driver. Drive inductive loads with an appropriately rated transistor and clamp. Check active polarity, debounce, reset behavior and worst-case GPIO current.

For IยฒC, estimate the upper pull-up resistance as allowed rise time divided by 0.8473 ร— bus capacitance. Estimate the lower bound as (pull-up voltage โˆ’ maximum low-level voltage) divided by the permitted sink current of the least capable device. Select within both bounds and measure on the assembled board. A logic analyzer can decode transactions, while a scope can show slow edges and ringing.

NXP UM10204 IยฒC specification

Worked Example โ€” Measure a 1S Battery With an ADC

Schematic of a battery voltage divider with two 47 kฮฉ resistors and a 100 nF capacitor from the sense node to ground

In this conceptual circuit, a 4.2 V battery gives a nominal 2.1 V at the ADC. The divider draws about 45 ยตA and presents 23.5 kฮฉ to the ADC. With 100 nF, the RC time constant is about 2.35 ms. Budget roughly 12 ms for five time constants after a step before taking a baseline reading. Check that 2.1 V is within the selected ADC range and that the ADC can settle at that source impedance. Compare readings against a DMM at several voltages and account for resistor tolerance, ADC calibration and leakage. If the battery stays connected while the MCU is off, verify the ADC pin's unpowered limits or isolate the sense path. This circuit measures voltage and the pack still needs its independent protection.

Device Programming & Firmware Recovery

  • Expose the MCU's supported ROM boot path. On the ESP32-S3, follow Espressif's schematic for EN/reset, boot straps and programming. Keep a usable boot/recovery path with peripherals connected, including a UART header or pads where practical.
  • For other MCU families, check vendor pinouts for SWD or JTAG. A basic SWD connector generally needs SWDIO, SWCLK, ground and target voltage reference, with reset as appropriate. Confirm whether the voltage reference is an input on the probe before connecting power.
  • Give each processor on a dual-MCU design its own documented reset, programming access and firmware target. Define which processor owns each shared peripheral and when pins become high impedance.
  • Record hardware revision, pin map, memory SKU, partition layout, required programmer and expected boot log. For updates, test a corrupted image, interrupted update, version mismatch and recovery. Validate signed boot and locking options on development hardware before irreversible production provisioning.
  • Add labeled test points for ground, input power, each rail, reset and programming signals. Ensure they are reachable with the enclosure open and the battery disconnected.

Espressif esptool documentation ยท Bus Pirate guide

Design Software & Component Libraries

Tool or source Use
KiCad & official libraries ยท KiCad tutorials ยท Subsystem tutorials ยท Parts & fabrication Open-source schematic capture, PCB layout, ERC/DRC, 3D fit checks and manufacturing exports.
EasyEDA Schematic and layout with supplier-linked libraries. Check exact stock part, package and assembly availability independently.
Altium Designer Commercial PCB design with managed libraries and team workflows.
LTspice & ngspice Simulate filters, regulator transients and circuit behavior with appropriate models. Validate assumptions on hardware.
SnapMagic Search & Ultra Librarian Download candidate symbols, footprints and models when the built-in library lacks a part.
Manufacturer datasheets, evaluation board files & CAD downloads Verify pinout, package variant, land pattern, exposed-pad connection and actual mechanical dimensions.

Save verified symbols and footprints with the project. For every imported part, compare pin numbers, pin 1, pad sizes, body outline, polarity and connector orientation against the exact datasheet and mechanical drawing. A correct-looking 3D model says little about pad numbering. Confirm the pick-and-place rotation and the manufacturer part number in the BOM before ordering.

Online Circuit Simulators & Interactive Lessons

Tool Best fit for this guide Where to verify the result
Brilliant Circuits Interactive lessons and practice problems for current, voltage, resistance, power and circuit analysis. Start here if you want practice before drawing your own circuit. Create and measure your own circuit in a simulator or on a breadboard after completing the lesson.
Falstad CircuitJS ยท CircuitJS source Draw the battery divider and RC filter in a browser. Inspect node voltages and capacitor charge and discharge curves. Check the real ADC's acquisition limits, leakage and voltage range separately.
Wokwi ยท ESP32 support and peripheral matrix Prototype ESP32-S3 firmware with supported buttons, displays and sensors. Check the peripheral matrix for the chip and feature you need. Measure regulator behavior, RF performance, and signal integrity on hardware.
Tinkercad Circuits Lay out a virtual breadboard for the button, LED and series resistor exercise. Check the real LED's forward voltage, GPIO current rating and behavior at reset.

Compare a prediction with a trace. In CircuitJS, connect two 47 kฮฉ resistors as a divider and put 100 nF across the lower resistor. Drive the input with a step from 0 V to 4.2 V and start with the capacitor discharged. Plot the midpoint. It should settle near 2.1 V and reach about 1.33 V after one time constant (2.35 ms). Then build the coupon in the KiCad tutorial and compare the scope trace. A DMM can check the final voltage, while the scope shows the transition. Use datasheet models and bench tests for switching regulators, charge termination, USB negotiation and radio performance.

KiCad Tutorials โ€” From Circuit to PCB

Use the official Getting Started tutorial for your installed KiCad release. The documentation also links the Schematic Editor, PCB Editor, and Gerber Viewer manuals. The official part libraries contain symbols, footprints and 3D models. The KiCad Library Conventions describe how those parts are drawn and checked. Use the manufacturerโ€™s package drawing when verifying a specific component.

flowchart TD
  Requirements["Requirements and pin map"] --> Schematic["Schematic and footprint mapping"]
  Schematic --> ERC{"ERC and schematic review pass?"}
  ERC -->|"Revise"| Schematic
  ERC -->|"Pass"| Layout["Placement and routing"]
  Layout --> DRC{"DRC and mechanical review pass?"}
  DRC -->|"Revise"| Layout
  DRC -->|"Pass"| Fabrication["Gerbers, drills and board review"]
Loading

Tutorial 1 โ€” Lay Out the Battery Sense Circuit

Build the battery divider and ADC filter as a small bench coupon. The coupon uses a current-limited bench supply in place of the cell and connects to a separately powered ADC board for measurement.

  1. Capture the schematic. Create a new project. Place a two-pin input connector, R1 and R2, C1, and a two-pin output connector. Wire input pin 1 through R1 to SENSE. Connect R2 and C1 between SENSE and GND. Put SENSE and GND on output pins 1 and 2. Use 47 kฮฉ for both resistors and 100 nF for C1. Label the input and output nets and annotate the components. Run ERC and inspect each finding. If your ground symbol triggers a power-source warning because the input connector is passive, add PWR_FLAG to the externally driven ground net after confirming that source.
  2. Assign footprints. Choose resistors and a capacitor in a package you can assemble, such as 0805. Assign connectors with the actual pitch, mounting style, mating direction and pin 1 from the selected part drawing. If a part is missing, create project-specific symbol and footprint libraries. Add them through the project-specific library tables using paths relative to ${KIPRJMOD}. Keep the symbol, footprint, license and datasheet link with the project. Check every symbol pin against its footprint pad.
  3. Place and route. Use Tools โ†’ Update PCB from Schematic. Draw one closed outline on Edge.Cuts; enter the fabricatorโ€™s clearances and minimum track, via, and drill sizes in Board Setup. Place the connectors for probe access, keep the sense node short, and put C1 next to the output. Add a ground zone and refill it after routing. Provide labeled pads for input, sense, and ground. Use the 3D Viewer and a 1:1 print to confirm orientation and connector clearance.
  4. Check and export. Run DRC and fix unconnected items and clearance violations. Plot Gerbers, generate drill files, and reopen the outputs in Gerber Viewer. Verify the copper, mask openings, legend orientation, outline and hole alignment. Record component values, footprints and part numbers in the BOM.
  5. Measure. Confirm continuity with power off. Apply 3.0 V, 3.7 V and 4.2 V from the bench supply and measure approximately 1.50 V, 1.85 V and 2.10 V at SENSE. Then attach a separately powered, compatible ADC with common ground. Compare readings and observe the node with a high-impedance probe after a voltage step. Evaluate measurement loading and ADC acquisition time before putting the circuit on the logger.

Tutorial 2 โ€” Design a Single PCB With Multiple Circuits

Use the logger architecture as the projectโ€™s root sheet. Make one physical PCB and use hierarchical sheets to keep the schematic readable.

Hierarchical sheet Draw and review First functional check
USB input & power USB-C sink, input protection, regulator and power flags on externally supplied rails where needed. Add the charging and battery power-path sheet for a later revision. Verify source voltage, idle current and 3.3 V under a controlled load.
MCU & recovery Module power pins and decoupling, reset, boot straps, USB data and labeled programming pads. Check the exact module pinout before assigning GPIO. Flash a minimal image and confirm that reset and recovery work with every peripheral attached.
Storage & display Shared SPI where practical, independent chip selects, correct reset bias and display backlight driver. Use separate buses if the card and display fail combined-load tests. Write and read a test file while updating the display. Scope the card supply during writes.
Sensors & voltage sense IยฒC pull-ups, analog filter and test points, and GNSS UART if fitted. Expose only the needed ports on the parent sheet. Check IยฒC edge timing and compare ADC measurements against a DMM.

Connect the parent sheetโ€™s ports deliberately. Use hierarchical labels for sheet interfaces and reserve global labels for nets intended to cross the entire project. Review all exports in the schematic before pressing Update PCB from Schematic. In the board editor, place the USB and power circuitry near the input, isolate the MCU antenna keepout, keep high-current loops compact, and place the analog network away from switching and digital clocks. Follow the MCU reference layout and board fabricatorโ€™s stackup for USB routing. Treat ERC and DRC as checks on the model, then measure power, signal levels, and temperature on assembled hardware.

Tutorial 3 โ€” Split the Logger Into a Baseboard & a Front Panel

Conceptual PCB placement showing the USB, power, MCU and microSD on the baseboard and the display, controls and sensor on a separate front panel

  1. Choose the split based on enclosure and signals. Keep USB data, microSD and the switching regulator local to the baseboard. Move the SPI display, buttons, backlight driver and IยฒC sensor to the front panel. Start with a short cable and conservative bus speeds. Consider a different interconnect if signal quality fails at the installed cable length.
  2. Freeze the connector contract. Use a keyed mating pair and specify its pin 1, cable orientation, voltage, signal directions, return paths, reset states and revision. The example below assumes a write-only 3.3 V display and a local backlight driver. Check actual display logic, connector current rating and voltage drop under full brightness before using this pinout.
  3. Design two KiCad projects. Each project gets its own schematic, board outline and production outputs. Use the shared connector contract in both schematics. Review connectors end to end against the harness drawing, including a possible cable reversal or mirror orientation. ERC and DRC run per project, so compare the two pin tables separately. Export STEP for both boards to check standoffs, cable bends and connector clearance in the enclosure.
  4. Test each board before mating. Power the baseboard on the bench first. Check the panel using a current-limited 3.3 V supply and suitable test firmware or fixture. Check cable continuity and ground before connecting the boards with power off. Test at the final cable length while updating the display, reading the sensor and writing to microSD. Probe clock edges and measure rail droop at the panel. For the IยฒC bus, account for cable capacitance and the parallel effect of all pull-ups.
Example pin Net Direction & reset notes
1 3V3_PANEL Base โ†’ panel. Size for display and backlight peaks.
2, 4, 12 GND Return conductors. Pin 4 sits beside the SPI clock.
3, 5 SPI_SCK, SPI_MOSI Base โ†’ panel. Keep the traces and cable short.
6, 7 LCD_CS_N, LCD_DC Base โ†’ panel. Hold chip select inactive during reset.
8, 9 I2C_SDA, I2C_SCL Open-drain bus with a documented effective pull-up per line.
10 KEY_IRQ_N Panel โ†’ base. Example assumes a local IยฒC button expander with an open-drain interrupt.
11 BL_EN Base โ†’ panel. Set a defined off state during reset.

Use a display with a valid local reset circuit or add a connector pin for a dedicated reset signal. A revision that needs display reads, touch data on another bus, or hot-plug support needs a new interface review and potentially a larger connector. Document this example as a design exercise until part selection, electrical checks, and the physical prototype are complete.

KiCad Subsystem Tutorials โ€” Power, Interfaces & Connectivity

These exercises expand the single-board logger. Build and validate each circuit on its own before joining it to the rest. Use the same net names in KiCad, your pin map and firmware. The rail and interface names below are examples. Select exact part numbers and check ratings before drawing the final schematic.

1. USB Input & Regulated Power

  1. Draw the input sheet. On a fixed 5 V USB-C sink, use the CC terminations in USB-C Data, Power & PD. Separate raw VBUS from 5V_IN with a current-limited input stage appropriate for your USB source and startup load. Select VBUS transient protection for the operating voltage and required clamp. Put connector ESD parts near the receptacle. Connect the data lines and VBUS sense using the module's USB reference design.
  2. Draw the regulator sheet. For a 5 V bench-powered 3.3 V board, choose a buck regulator with suitable input range and enough load margin for the radio, display and card. Start from the chosen ICโ€™s application circuit and recommended layout. Recalculate component values for your input range and load. In KiCad, keep the input capacitor against VIN and its power return, the switch-node copper compact, and the feedback connection away from the switch node. Keep an uninterrupted reference plane for the USB pair. Check the enable and soft-start states.
  3. Verify on the bench. With the battery absent, test continuity, then power the designated input with a current-limited supply. Confirm idle input current and 3.3 V at the MCU and card. Add a controlled load, then test USB enumeration in both plug orientations. Scope the rail at the loads during startup and a combined card write and display refresh.

2. Step Down, Step Up & Maintain a Rail as the Battery Falls

Exercise Source & load Example part to study What to prove
Step down 5 V input to 3.3 V logic TI TPS62160 buck Startup and regulation at the lowest allowed input voltage, including the cable drop.
Step up 1S system rail to a separate 5 V accessory TI TPS61023 boost Output current at lowest input, quiescent current and whether disable isolates the load.
Buck-boost 1S system rail to regulated 3.3 V logic TI TPS63070 buck-boost Regulation below, near and above 3.3 V, plus behavior when input drops below the system cutoff.

Draw one technology per power rail. Use the IC's reference values and check inductor saturation current, ceramic capacitor derating, thermal performance and the feedback network before ordering. For a 5 V accessory drawing 300 mA, the load is 1.5 W. At 3.0 V input and assumed 85% efficiency, the boost stage draws about 0.59 A on average. Size the source and connector for that demand plus startup and other loads. Use the datasheet to calculate inductor peak current separately. Test at low, nominal and high input voltage with a bench supply and a controlled load. Keep the accessory output distinct from USB input VBUS.

3. Battery Charging & Running the Board at the Same Time

flowchart TD
  USB["Protected 5 V USB input"] --> Charger["1S charger with power path"]
  Charger <-->|"BAT pin"| Pack["Specified protected 1S pack"]
  Charger -->|"SYS or OUT pin"| Reg["3.3 V buck-boost"]
  Reg --> Load["MCU, display, sensor and storage"]
  Temp["Pack temperature sensor"] --> Charger
Loading
  1. Battery and charger. Choose a protected pack and a charger that matches its allowed charge voltage, current and temperature range. Use the connector polarity specified by the pack vendor. Follow the charger's reference design for the battery thermistor, limits, status pins and thermal pad. The TI BQ24074 is a concrete example of a 4.2 V single-cell charger with a separate system output. Charge-while-running measurement points at protected VBUS, charger OUT, the battery terminal and the regulated 3.3 V rail

    With the bench supply current-limited, use one verified circuit ground as the voltage reference. Observe points 2 and 4 together during USB removal. Stable charger OUT with a dip at point 4 directs attention to the regulator or its load. A dip at both points directs attention upstream to the power path or pack. Use the battery manufacturerโ€™s and chargerโ€™s limits when setting test conditions.

  2. Charge while operating. Connect the regulator to charger SYS or OUT, according to the datasheet. The system load and charge current must share the input budget. Set input and charge limits from the actual USB entitlement, pack and thermal design. Check when the charger reduces charge current or allows the pack to supplement the load. Verify the system output's full range, including battery-only operation. Use a controller and power stage rated for the application if adding PD voltages.

  3. Measure the modes. With the board loaded and USB connected, observe input current, charger status and charge termination. Confirm rail stability during USB removal and reconnection. Check operation without a cell only if the charger supports it. Use a suitable battery simulator or the specified pack and the manufacturer's test procedure. Test enclosure temperature and low-battery shutdown under simultaneous screen, storage and network activity.

4. Buttons, Indicator LEDs & Touchscreen

  1. Button sheet. Draw an active-low momentary switch to ground with an external pull-up to 3.3 V where the reset state matters. Add ESD protection for a cable or external button as appropriate. Choose a GPIO free of boot straps and define a firmware debounce interval from measured bounce. Verify one logical action per press and ensure a held button at power-on does not enter recovery.
  2. Indicator sheet. A red LED with approximately 2.0 V forward drop at about 2 mA on a 3.3 V rail gives a nominal resistor of 650 ฮฉ. A 680 ฮฉ starting value gives about 1.9 mA at nominal voltages. Check current using actual LED tolerances and the GPIO rating. Use a transistor or LED driver for higher current. Keep the LED status meanings visible in firmware and silkscreen documentation.
  3. Display and touch sheet. Treat an SPI TFT, its backlight and its capacitive touch controller as three interfaces. Connect display SCK, MOSI, CS, DC and reset as specified. Follow the module's LED-current requirement for the backlight, with a defined off state before PWM starts. On a typical IยฒC touch controller, budget pull-ups, reset, interrupt and any address-select behavior. Confirm logic voltage and the flex connector pinout from the exact panel datasheet. First display color bars, then exercise touch interrupts and map coordinates for every display rotation. Check whether backlight PWM or an active charger causes false touches.

5. Sensors & Trustworthy Readings

flowchart TD
  Sensor["IยฒC sensor or analog front end"] --> Capture["Read sample, timestamp and status"]
  Capture --> Valid{"Sample valid?"}
  Valid -->|"Yes"| Cal["Convert units and apply calibration"]
  Valid -->|"No"| Fault["Record fault or stale sample"]
  Cal --> Output["Display, SD log or telemetry"]
Loading
  1. Digital sensor. For a 3.3 V IยฒC temperature and humidity sensor, draw its local bypass capacitor, SDA and SCL pull-ups, and any address pin. Document the chosen address and check for conflicts with the touchscreen. When using a breakout, include onboard pull-ups in the effective resistance. Position the sensor away from the regulator and screen backlight.
  2. Analog sensor. Use the existing battery-divider example as a second channel. Verify ADC input range over all source and fault conditions, and check conversion settling with the actual source impedance. Compare several known voltages against a DMM. For resistive sensors, evaluate bias current, self-heating and cable noise before selecting the divider.
  3. Firmware and validation. Read the sensor's identity or status where supported. Log timestamp, units, raw and converted readings during calibration. Handle an invalid response, timeout or unplugged sensor explicitly rather than displaying an old value as current. Compare readings at two or more known conditions, then repeat with the screen and radio active. Preserve raw data so a calibration change can be checked later.

6. Ethernet, Wi-Fi & Bluetooth LE

Link Schematic and layout exercise Bench exercise
SPI Ethernet Start with a documented W5500 module with magnetics and RJ45. Route compatible SPI signals, dedicated chip select, reset and interrupt, plus the module's specified supply and decoupling. Verify MISO release before sharing with the display or SD, or allocate a separate SPI controller. A chip-down RJ45 design requires the vendor PHY, magnetics, termination, ESD and isolation guidance. Connect to a lab switch. Verify link, DHCP or a documented static address, a ping to a known endpoint, and recovery after unplugging the cable. Repeat while writing to SD.
Wi-Fi Use the ESP32-S3 module's 2.4 GHz antenna and follow the keepout for the exact SKU. Keep the battery, display metal, copper and cables clear of the antenna region. Check supply transient margin under RF load. Join a known lab AP. Record reconnection time and test telemetry with the enclosure closed, then repeat during a card write.
Bluetooth LE Use the module's BLE radio. Define a small GATT service for sensor status and a separate characteristic for configuration. For settings writes, require appropriate security and authorization. Budget antenna placement and radio time jointly with Wi-Fi. Use a known test phone. Read and subscribe to sensor status, confirm unauthorized settings writes are rejected, and check reconnect after power cycling. Repeat while Wi-Fi carries telemetry.

The ESP32-S3 shares 2.4 GHz radio time between Wi-Fi and Bluetooth LE. Record latency and missed updates with each link alone and again with both active. Keep the wired and wireless link policies explicit in firmware. For a simple logger, prefer Ethernet when it has a usable route, fall back to Wi-Fi on link loss, and retain BLE for nearby setup and status. Queue local records during an outage and confirm they are delivered once connectivity returns.

WIZnet W5500 documentation ยท Espressif RF coexistence guide

7. Integrate the Circuits & Test Combined Loads

Test Record Pass when
USB insertion and removal while logging Input voltage, system rail, reset reason and SD write status Rail remains within device limits, or reset and pending writes recover as designed.
Full backlight, touch and RF activity Rail minimum, enclosure temperature, touch events and sensor readings compared with idle No unexpected reset, false touches or unexplained measurement drift.
Ethernet loss with Wi-Fi available Interface change, queued records and recovery time The device reaches its configured destination again within the design target and accounts for every queued record.
Boot with all cables and peripherals attached GPIO reset levels, module boot status and recovery access The board starts normally and intended boot recovery remains available.

Build this in stages. Verify USB power and a minimal firmware image first, add the UI and sensors second, then add storage and networking. Add the battery power path after the USB-powered version is stable. Name each power rail and connector revision in the release notes so a firmware or board change can be traced to the corresponding schematic.

PCB Layout, Fabrication & Bring-Up

  1. Prototype the interfaces. Prove the firmware against modules you can inspect. Change one peripheral at a time and log the current draw and timing under load.
  2. Place by mechanics and current loops. Set connector, screen, switch and mounting positions first. Follow module antenna keepouts across the required layers and check the enclosure and battery position. Place the switcher loop, connector protection and local decoupling before general routing.
  3. Review the board as a system. Give fast traces a continuous ground reference. Check ground returns, voltage isolation between rails, copper widths, polarity, pin conflicts and USB or SD constraints. A four-layer stackup with a solid ground plane can simplify return paths. Confirm stackup and dimensions with the fabricator.
  4. Prepare release files. Run ERC and DRC, inspect Gerbers and drills in a separate viewer, compare BOM and placement files to the board, and check enclosure fit before ordering. Version the schematic, layout, BOM, firmware pin map and assembly notes together.
  5. Power incrementally. Inspect for shorts and solder defects with power off. Apply a current-limited supply with the cell disconnected. Measure each rail, reset and idle current before attaching peripherals. Flash a small test image, then bring up USB, sensors, display and card one at a time.
  6. Test combined loads and faults. Scope the 3.3 V rail at the MCU and card while logging and refreshing the display. Try both USB plug orientations, repeated boots, SD removal with disposable media and reset with every peripheral connected. Test charging and enclosure temperature as an independent step on the battery revision.

Parts Sourcing, Fabrication & Assembly

Design around parts you can buy in the required quantity. Decide which parts the assembler will place and which you will fit by hand, especially connectors, switches, displays, batteries and programmed modules. Keep the exact manufacturer part number (MPN) separate from distributor and assembler stock codes.

flowchart TD
  Need["Define electrical and package requirements"] --> Select["Select stocked MPN and verify footprint"]
  Select --> Schematic["Record part and supplier fields in KiCad"]
  Schematic --> Export["Export fabrication and assembly files"]
  Export --> Review{"Quote and placement preview correct?"}
  Review -->|"Revise"| Select
  Review -->|"Approve"| Order["Order prototype and inspect incoming boards"]
Loading

Choose Parts Before Committing the Layout

  1. Write the minimum specifications. For a regulator, record the input range, rail tolerance, load, peak current, package and temperature. Do the same for the inductor, power capacitors and protection parts. For connectors, include pitch, mounting style, pin numbering and mating part.
  2. Search by manufacturer part number. Compare the manufacturer datasheet with listings from authorized distributors such as DigiKey, Mouser and LCSC, plus the assembler's catalog if ordering assembly. Verify the full suffix, stock for the build quantity, lot size, lead time and packaging. Ask the assembler whether a part can be sourced, reserved or supplied by you before committing to a layout.
  3. Check the complete part, not just its name. For the battery-sense coupon, choose a stocked 47 kฮฉ 0805 resistor with the required tolerance and a 100 nF 0805 capacitor with suitable voltage rating and dielectric. Assign footprints for the exact connectors you can order. For the logger's regulator, an alternate with a different pinout or exposed pad requires a circuit and layout review. Approve substitutes only after comparing electrical limits, pad mapping, height and assembly constraints.
  4. Record the fields in KiCad. In the schematic, add fields such as Manufacturer, MPN, Supplier, Supplier SKU and Assembly Part ID. Keep the verified symbol and footprint in project libraries where needed. Mark intentionally unpopulated positions as DNP and align the BOM, placement file and assembly drawing for each build variant. For hand-fitted parts, document what to order and whether the placement export should exclude them.
Sample reference What to verify before ordering Where it belongs
R1, R2 47 kฮฉ, tolerance, 0805 package and stocking identifier BOM and placement file if assembled
C1 100 nF, voltage rating, dielectric and footprint BOM and placement file if assembled
J1, J2 Connector pitch, pad pattern, orientation and mating plug BOM and assembly notes, plus placement if assembled
Test pads Footprint and accessibility PCB fabrication files

Send the Correct Files for the Service

Gerber and drill files describe the board, the BOM identifies parts, and placement data provides coordinates, side and rotation

For example, if the placement preview shows D1 rotated, compare the rendered cathode, the manufacturer's package drawing, the KiCad footprint and the assembly legend. Confirm the correction for the intended side of the board before approving the order.

File Bare PCB Turnkey or consigned assembly
Gerber layers, outline and plated/non-plated drill data Upload and verify the layer set and dimensions Same fabrication package
BOM Keep for your own purchasing and build Match MPN or accepted parts ID to every populated reference designator
Placement file, also called CPL, centroid or pick-and-place Keep if useful for future assembly Match designators, X/Y units and origin, rotation, and top/bottom side
Assembly drawing and notes Optional fab notes as needed Include pin 1, polarity, special processes, DNP and hand-fitted parts

JLCPCB with KiCad. Export Gerber and drill files from the PCB Editor and inspect them in a Gerber viewer. For assembly, export the BOM and component positions following JLCPCB's KiCad BOM and placement guide. Map each populated line to the intended maker part and vendor identifier in JLCPCB's parts catalog. Review sourcing, placement side, bottom-side orientation, pin 1 and polarity in the order preview. If using EasyEDA instead, its supplier-linked library helps with sourcing, but verify the MPN, footprint and placement preview the same way.

PCBWay with KiCad. Use KiCad's native outputs or the PCBWay Fabrication Toolkit, which can package fabrication data and assembly exports. Check toolkit compatibility with your installed KiCad version. Upload the Gerbers for fabrication and provide the BOM and placement data for assembly. Specify which parts are turnkey, consigned or hand-fitted, and confirm proposed substitutions and any engineering questions before approving production.

Release a small build first. Confirm the quote against the real stackup, thickness, copper, finish, silkscreen, panelization and assembly sides. Use the vendor's supported impedance stackup where needed and revisit the USB routing if it changes. Keep one dated release package per board with matching schematic, BOM, placement files and assembly notes. For the two-board logger, label both board revisions and the compatible cable in the package. On arrival, verify dimensions and polarity, check for shorts with power off and bring up one assembly on a current-limited supply before building the rest.

Troubleshoot the First Board

Symptom Measure or inspect first Next decision
Input current limit trips immediately Power off and check resistance to ground before isolating optional loads. Verify polarized parts and shorts. If steady-state resistance looks reasonable, measure startup inrush with current limiting in place.
MCU resets during SD write, network activity or backlight startup Scope 3.3 V at the MCU and storage socket and read the firmware reset reason. Check regulator margin, wiring drop and load sequencing before increasing capacitance within the regulatorโ€™s supported range.
Touch or IยฒC sensor fails only with the panel connected Check panel rail, bus idle voltages, pull-ups, address conflicts and rise times at the far end. Isolate devices one at a time and compare the short test cable to the installed cable.
PCB passes DRC but the assembly preview flips a polarized part Compare the vendor drawing, footprint and side-specific placement preview. Resolve the orientation in the manufacturing data before ordering.

Community Projects as Design References

Project What to study What to verify for your board
AWOK Dual C5 Two processors in one enclosure, shared GNSS as documented for the Mini, and separate firmware identities. UART ownership and reset states, input and regulator budget, antenna spacing and independent factory programming. The vendor listing is a product reference.
ESP32 Marauder by justcallmekoko Hardware targets differ by display, pin map, chip family, storage and GNSS. Compare the exact supported board against your schematic and confirm boot, display and storage using your own firmware test image.
Biscuit Ecosystem Phone-managed designs and board-specific flash, storage and firmware constraints. Compare the exact board revision and firmware target. Decide early whether the phone or board owns GNSS, storage and configuration.

AWOK Dual C5 Mini product page ยท Marauder Supported Hardware wiki ยท Biscuit DIY wiki

When adapting community hardware, look for a schematic, layout, BOM and hardware license separately. A firmware repository or public pinout may be sufficient to plan an interface. Verify design-file availability and reuse rights before adapting a board.

Recommended Reading

Paul Scherz and Simon Monk, Practical Electronics for Inventors, 4th ed., McGraw Hill, 2016, ISBN 9781259587542. Use its component and circuit theory for the regulator, divider and transistor examples here. Its treatment of sensors, digital electronics and microcontrollers complements the signal-chain and prototyping sections. Use the USB-IF specifications, datasheets and MCU design guides above for part- and protocol-specific limits. The schematic and calculations in this guide are original worked examples. Publisher reference


๐Ÿ“„ Source: HardwareHacking/CircuitDesign/README.md | โœ๏ธ Suggest an edit | โฌ…๏ธ Back to Hardware Hacking

Clone this wiki locally