

Micro HIL v0.1
microHIL is a self-developed testing device for setting up a basic hardware-in-the-loop environment
- Size
- 309.5 × 145 mm
- Copper layers
- 4
- Thickness
- 1.6 mm
- Parts
- 396
- Nets
- 263
- Pads
- 1,018
- Tracks, vias
- 1,862, 843
- Pours
- 48
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 8 Sep 2026
- Updated
- 9 Sep 2026
Overview
Micro HIL v0.1 is an open-source printed circuit board by danielsimonreinhardt, from the danielsimonreinhardt/microHIL repository on GitHub, published under the MIT licence. It is a 4-layer board of 309.5 × 145 mm with 396 parts on 263 nets, routed with 1,862 tracks and 843 vias.
It is built around the TLV6001UIDBV, SN65HVD1050D and INA240A1D, with the AMS1117-3.3, AMS1117-5.0 and SRV05-4 among its other parts. Its parts include 138 resistors, 63 capacitors, 45 connectors, 43 transistors and 32 ICs. It belongs with the STM32 boards of this library.
Main components
12TLV6001UIDBV
SOT-23-5-2.75V~-900mV、900mV~2.75V -40℃~+125℃ 1 1.8V~5.5V 15mA 1MHz 1pA 1pA 28nV/√Hz@1kHz 2uV/℃ 4.5mV 500V/ms 75uA 76dB ESD protection、EMI filtering/RF suppression Rail-to-Rail Input, Rail-to-Rail Output SOT-23-5 Operational Amplifier ROHSTexas InstrumentsOperational AmplifierSN65HVD1050D
SOIC-8-40℃~+125℃ 10mA 1Mbps 4.5V~5.5V 75mA CAN Transceiver SOIC-8 CAN Transceivers ROHSTexas InstrumentsCAN TransceiversINA240A1D
SOIC-8-40℃~+125℃ -4V~80V 1 1.8mA 132dB 2.7V~5.5V 20V/V 250nV/℃ 2V/us 400kHz 40nV/√Hz@1kHz 5uV 90uA Bidirectional detection、Zero drift / auto-zero、Programmable output reference level、Analog output interface ±80V SOIC-8 Current Sense Amplifiers ROHSTexas InstrumentsCurrent Sense AmplifiersAMS1117-3.3
SOT-223-40℃~+125℃ 0.003%Vout 1 1.1V@(800mA) 15V 1A 3.3V 5mA 72dB@(120Hz) Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsAMS1117-5.0
SOT-223-40℃~+125℃ 1 1.3V 15V 1A 5V 60dB Fixed Positive Short Circuit Protection、Thermal shutdown SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsSRV05-4
SOT-23-6L-55℃~+150℃ 15V 1pF 4A 5V 5uA 6V 80W ESD Four channels IEC 61000-4-2、IEC 61000-4-5 Unidirectional SOT-23-6L ESD and Surge Protection (TVS/ESD) ROHShongjiachengESD And Surge Protection (TVS/ESD)USBLC6-2SC6
SOT-23-60.35pF、0.8pF 100nA 150W@8/20us 15V 2 5V 6A@8/20us 6V ESD SOT-23-6 ESD and Surge Protection (TVS/ESD) ROHSUMWESD And Surge Protection (TVS/ESD)BZT52B8V2
SOD-123Zener DiodeshongjiachengBSS84
SOT-23-55℃~+150℃ 1 P-Channel 130mA 2.8pF 24.6pF 2V 3.2Ω@5V 300mW 4.7pF 50V 590pC@10V SOT-23 MOSFETs ROHSDiodes IncorporatedMOSFETsBC807
SOT-23-65℃~+150℃ 1 PNP 100 100nA 345mW 45V 500mA 5V 700mV 80MHz PNP SOT-23 Bipolar (BJT) ROHSNexperiaBipolar (BJT)BC817
SOT-231 NPN 100nA 150MHz 300mW 40 45V 500mA 5V 700mV NPN SOT-23 Bipolar (BJT) ROHSShikuesBipolar (BJT)G5Q-1A
Miniature Power RelayOmronUncategorised
README
README.mdmicroHIL
A small, self-built hardware-in-the-loop box: switchable relays, digital and analog I/O, two current-monitored 12 V supply outputs and a CAN interface — all driven from a PC over a single USB cable.
microHIL is built around an STM32F446RET (LQFP64) on a custom PCB. It enumerates as a USB composite device with two virtual COM ports: one carries a plain ASCII command protocol for the I/O, the other exposes CAN1 as a standard SLCAN adapter. Both can be used at the same time.
Status: working prototype, in active use on the bench. The firmware, the command protocol and the Python host library are stable and verified against real hardware; the PCB is at revision v0.1 and has a few documented quirks that needed rework (see
docs/hardware-notes.md). Project documentation underdocs/is currently in German.
Features
| Function | Channels | Notes |
|---|---|---|
| Relays | 4 | dry contacts |
| Digital outputs | 8 | OUT1-8 |
| Digital inputs | 8 | 12 V level, comparator front end with selectable 5 V/12 V threshold |
| Analog inputs | 4 | calibrated, reported in mV (divider for up to ~13 V) |
| Analog outputs | 2 | DAC + buffer, calibrated, ~0…12.2 V |
| Switchable 12 V outputs | 2 | high-side switch with current sense (mA) and firmware current limiting |
| PWM outputs | 4 | 0…1000 ‰, configurable frequency 1 Hz…20 kHz (PWMFREQ, shared by all 4 channels, ceiling scope-verified), shares the output stage with OUT1-4 (interlocked in firmware) |
| CAN | 1 (+1 reserved) | CAN1 as SLCAN USB adapter; CAN2 reserved for remote control |
Analog channels (AIN1-4, AOUT1-2, CURR1-2) are individually two-point
calibrated against reference instruments, so the protocol speaks physical
units (mV / mA) rather than raw ADC counts — see
docs/calibration.md.
The 12 V outputs are protected in firmware: a per-channel limit (ILIM,
default 1200 mA) and a combined 1500 mA budget for the shared polyfuse. A
tripped channel latches off until its request is explicitly withdrawn;
PWR12FLT? reports the cause.
Repository layout
firmware/microHIL_fw/ STM32CubeMX + CMake project for the STM32F446RET
host/ Python client library, test GUI, hardware-free checks
hardware/ KiCad 9 schematic, PCB and Gerbers (rev v0.1)
docs/ Protocol reference, CAN/SLCAN reference, calibration,
hardware notes (German)USB interfaces
microHIL presents two CDC-ACM functions under the same VID:PID 0483:5740
(ST's factory VCP IDs — no own USB vendor ID). They are told apart by
interface number, which host/microhil.py does automatically:
| Interface | Windows | Linux | Content |
|---|---|---|---|
| 0 | …&MI_00 | …-if00 | HIL command protocol — docs/protocol.md |
| 2 | …&MI_02 | …-if02 | CAN1 as SLCAN — docs/can-usb.md |
Two ports rather than one multiplexed port, because a COM port can only be opened once on Windows: this way the test GUI and a CAN tool can run side by side.
Command protocol
Line-based ASCII, uppercase, \n-terminated requests, \r\n-terminated
replies — a plain readline() is enough. Values are always integers in
mV/mA.
*IDN? -> microHIL,fw=0.1.0,SN=2065386A5631
RELAY 1 1 -> OK
IN? -> 10110001 (IN1 first)
AIN? 2 -> 3300 (mV, calibrated)
PWR12 1 1 -> OK
CURR? 1 -> 536 (mA)
PWM 1 500 -> OK (‰ duty cycle)Errors are exactly ERR ARGS, ERR RANGE or ERR UNKNOWN. The full
reference, including the range-checking rules and the board serial number in
*IDN?, is in docs/protocol.md.
CAN1 speaks the SLCAN/Lawicel dialect (CAN232-compatible), so it works with
python-can (interface="slcan") and, on Linux, as a regular SocketCAN
interface via slcand. Two extensions beyond CAN232: B<bit/s> for exact
non-standard bitrates and Y for a loopback self-test without a bus. See
docs/can-usb.md.
Getting started (host)
pip install -r host/requirements.txtfrom host.microhil import MicroHIL
with MicroHIL() as hil: # finds the right COM port by itself
print(hil.idn())
hil.set_relay(1, True)
print(hil.get_ain_mv(2), "mV")
hil.set_pwr12(1, True)
print(hil.get_curr_ma(1), "mA")A PySide6 test GUI that exercises every function manually, with a CAN trace tab, comes with it:
python host/gui.pyTwo checks in host/tests/ run without any hardware attached — they verify
the CAN bit timing against the bxCAN register limits and the SLCAN wire
format in both directions against the real python-can driver:
python host/tests/check_bit_timing.py
python host/tests/check_slcan_wire.pyBuilding the firmware
Needs the arm-none-eabi GCC toolchain, CMake ≥ 3.22 and Ninja. The project
was generated with STM32CubeMX and is set up for the STM32Cube extension for
VS Code, but builds fine from the command line:
cd firmware/microHIL_fw
cmake --preset Debug
cmake --build --preset DebugFlashing is over SWD with an ST-Link V2, e.g.:
STM32_Programmer_CLI -c port=SWD -w build/Debug/microHIL_fw.elf -rstWith GCC 10.3.1 (the version bundled with STM32CubeIDE 1.10.1, confirmed
working end-to-end 2026-09-09), the linker fails on all three .ld files
with non constant or forward reference address expression for section .ARM.extab — the (READONLY) section attribute on .ARM.extab/.ARM/
.preinit_array/.init_array/.fini_array needs GCC 11+ (each occurrence
says so in its own comment). Remove (READONLY) from those five section
headers in STM32F446xx_FLASH.ld (used by the CMake build) and, for
STM32CubeIDE's own Eclipse build, STM32F446RETX_FLASH.ld/_RAM.ld too, if
building with GCC 10. A GCC 11+ toolchain doesn't need this.
If you regenerate from microHIL_fw.ioc, note that the CAN bit timing is
computed at runtime in Core/Src/slcan.c (deliberately not stored in CubeMX)
and that the CDC composite build needs ST's CompositeBuilder, which CubeMX
does not emit for the F4 series — it is vendored in
Middlewares/ST/STM32_USB_Device_Library/Class/CompositeBuilder/.
Hardware
- MCU: STM32F446RET, LQFP64, 8 MHz crystal, HSE/PLL clock tree
- Debug: SWD (ST-Link V2)
- CAN1: PB8/PB9, transceiver and 120 Ω termination populated
- CAN2: PB5/PB6, not in service yet (see Roadmap)
- KiCad sources, PCB and Gerbers for rev v0.1 are in
hardware/
Board revision v0.1 has known issues that required rework — most notably VBUS
routed straight onto the supply rail, and missing pulldowns on the digital
input comparator stages. All of them are documented, with measurements and
the fixes applied, in docs/hardware-notes.md.
Read that file before building a board from these files.
Roadmap
- CAN2 as a remote-control interface. Drive microHIL from a supervising
ECU or test bench with the same functions as the USB command protocol.
Frame layout, addressing and bitrate are still to be defined; the bxCAN
filter bank split needed for CAN2 to receive at all is already in place
(
SlaveStartFilterBank = 14inCore/Src/can_if.c). - CAN1 against a second real bus node, plus a scope measurement of the actual bit rate.
License
MIT — see LICENSE.
Vendored third-party code keeps its own license: the STM32 HAL drivers, CMSIS
and the ST USB device library under firmware/microHIL_fw/Drivers/ and
firmware/microHIL_fw/Middlewares/ are © STMicroelectronics / Arm and
licensed under their respective terms (see the LICENSE.txt files in those
directories).
Parts
396| Qty | Value | Footprint | References |
|---|---|---|---|
| 41 | 10k | Resistor_SMD:R_0603_1608Metric | R1, R103, R104, R105, R106, R107, R109, R111, R113, R115, R116, R117, R118, R123, R124, R125 +25 |
| 39 | 100n | Capacitor_SMD:C_0603_1608Metric | C2, C12, C13, C14, C16, C17, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29 +23 |
| 36 | Conn_01x01 | Connector:Hirschmann_SEP_2630_S1,9 | J1, J2, J10, J11, J12, J13, J14, J15, J16, J17, J19, J20, J21, J22, J23, J24 +20 |
| 28 | 1k | Resistor_SMD:R_0603_1608Metric | R10, R13, R14, R17, R18, R19, R20, R21, R22, R24, R26, R28, R30, R39, R40, R41 +12 |
| 19 | TestPoint | TestPoint:TestPoint_Pad_D1.0mm | TP2, TP3, TP4, TP5, TP6, TP10, TP11, TP12, TP13, TP14, TP15, TP16, TP17, TP18, TP19, TP20 +3 |
| 16 | LM397 | Package_TO_SOT_SMD:SOT-23-5 | U9, U10, U11, U12, U13, U14, U15, U16, U21, U22, U23, U24, U25, U26, U27, U28 |
| 15 | BZT52B8V2 | Diode_SMD:D_SOD-123 | D6, D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29 |
| 12 | 3,3k | Resistor_SMD:R_0603_1608Metric | R99, R100, R101, R102, R119, R120, R121, R122, R135, R136, R137, R138 |
| 12 | 47n | Capacitor_SMD:C_0603_1608Metric | C41, C43, C45, C47, C49, C51, C53, C55, C60, C61, C62, C63 |
| 12 | BSS84 | Package_TO_SOT_SMD:SOT-23 | Q32, Q33, Q34, Q35, Q36, Q37, Q38, Q39, Q40, Q41, Q42, Q43 |
| 10 | BC807 | Package_TO_SOT_SMD:SOT-23 | Q7, Q9, Q11, Q13, Q15, Q17, Q19, Q21, Q25, Q31 |
| 10 | BC817 | Package_TO_SOT_SMD:SOT-23 | Q6, Q8, Q10, Q12, Q14, Q16, Q18, Q20, Q24, Q30 |
| 10 | DNP | Resistor_SMD:R_0603_1608Metric | R35, R36, R37, R38, R57, R58, R59, R60, R64, R82 |
| 8 | 0.5A | Fuse:Fuse_1210_3225Metric | F4, F5, F6, F7, F8, F9, F10, F11 |
| 8 | 15k | Resistor_SMD:R_0603_1608Metric | R88, R90, R92, R94, R108, R110, R112, R114 |
| 8 | 4.7k | Resistor_SMD:R_0603_1608Metric | R31, R32, R33, R34, R53, R54, R55, R56 |
| 7 | 100k | Resistor_SMD:R_0603_1608Metric | R6, R65, R66, R127, R129, R131, R133 |
| 6 | 2N7002 | Package_TO_SOT_SMD:SOT-23 | Q2, Q3, Q4, Q5, Q26, Q27 |
| 5 | 680 | Resistor_SMD:R_0603_1608Metric | R7, R11, R12, R15, R16 |
| 5 | LED red | LED_THT:LED_D5.0mm | D7, D8, D9, D12, D13 |
| 4 | 10 | Resistor_SMD:R_0603_1608Metric | R71, R72, R75, R76 |
| 4 | 10µ | Capacitor_SMD:C_0805_2012Metric | C18, C19, C31, C39 |
| 4 | 33k | Resistor_SMD:R_0603_1608Metric | R128, R130, R132, R134 |
| 4 | G5Q-1A | Relay_THT:Relay_SPST_Omron-G5Q-1A | K1, K2, K3, K4 |
| 4 | LL4148 | Diode_SMD:D_MiniMELF | D10, D11, D14, D15 |
| 4 | PMT200EPEX | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | Q22, Q23, Q28, Q29 |
| 4 | TLV6001UIDBV | Package_TO_SOT_SMD:SOT-23-5 | U29, U30, U31, U32 |
| 3 | 3A | Fuse:Fuse_1812_4532Metric | F1, F13, F14 |
| 3 | SW_SPDT | TerminalBlock:TerminalBlock_bornier-3_P5.08mm | SW1, SW2, SW3 |
| 2 | 0.2A | Fuse:Fuse_1210_3225Metric | F12, F15 |
| 2 | 120 | Resistor_SMD:R_0603_1608Metric | R5, R8 |
| 2 | 12p | Capacitor_SMD:C_0603_1608Metric | C8, C10 |
| 2 | 16k | Resistor_SMD:R_0603_1608Metric | R80, R81 |
| 2 | 27k | Resistor_SMD:R_0603_1608Metric | R63, R79 |
| 2 | 330 | Resistor_SMD:R_0603_1608Metric | R2, R4 |
| 2 | 4,7µ | Capacitor_SMD:C_0805_2012Metric | C1, C6 |
| 2 | 450mA | Fuse:Fuse_1210_3225Metric | F2, F3 |
| 2 | DB9_Female | Connector_Dsub:DSUB-9_Female_Vertical_P2.77x2.84mm_MountingHoles | J43, J44 |
| 2 | DNP | Capacitor_SMD:C_0603_1608Metric | C32, C33 |
| 2 | Ferrite_Bead_Small | Inductor_SMD:L_0805_2012Metric | FB1, FB2 |
| 2 | INA240A1D | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U18, U19 |
| 2 | JST_PH_B4B | Connector_JST:JST_PH_B4B-PH-K_1x04_P2.00mm_Vertical | J18, J41 |
| 2 | LVK24R050CER | Resistor_SMD:R_Shunt_Ohmite_LVK24 | R73, R74 |
| 2 | NUP2105L | Package_TO_SOT_SMD:SOT-23 | D3, D4 |
| 2 | OPA330xxDBV | Package_TO_SOT_SMD:SOT-23-5 | U17, U20 |
| 2 | SN65HVD1050D | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U4, U5 |
| 1 | 16MHz | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | Y1 |
| 1 | 1M | Resistor_SMD:R_0603_1608Metric | R3 |
| 1 | 1µ | Capacitor_SMD:C_0603_1608Metric | C11 |
| 1 | 22µF | Capacitor_SMD:CP_Elec_6.3x5.9 | C15 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U7 |
| 1 | AMS1117-5.0 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U8 |
| 1 | Conn_01x10 | Connector_TE-Connectivity:TE_3-1445056-0 | J42 |
| 1 | IRF7404 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | Q1 |
| 1 | JST_PH_S4B | Connector_JST:JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal | J40 |
| 1 | LED_green | LED_SMD:LED_0805_2012Metric | D2 |
| 1 | LED_red | LED_SMD:LED_0805_2012Metric | D1 |
| 1 | LM809 | Package_TO_SOT_SMD:SOT-23 | U2 |
| 1 | SM6T33CAY | Diode_SMD:D_SMB_Handsoldering | D5 |
| 1 | SRV05-4 | Package_TO_SOT_SMD:SOT-23-6 | U6 |
| 1 | STM32F446RETx | Package_QFP:LQFP-64_10x10mm_P0.5mm | U1 |
| 1 | SWD | Connector_IDC:IDC-Header_2x03_P2.54mm_Vertical | J3 |
| 1 | TE_AMPMODU_HEADER | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J31 |
| 1 | TestPoint | Connector_Pin:Pin_D1.1mm_L8.5mm_W2.5mm_FlatFork | TP1 |
| 1 | USBLC6-2SC6 | Package_TO_SOT_SMD:SOT-23-6 | U3 |
| 1 | USB_B | Connector_USB:USB_B_TE_5787834_Vertical | J45 |
| 1 | WE_SLM | Inductor_SMD:L_CommonMode_Wuerth_WE-SLM | L1 |
Similar boards
- 4 layers262.5 × 120.1 mm

- 2 layers90 × 60 mm

- 2 layers122.5 × 87.6 mm

- 4 layers84.3 × 134.3 mm

- 2 layers66 × 42 mm

Bspd
Formula-Trinity/bspd
A safety device which detects hard braking and acceleration and shuts the engine down.
81 parts - 4 layers96.1 × 56.1 mm

- 2 layers115 × 100 mm

Cog1
diegodemarco/cog1
cog1 is an open-source industrial IoT gateway (hardware and software) built as a motherboard hosting an Orange Pi Zero 3 Linux SBC.
133 parts6MIT - 2 layers99.5 × 99.5 mm

Bidirectional Power Converter 24V-12V with BMS
kwiecinski/BMS-and-offgrid-photovoltaic-management-system
Project contains BMS for lead-acid batteries and ESP-based board used to pull information from EASUN offgrid inverter, energy meters and sensors.
156 parts3MIT
Questions
How big is the Micro HIL v0.1 PCB?
It measures 309.5 × 145 mm and has 4 copper layers, 1.6 mm thick.
What parts does the Micro HIL v0.1 use?
396 parts, built around the TLV6001UIDBV, SN65HVD1050D, INA240A1D and AMS1117-3.3. 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 Micro HIL v0.1 KiCad files?
From the danielsimonreinhardt/microHIL repository on GitHub, at the commit this page was made from: the board is hardware/micro_HIL_v0.1.kicad_pcb and its schematic hardware/Connectors.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Micro HIL v0.1 design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).