Skip to the content
4 layers70 × 53 mmSense, the printed circuit board in 3D

An SMU by kapuki

Size
70 × 53 mm
Copper layers
4
Thickness
1.6 mm
Parts
87
Nets
126
Pads
321
Tracks, vias
590, 82
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
30 Sep 2026
Updated
22 Oct 2026

Overview

Sense is an open-source printed circuit board by bodri, from the bodri/smuk repository on GitHub. It is a 4-layer board of 70 × 53 mm with 87 parts on 126 nets, routed with 590 tracks and 82 vias.

It is built around the OPA4189ID, CD4053BE and ZVN4106FTA. Its parts include 39 resistors, 19 capacitors, 16 transistors, 4 ICs and 3 crystals.

Main components

3

README

README.md

🚀 smuk

An SMU by kapuki

This repository is structured as a unified monorepo containing both the physical hardware designs (schematics, PCB, enclosures) and the bare-metal C firmware.


📂 Project Architecture

The workspace is split into isolated modules to decouple hardware revisions from compilation build systems:

text
smuk/
├── firmware/       # Core firmware application, drivers, and build targets
├── hardware/       # Electrical schematics, PCB layout, and production packages
├── AGENTS.md       # Target rules and context for AI assistants (Claude, Codex)
└── README.md       # This file

📐 1. Hardware Module (/hardware)

The electronics are designed using KiCad 10.0 (or your preferred EDA tool), leveraging the high-performance capabilities of the STM32H5 series (Cortex-M33 with TrustZone support).

Key Subdirectories

  • /pcb: Contains the source .kicad_pro, .kicad_sch, and .kicad_pcb files.
  • /mechanical: STEP files for the enclosure, 3D component models, and mounting layouts.
  • /production: Production-ready files. Check this folder if you need to quickly inspect the schematics without installing the full EDA design suite.

Quick Hardware Access


💻 2. Firmware Module (/firmware)

The software environment is built on top of the STM32 Cube Hardware Abstraction Layer (HAL) and configured for cross-compilation using the GNU ARM Embedded Toolchain.

Current Firmware Status

Firmware targets the STM32H503RB. ADS131M03 SPI/DMA acquisition, physical measurement conversion, CALBUS and voltage calibration, and persistent Flash calibration storage are working.

Range control, PA safety, watchdog, and parts of the platform interface still contain placeholders awaiting hardware integration. The App directory is unfinished and is excluded from the firmware source list.

Core Architecture

text
firmware/
├── Core/                 # CubeMX initialization, callbacks, integration loop
├── Drivers/SMU/          # ADC, measurement, calibration and hardware interfaces
├── Platform/STM32H503/   # Board-specific HAL implementations
├── Storage/             # Persistent calibration records and Flash storage
├── App/                 # Unfinished instrument/control implementation
├── tests/               # Host regression tests
└── smuk.ioc              # STM32CubeMX configuration

Drivers also contains the vendor CMSIS, STM32H5 HAL, and board support libraries. Drivers/SMU/ads131m03.h/.c contains both blocking device bring-up and DMA acquisition. Its HAL operations are provided through ads131m03_port.h, implemented in Platform/STM32H503/ads131m03_port_hal.c.

smu_measurement converts raw ADC samples into physical measurements and applies calibration and filtering. smu_calibration manages active coefficients, smu_cal_seq sequences calibration acquisition, and Storage/calibration_store persists calibration records.

⚠️ Crucial Development Rule: In CubeMX-generated files, write custom C code only inside the explicit /* USER CODE BEGIN ... */ and /* USER CODE END ... */ sections. Changes outside these sections may be lost when smuk.ioc is regenerated. This restriction does not apply to handwritten drivers and modules.

Calibration Behavior

