ESP32 MicroSquirt I/O box expanderboard
ESP32 MicroSquirt I/O box
DIY clone of the official MicroSquirt "I/O-box" — an ESP32 + SN65HVD230 that listens to the MS2/Extra MicroSquirt CAN realtime broadcast (base ID 0x5F0, 500 kbps) and drives fan, idle control (IAC) and 6 generic low-side outputs, with the same fail-safe the real I/O-box uses (outputs off when CAN goes silent).
Because MS2/Extra has no I/O-box slave protocol (that's an MS3-only feature), this box is an autonomous "smart slave": it computes its own output logic from the broadcast data. It also implements the full Megasquirt 29-bit expansion protocol as a responder (so an MS2/Extra master can drive its outputs/ADC directly), and broadcasts a small 0x710 frame for the in-dash HMI.
Works with any MS2/Extra 3.4.x MicroSquirt V3 — no fuel/spark tune changes needed, only CAN broadcast settings.
Features
Fan — CLT hysteresis (on ≥ 200 °F / off ≤ 190 °F default, adjustable) or manual override, driven through a ULN2003A channel (default O6/GPIO23).
IAC — 30 Hz PWM on GPIO32 → IRLZ44N → 3-wire rotary ISCV. Three modes: Auto (CLT warm-up table + RPM trim), Follow (mirror the ECU's own iacstep → fully TunerStudio-tunable closed-loop idle), or Manual.
O1–O6 — generic low-side outputs (ULN2003A): manual, CLT-temp or RPM trigger. O1 defaults to a 7000 rpm shift light.
Inputs drive outputs — D1–D3 ground switches and A1–A4 analog (0-5 V, 0.15 V hysteresis) can force any output or the fan (I/O-box parity).
29-bit CAN responder — MS2/Extra remote-port protocol: MSG_REQ/MSG_CMD on table 7; remote idle PWM, remote on/off outputs, remote boost, ADC readback.
0x710 dash broadcast — A1–A4 threshold latches + D1–D3 switch states for the in-dash HMI (indicator/high-beam/brake icons). 10 Hz, always on.
GC9A01A round gauge — 1.28" 240×240 idle-control display: big IAC duty %, RPM / target RPM / CLT / idle mode, fan + CAN status line.
Fail-safe — all outputs off after 500 ms without CAN (matches the real I/O-box); IAC falls back to the ~1000-1200 rpm valve default.
Persistent config — all settings stored in NVS; loadable/settable over serial or via the included Windows diagnostic app.
Repo layout
esp32_microsquirt_iobox/
├── firmware/ PlatformIO ESP32 firmware (src/main.cpp, platformio.ini)
├── pcb/ KiCad 8 PCB design (iobox2: schematic, board, project)
├── diag/ iobox_diag.py — Windows test/configure app (Python + Tkinter)
└── docs/
├── OPERATION.md How the box works + how to use it (modes, commands, display)
├── PROTOCOL.md CAN protocol reference (0x5F0 broadcast, 0x710, 29-bit responder)
├── BUILD.md Full point-to-point build/wiring guide
└── PARTS.md Parts list with rough prices
Quick start
Build hardware — see docs/BUILD.md (wiring) and docs/PARTS.md (parts). The KiCad design in pcb/ is the current board (iobox2); the point-to-point build guide is an alternative for module wiring without a PCB.
Flash firmware:
cd firmware
pio run # build
pio run --target upload # flash over USB
pio device monitor -b 115200
Requires PlatformIO (ESP32 Arduino framework). At the serial prompt type ? for a live status dump.
Configure the MicroSquirt (one time) in TunerStudio → CAN Realtime Data Broadcasting: On, base ID 1520, rate 20 Hz, enable groups 00 (rpm), 02 (baro/map/mat/clt), 03 (tps/batt/afr), and optionally 06 (iacstep) for Follow mode. Details in docs/OPERATION.md.
Use the Windows app (diag/iobox_diag.py) to set fan thresholds, IAC mode, output triggers, input mappings and the 29-bit responder from a GUI.
Hardware snapshot
GPIOFunctionDrives5 / 4CAN TX / RXSN65HVD230 (MicroSquirt pins 2/3, CANH/CANL)32IAC PWM (30 Hz)ISCV via IRLZ44N25,26,27,14,13,23O1–O6ULN2003A (O6 = fan by default, Y<k> to change)2Status LEDonboard (CAN heartbeat / fail-safe blink)36,39,34,35A1–A4 analog 0-5 V10k/20k divider (or PCB 12 V→3.3 V dividers)16,17,18D1–D3 switchesINPUT_PULLUP, active-low to GND15,21,22,19GC9A01A round displaySCLK / MOSI / CS / DC
All outputs are low-side (ground-switching), like the real MS I/O-box. Never feed 12 V into the ESP32 or SN65HVD230 — a 12 V→5 V buck is mandatory.
Serial command cheat sheet
CommandEffect?status dumpF205 / F1 / F0fan auto @205 °F / manual on / offE190fan off hysteresis 190 °FI35 / I / I FIAC manual 35% / auto / follow-ECUT900idle target 900 rpm (auto mode)S7000shift light @7000 rpmO3 R3500 / O4 1O3 above 3500 rpm / O4 onD1 O2 / D2 Fswitch D1→O2 / D2→fanA1 O2 3.5 / A2 F 2.0analog threshold → output/fanY6fan on ULN channel 6R1 / R0 / RB529-bit responder on/off / box IDSfull command list
CAN at a glance
ECU → box: 11-bit IDs 0x5F0–0x5F8 (group N at ID 1520+N), big-endian, 8 bytes/group, 20 Hz. rpm@6, baro/map/mat/clt@16-22 (×0.1), tps/batt/afr@24-28 (×0.1), iacstep@54 (×0.392 = duty %).
Box → dash: 0x710, byte0 = A1–A4 latches, byte1 = D1–D3, byte2 = counter.
Master → box: 29-bit extended MSG_REQ/MSG_CMD (MS2/Extra remote ports).
Full byte maps and the 29-bit responder spec: docs/PROTOCOL.md.
ESP32 MicroSquirt I/O box expanderboard
Project images are for reference only. Actual production is based on the manufacturing files on the project page.
Please review the designer's notes (e.g., PCB thickness) and select the appropriate options.
PCBWay is not responsible
for issues caused by unsuitable parameter selections.
For more important ordering information, please refer to
Read More
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(1)
-
Vassiean dennie
Aug 07,2026
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Vassiean dennie
-
Programmable Mist Maker - XIAO / QT PY Extension
1279 2 1 -
RadioHAT - Raspberry Pi radio development platform
1091 0 2 -
QWIIC-VL53L4CD Time-of-Flight Distance Sensor Module
1295 0 1 -
-
-
-
ARPS-2 – Arduino-Compatible Robot Project Shield for Arduino UNO
3482 0 6 -
-
A Compact Charging Breakout Board For Waveshare ESP32-C3
4136 3 8 -
AI-driven LoRa & LLM-enabled Kiosk & Food Delivery System
4511 2 2







