

Sense
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
3OPA4189ID
SOIC-14-18V~-2.25V、2.25V~18V -40℃~+125℃ 1.7mA 14MHz 168dB 20V/us 30nV/℃ 4.5V~36V 5.2nV/√Hz@1kHz 5nA 5uV 65mA 70pA EMI filtering/RF suppression、Zero drift / auto-zero、ESD protection、Reverse-phase input protection Four channels Rail-to-rail output SOIC-14 Precision Op Amps ROHSTexas InstrumentsPrecision Op AmpsCD4053BE
DIP-16-40℃~+85℃ 0.2pF 2:1 3 3V~15V 7ns 90Ω Bidirectional analog channel、Level shifting、Glitch-free switching DIP-16 Analog Switches, Multiplexers ROHSHGSEMIAnalog Switches, MultiplexersZVN4106FTA
SOT-23-55℃~+150℃ 1 N-channel 1.3V 2.55Ω@10V 200mA 350mW 35pF 60V 8pF SOT-23 MOSFETs ROHSDiodes IncorporatedMOSFETs
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:
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_pcbfiles./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
- 📄 Latest Schematic PDF:
/hardware/production/schematic.pdf(Update path to exact filename) - 📦 Gerber Packages / BOM: Prepared inside
/hardware/production/for direct manufacturing ordering.
💻 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
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 configurationDrivers 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 whensmuk.iocis 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:
| Region | Address range |
|---|---|
| Application | 0x08000000–0x0801BFFF |
| Calibration A | 0x0801C000–0x0801DFFF |
| Calibration B | 0x0801E000–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:
- ARM GCC toolchain and binutils (
arm-none-eabi-gcc,arm-none-eabi-size,arm-none-eabi-objcopy) - CMake 3.22+ and Ninja
- Python 3 for the Flash footprint check
- A host C compiler (
cc, or setCC) 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:
cd firmware
./build.sh
sh tests/run_calibration_state.shThe 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:
./flash.shThe 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:
./debug_server.shThis 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 9 | 1K | Resistor_SMD:R_0603_1608Metric | R20, R22, R25, R31, R32, R33, R34, R36, R38 |
| 8 | 100n | Capacitor_SMD:C_0603_1608Metric | C2, C7, C9, C11, C13, C14, C15, C16 |
| 8 | ZVN4106F | Package_TO_SOT_SMD:SOT-23 | Q6, Q7, Q8, Q9, Q11, Q12, Q13, Q14 |
| 7 | 1M | Resistor_SMD:R_0603_1608Metric | R6, R7, R8, R14, R18, R39, R40 |
| 7 | 2N7002 | Package_TO_SOT_SMD:SOT-23 | Q3, Q4, Q5, Q15, Q16, Q17, Q18 |
| 5 | 100K | Resistor_SMD:R_0603_1608Metric | R9, R10, R11, R12, R13 |
| 3 | 1000p | Capacitor_SMD:C_0603_1608Metric | C3, C4, C5 |
| 3 | 15K | Resistor_SMD:R_0603_1608Metric | R23, R29, R37 |
| 3 | 2K | Resistor_SMD:R_0603_1608Metric | R5, R24, R35 |
| 3 | 49R9 | Resistor_SMD:R_0603_1608Metric | R2, R3, R4 |
| 2 | 10K | Resistor_SMD:R_0603_1608Metric | R27, R30 |
| 2 | 10u | Capacitor_SMD:C_1206_3216Metric | C18, C19 |
| 2 | 1u | Capacitor_SMD:C_0603_1608Metric | C6, C8 |
| 1 | +1V5 | TestPoint:TestPoint_Pad_D1.5mm | TP1 |
| 1 | +3V | TestPoint:TestPoint_Pad_D1.5mm | TP2 |
| 1 | 0R1 | miscellaneous:Littelfuse L4CL1206 | R21 |
| 1 | 100n | Capacitor_SMD:C_0805_2012Metric | C17 |
| 1 | 10M | Resistor_SMD:R_1206_3216Metric | R26 |
| 1 | 10u | Capacitor_SMD:C_0603_1608Metric | C1 |
| 1 | 18 | Resistor_SMD:R_1206_3216Metric | R17 |
| 1 | 180 | Resistor_SMD:R_1206_3216Metric | R16 |
| 1 | 1K8 | Resistor_SMD:R_1206_3216Metric | R15 |
| 1 | 1R8 | Resistor_SMD:R_1206_3216Metric | R19 |
| 1 | 220n | Capacitor_SMD:C_0603_1608Metric | C10 |
| 1 | 2K49 | Resistor_SMD:R_0603_1608Metric | R28 |
| 1 | 680p | Capacitor_SMD:C_0603_1608Metric | C12 |
| 1 | ADS131M03xPW | Package_SO:TSSOP-20_4.4x6.5mm_P0.65mm | U2 |
| 1 | CD4053B | Package_SO:TSSOP-16_4.4x5mm_P0.65mm | U4 |
| 1 | Conn_01x10_Pin | Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_Horizontal | J1 |
| 1 | Current meas | TestPoint:TestPoint_Pad_D1.5mm | TP3 |
| 1 | DSC100X | Package_DFN_QFN:CDFN-4_2.5x3.2mm_P2.1mm | Y1 |
| 1 | GND | TestPoint:TestPoint_Loop_D2.60mm_Drill0.9mm_Beaded | TP5 |
| 1 | OPA4189 | Package_SO:TSSOP-14_4.4x5mm_P0.65mm | U3 |
| 1 | REF2030 | Package_TO_SOT_SMD:SOT-23-5 | U1 |
| 1 | ST-MORPHO-CN10 | Connector_PinHeader_2.54mm:PinHeader_2x19_P2.54mm_Vertical | X2 |
| 1 | ST-MORPHO-CN7 | Connector_PinHeader_2.54mm:PinHeader_2x19_P2.54mm_Vertical | X1 |
| 1 | Si6966DQ | Package_SO:TSSOP-8_4.4x3mm_P0.65mm | Q10 |
| 1 | Voltage meas | TestPoint:TestPoint_Pad_D1.5mm | TP4 |
More from bodri/smuk
2- 2 layers69 × 99.1 mm

- 2 layers69 × 99.1 mm

Similar boards
- 4 layers96.1 × 106.5 mm

LCP PowerControl
NOAA-PMEL/EDD-LCP_PistonDriver
Repository for LCP Piston Driver PCB design and firmware
107 parts1MIT - 4 layers111 × 110 mm

Complex vco ranged
lennartquerter/euro-rack-synth
Lenimal Github for DIY for a Eurorack Synth
234 parts13 - 4 layers180.9 × 110 mm

- 2 layers147.4 × 63.2 mm

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 mm

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 mm

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 mm

Kleingorium
lytex/kleingorium
Expansion board for https://github.com/hexagon5un/klangorium that generates harmonic frequency multiplications and divisions
95 parts3 - 4 layers48.5 × 56 mm

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.