Calibration discard and acquisition phases each have a configurable timeout, defaulting to 1,000 ms per phase. The sequencer accounts for elapsed scheduler time, including delayed ticks. On timeout, it opens calibration relays, selects zero CALBUS, requests PA disable and ranges off through the existing hardware interfaces, and latches a fault until sequencer reinitialization. PA and range actions still depend on the placeholder implementations described above.

Applying calibration coefficients preserves measurement ranges, validity/compliance/transition flags, sample count, and filter configuration. Filter history resets to avoid blending values from different calibrations, and cached outputs remain invalid until another frame is processed. Startup still performs full measurement initialization.

Calibration Flash Reservation

Application Flash is limited to 112 KiB, enforced by check_limits.py during the build. Two 8 KiB calibration slots occupy the remaining 16 KiB:

RegionAddress range
Application0x08000000–0x0801BFFF
Calibration A0x0801C000–0x0801DFFF
Calibration B0x0801E000–0x0801FFFF

Saves replace the older or invalid slot and verify the replacement by record validation and byte-for-byte readback. The newest valid calibration is preserved while the replacement is written. Storage initialization does not erase calibration; loading falls back to default coefficients if neither slot is valid.


🛠️ Getting Started (Compilation & Flashing)

For project guidance, see AGENTS.md and the firmware-specific firmware/AGENTS.md.

Prerequisites

Install these dependencies and make them available on PATH:

  1. ARM GCC toolchain and binutils (arm-none-eabi-gcc, arm-none-eabi-size, arm-none-eabi-objcopy)
  2. CMake 3.22+ and Ninja
  3. Python 3 for the Flash footprint check
  4. A host C compiler (cc, or set CC) for host regression tests

clang-format and cppcheck are optional. When installed, the build script automatically formats C source and header files under Core/Src, Core/Inc, Platform, Drivers/SMU, and Storage, and runs static analysis on Core, Platform, Drivers/SMU, and Storage. These steps are skipped with a warning if the tools are unavailable.

The supplied flashing and debugging helpers currently require STM32CubeIDE installed under /Applications on macOS, including its STM32CubeProgrammer and ST-LINK GDB server bundles.

Build and Test

From the repository root:

bash
cd firmware
./build.sh
sh tests/run_calibration_state.sh

The build uses the ARM toolchain through CMake and Ninja, generates build/smuk.elf, build/smuk.hex, and build/smuk.bin, and checks the 112 KiB application Flash limit.

The host regression tests cover calibration timeouts and cleanup, successful acquisition, zero-CALBUS offset capture, and measurement state preservation when applying coefficients. They run without a connected board and do not replace hardware verification.

In Zed, use STM32H5: Build Firmware or the configured build shortcut (cmd-b / ctrl-b). The STM32H5: Clean & Rebuild Firmware task currently passes --clean, but build.sh does not implement special handling for that argument. Each normal build clears the CMake cache and configuration directory; for a complete clean build, remove firmware/build before running the script.

Hardware Flashing

Connect the board through an ST-LINK debugger, build the firmware, then run from firmware:

bash
./flash.sh

The helper programs build/smuk.elf using STM32CubeProgrammer over SWD in under-reset mode, verifies the image, and resets the target. The equivalent Zed task is STM32H5: Flash Firmware.

Serial Communication and Manual Calibration

The ST-LINK USB connection provides a USART3 Virtual COM Port at 115200 baud, 8N1, no flow control. The firmware console supports measurement/raw queries, range selection, and manual calibration from externally applied references. Start with HELP or PING. Select precision windows with INTEGRATION 1MS|8MS|20MS|50MS|100MS; precision readings become valid after the window fills. CAL:SHOW? reports calibration provenance, and captures report noise/drift. ACQ? reports acquisition health; measurement queries report freshness, settling, precision readiness, and channel clipping. Stale acquisition invalidates readings, and persistent failures latch an ADC fault. Current and voltage autorange are controlled independently with AUTORANGE:I and AUTORANGE:V; current autorange defaults ON and voltage autorange defaults OFF. Input loading defaults to HIGHZ, keeping MV_ON LOW; use IMPEDANCE 10M to connect the 10 MΩ resistor. Voltage starts fixed at 15 V, keeping VRANGE LOW. When explicitly enabled, voltage autorange switches up at 6.2 V magnitude and down at 5.0 V after 100 ms. Disable both autoranges during manual calibration.

See Serial console and manual calibration for the command list, terminal setup, calibration capture/fit/save workflow, and host tests.

Debug Server

From firmware, run:

bash
./debug_server.sh

This starts the ST-LINK GDB server on port 61234. Connect a GDB client configured for the ARM target and build/smuk.elf. The equivalent Zed task is STM32H5: Start GDB Debug Server.


🏷️ Versioning Strategy

This project adheres to Semantic Versioning (v2.0.0). Due to the monorepo nature, git tags tie firmware releases directly to specific physical board iterations:

  • v1.0.0-HW1: Initial hardware board spin layout.
  • v1.0.1-FW: Firmware patch fixing a register timing error specifically for the HW1 board revision.

The measurement firmware now uses a nominal 2-second independent watchdog. Foreground processing owns refresh; handled faults stay latched for diagnosis. See the watchdog and CubeMX setup instructions for regeneration settings, reset reporting, and bench checks.

Desktop measurement console

The desktop application provides live measurements, observed statistics, range/autorange controls, integration and impedance selection, and serial diagnostics on macOS. It uses the existing console protocol; firmware and hardware remain separate projects.

Parts

87
QtyValueFootprintReferences
91KResistor_SMD:R_0603_1608MetricR20, R22, R25, R31, R32, R33, R34, R36, R38
8100nCapacitor_SMD:C_0603_1608MetricC2, C7, C9, C11, C13, C14, C15, C16
8ZVN4106FPackage_TO_SOT_SMD:SOT-23Q6, Q7, Q8, Q9, Q11, Q12, Q13, Q14
71MResistor_SMD:R_0603_1608MetricR6, R7, R8, R14, R18, R39, R40
72N7002Package_TO_SOT_SMD:SOT-23Q3, Q4, Q5, Q15, Q16, Q17, Q18
5100KResistor_SMD:R_0603_1608MetricR9, R10, R11, R12, R13
31000pCapacitor_SMD:C_0603_1608MetricC3, C4, C5
315KResistor_SMD:R_0603_1608MetricR23, R29, R37
32KResistor_SMD:R_0603_1608MetricR5, R24, R35
349R9Resistor_SMD:R_0603_1608MetricR2, R3, R4
210KResistor_SMD:R_0603_1608MetricR27, R30
210uCapacitor_SMD:C_1206_3216MetricC18, C19
21uCapacitor_SMD:C_0603_1608MetricC6, C8
1+1V5TestPoint:TestPoint_Pad_D1.5mmTP1
1+3VTestPoint:TestPoint_Pad_D1.5mmTP2
10R1miscellaneous:Littelfuse L4CL1206R21
1100nCapacitor_SMD:C_0805_2012MetricC17
110MResistor_SMD:R_1206_3216MetricR26
110uCapacitor_SMD:C_0603_1608MetricC1
118Resistor_SMD:R_1206_3216MetricR17
1180Resistor_SMD:R_1206_3216MetricR16
11K8Resistor_SMD:R_1206_3216MetricR15
11R8Resistor_SMD:R_1206_3216MetricR19
1220nCapacitor_SMD:C_0603_1608MetricC10
12K49Resistor_SMD:R_0603_1608MetricR28
1680pCapacitor_SMD:C_0603_1608MetricC12
1ADS131M03xPWPackage_SO:TSSOP-20_4.4x6.5mm_P0.65mmU2
1CD4053BPackage_SO:TSSOP-16_4.4x5mm_P0.65mmU4
1Conn_01x10_PinConnector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_HorizontalJ1
1Current measTestPoint:TestPoint_Pad_D1.5mmTP3
1DSC100XPackage_DFN_QFN:CDFN-4_2.5x3.2mm_P2.1mmY1
1GNDTestPoint:TestPoint_Loop_D2.60mm_Drill0.9mm_BeadedTP5
1OPA4189Package_SO:TSSOP-14_4.4x5mm_P0.65mmU3
1REF2030Package_TO_SOT_SMD:SOT-23-5U1
1ST-MORPHO-CN10Connector_PinHeader_2.54mm:PinHeader_2x19_P2.54mm_VerticalX2
1ST-MORPHO-CN7Connector_PinHeader_2.54mm:PinHeader_2x19_P2.54mm_VerticalX1
1Si6966DQPackage_SO:TSSOP-8_4.4x3mm_P0.65mmQ10
1Voltage measTestPoint:TestPoint_Pad_D1.5mmTP4

More from bodri/smuk

2
  • 2 layers69 × 99.1 mmSmuk, the printed circuit board in 3D

    Smuk

    bodri/smuk

    An SMU by kapuki

    63 parts
  • 2 layers69 × 99.1 mmSmuk, the printed circuit board in 3D

    Smuk

    bodri/smuk

    An SMU by kapuki

    62 parts

Similar boards

  • 4 layers96.1 × 106.5 mmLCP PowerControl, the printed circuit board in 3D

    LCP PowerControl

    NOAA-PMEL/EDD-LCP_PistonDriver

    Repository for LCP Piston Driver PCB design and firmware

    107 parts1MIT
  • 4 layers111 × 110 mmComplex vco ranged, the printed circuit board in 3D

    Complex vco ranged

    lennartquerter/euro-rack-synth

    Lenimal Github for DIY for a Eurorack Synth

    234 parts13
  • 4 layers180.9 × 110 mmWaveshaper Marcin, the printed circuit board in 3D

    Waveshaper Marcin

    michalelektryk/NoA-SSH

    Noise of Antimatter - Subshaper

    223 parts8
  • 2 layers147.4 × 63.2 mmGuitar down octave, the printed circuit board in 3D

    Guitar down octave

    MR-DOS/guitar_down_octave

    A octave-down effect for guitar. All analog, no microcontroller, no DSP.

    219 parts5GPL-3.0
  • 2 layers68.6 × 53.3 mmINK-128DA28, the printed circuit board in 3D

    INK-128DA28

    TheEccentricGenius/INK4u_Board

    An UNO form factor board with a AVR128DA28 processor.

    59 parts5CERN-OHL-W-2.0
  • 4 layers389.8 × 179.5 mmCbm ultipet v1, the printed circuit board in 3D

    Cbm ultipet v1

    fachat/cbm_ultipet

    Note: this is a part of a larger set of repositories, with upetfamily as the main repository.

    466 parts3GPL-3.0
  • 2 layers100 × 100 mmKleingorium, the printed circuit board in 3D

    Kleingorium

    lytex/kleingorium

    Expansion board for https://github.com/hexagon5un/klangorium that generates harmonic frequency multiplications and divisions

    95 parts3
  • 4 layers48.5 × 56 mmDigirig icom, the printed circuit board in 3D

    Digirig icom

    1vers1on/digirig_icom

    A custom hardware controller for the ICOM IC-2730 radio, featuring digital audio processing and USB connectivity.

    70 parts1

Questions

How big is the Sense PCB?

It measures 70 × 53 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Sense use?

87 parts, built around the OPA4189ID, CD4053BE and ZVN4106FTA. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Sense KiCad files?

From the bodri/smuk repository on GitHub, at the commit this page was made from: the board is hardware/sense/sense.kicad_pcb and its schematic hardware/lt1970a/amplifier.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Sense design in my own project?

Its repository states no licence, so its author keeps all rights: ask bodri before reusing the design.