
Transmitter
abhijithvijayan/wireless-steering-wheel-controls
Wireless steering-wheel audio controls for a car head unit.

Wireless steering-wheel audio controls for a car head unit.
Receiver is an open-source printed circuit board by abhijithvijayan, from the abhijithvijayan/wireless-steering-wheel-controls repository on GitHub, published under the MIT licence. It is a 2-layer board of 56 × 47 mm with 26 parts on 46 nets, routed with 136 tracks and 1 via.
It is built around the 74HC4051 and AQY212EH. Its parts include 3 connectors and 1 IC. It belongs with the audio and music boards and the ESP32 and RISC-V boards of this library.
⚠️ Work in progress
Wireless steering-wheel audio controls for a car head unit.
The steering-wheel buttons can't be wired through to the dash, and the head unit only accepts commands over its wired SWC (steering-wheel-control) resistor input. So the link is split in two over BLE:
[steering wheel] [behind dash, car-powered]
buttons → XIAO nRF52840 ──BLE──▶ ESP32-C3 ──resistor codes──▶ head unit SWC input
(coin-cell powered) (always on, scans)| Dir | Board | Role |
|---|---|---|
transmitter/ | Seeed XIAO nRF52840 | On the wheel, battery powered. Reads the button cluster and broadcasts presses over connectionless BLE advertising. |
receiver/ | ESP32-C3 | Behind the dash, always powered. Scans for the broadcasts and drives the head unit's SWC input. |
Each subproject is a self-contained PlatformIO project — open the subdirectory (not this root) in your IDE, or build from inside it:
cd transmitter && pio run # or: pio run -t upload
cd receiver && pio runSignal path: button resistance → ADC voltage → BLE packet → mux channel selection → resistance on the SWC wire → voltage read by the head unit.
The wheel's 9 buttons form a resistor ladder on a single analog wire: each button connects a different cumulative resistance (360 Ω–16.46 kΩ) to ground. The XIAO idles in sleep (~20 µA) and wakes on a button press via a GPIO PORT event. It then drives the ladder through a 5.1 k series resistor, samples the node with the ADC (median of 3), and classifies the button by comparing the resistance against a threshold table.
Button events are broadcast as connectionless BLE advertisements (no pairing, no connection) carrying 7 bytes of manufacturer data:
[FF FF] [42] [01] [button] [event] [seq]
company magic version 0-8 PRESS/HOLD/RELEASE +1 per eventRepeatable buttons (VOL±/SRC±) re-send HOLD every 200 ms while held. Every frame is re-broadcast unchanged until the next event, which serves as a heartbeat. The chip returns to sleep 1 s after release.
An ESP32-C3 scans passively at 100% duty cycle. The BLE callback filters on company + magic + version, deduplicates by sequence number (each frame arrives many times), and writes the newest event into a single-slot mailbox (overwrite, not a FIFO: queued stale PRESS/RELEASE events would no longer describe the current button state). A local rotary encoder (volume knob) is decoded by a quadrature state machine; each detent enqueues one tap into a ring buffer.
Both inputs are consumed by a single output state machine — the only code that drives the output pins. A held wheel button is mirrored: its code is asserted while the button is held, re-asserted only when the button changes, and released on RELEASE or after 500 ms without a heartbeat (failsafe against a dead transmitter). Encoder detents are counted and emitted as 50 ms press pulses with 50 ms spacing between pulses.
Asserting a button: two 74HC4051 analog multiplexers (shared S0–S2 select lines; per-mux active-low enables with 10 k pull-ups so both muxes are off until the firmware initializes) connect one of nine fixed resistors between a head-unit SWC wire and ground. Each mux common reaches its SWC wire through a photoMOS solid-state relay (see power-fail isolation below). Electrically this is identical to a wired OEM button press.
The head unit holds each SWC input at 3.335 V through an internal ~650 Ω pull-up and reads the divider voltage produced by the pressed button's resistance (V = 3.335 · (R + R_on) / (R + R_on + 650), with mux R_on ≈ 130 Ω). In learning mode it stores one voltage per button and later matches live readings within roughly ±50 mV.
Installed codes:
| Ref | Button | Mux/channel | Resistor | Wire voltage |
|---|---|---|---|---|
| R1 | VOL_UP | M1 / Y0 | 100 Ω | 0.87 V |
| R2 | SRC_PUSH | M1 / Y1 | 220 Ω | 1.16 V |
| R3 | SRC_UP | M1 / Y2 | 330 Ω | 1.38 V |
| R4 | SRC_DOWN | M1 / Y3 | 470 Ω | 1.60 V |
| R7 | CALL_END | M2 / Y2 | 680 Ω | 1.85 V |
| R8 | VOICE | M2 / Y1 | 1 k | 2.11 V |
| R5 | VOL_DOWN | M1 / Y4 | 2 k | 2.55 V |
| R9 | ANSWER | M2 / Y0 | 3.3 k | 2.80 V |
| R6 | MUTE | M1 / Y5 | 6.8 k | 3.05 V |
| — | idle | — | open | 3.335 V |
(M1 common → SSR → SWC wire 1, M2 common → SSR → SWC wire 2, shared ground. Support parts: R10/R11 = 10 k pull-ups on the mux enables, C1/C2 = 100 nF decoupling at each mux VCC, U3/U5 = AQY212EH photoMOS relays with R12/R13 = 680 Ω LED resistors.)
The nine values are chosen for voltage spacing on the head unit's divider — minimum ~215 mV between any two codes on the combined axis (placed on the rarely-used SRC pair), ≥ 245 mV around the volume/mute/call buttons, and the set is collision-free even if the head unit compares both wires against one learned list. They are unrelated to the wheel's own ladder values: a resistance code is only meaningful relative to the pull-up that reads it, and the two sides have different pull-ups (5.1 k vs ~650 Ω) — the wheel's 16.46 kΩ top value would compress to unusably small voltage steps on a 650 Ω divider.
The receiver is powered from the head unit's own USB port, and the head unit can be on while the receiver is dead — during engine cranking (the head unit sheds its USB load for a few seconds) or with the cable unplugged. An unpowered 74HC4051 is not an open circuit: like most CMOS parts it has ESD protection diodes from every signal pin to VCC, so the head unit's 650 Ω pull-up back-feeds through the mux common into the dead 3.3 V rail. The SWC wires sag from 3.335 V to ~2.2 V — right at a learned code's window, with others swept through on the way — so a dead receiver used to press phantom buttons. No firmware can help, because none is running.
As defense in depth, the button assignment accounts for this: the ~2.1 V slot nearest the back-feed voltage belongs to VOICE (a phantom there only pokes the voice assistant), while the phone-critical ANSWER sits at 2.80 V, far from every measured fault voltage.
The fix is a normally-open photoMOS relay (Panasonic AQY212EH) in series between each mux common and its SWC wire. The relay's input side is an internal infrared LED fed from the raw USB 5 V rail through 680 Ω (~5.5 mA, inside the datasheet's recommended 5–10 mA band; still ≥4 mA above the 3 mA guaranteed trigger at the worst-case corner of USB's 4.4 V floor, max LED Vf, and resistor tolerance). The only coupling to the output MOSFETs is light: when USB power dies the LED goes dark and the outputs become a genuinely open circuit, so the wires float at the 3.335 V idle exactly as if nothing were connected. The LED resistors tap the 5 V node ahead of the module's regulator and bulk capacitance so the relays open before the 3.3 V rail can sag into the back-feed region.
Cost of the extra series element: ~0.85 Ω on-resistance, which shifts the most sensitive code (VOL_UP) by ~3 mV and the gaps between codes by even less — re-running the head unit's learning mode after installation absorbs it entirely.
Everything not listed below is original work under MIT.
receiver/src/rotary_encoder.{h,cpp} — quadrature state tables derived from
Ben Buxton's rotary library,
Copyright 2011 Ben Buxton, GPL v3. These two files remain under GPL v3 (it
cannot be relicensed to MIT); fine for private/personal use, but they carry
GPL terms if this repo is ever distributed.circuit/custom/Seeed_Studio_XIAO_Series.kicad_sym and
circuit/custom/XIAO-nRF52840-DIP.kicad_mod — KiCad schematic symbol and
footprint from Seeed Studio's official
XIAO KiCad libraries
(symbols,
footprints),
© Seeed Studio, CC BY-SA 4.0
(Seeed wiki resources license). The footprint has local modifications;
as CC BY-SA derivatives, these two files remain CC BY-SA 4.0.
circuit/custom/ESP32-C3_SUPERMINI_TH.kicad_sym,
circuit/custom/MODULE_ESP32-C3_SUPERMINI_TH.kicad_mod, and
circuit/custom/ESP32-C3_SUPERMINI_TH.step — symbol, footprint, and 3D model
from SnapMagic Search (SnapEDA),
CC BY-SA 4.0 with Design Exception 1.0
(the exception lets designs and boards built with these files be licensed
freely; the files themselves remain CC BY-SA with attribution).
circuit/custom/XIAO-nRF52840 v15.step — 3D board model from the GrabCAD
Community Library:
Seeed Studio XIAO nRF52840 (Sense).
⚠️ GrabCAD community models are licensed for private use; public
redistribution requires the uploader's permission.
3d models/battery_case.FCStd and 3d models/Battery Enclosure - cr2450.stl
— CR2450 battery holder: FreeCAD project created to modify, and the modified
STL exported from, the
CRxxxx battery holder generator
output by shusy on Cults3D, CC BY-NC — both files remain CC BY-NC.
3d models/transmitter_case.FCStd is original work but embeds the modified
holder, so it is not usable commercially as a whole.
Designed with KiCad (PCB) and FreeCAD (enclosure); the PCB was brought into the FreeCAD enclosure project with kicadStepUp (easyw, AGPL-3.0). Firmware built with PlatformIO. Tool licenses do not apply to this repo's content.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 680 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 680, 680 R1, 680 R2 |
| 3 | MountingHole_2.2mm_M2 | MountingHole:MountingHole_2.2mm_M2 | 1, 2, 3 |
| 2 | 100nF | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | 104 C1, 104 C2 |
| 2 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 10k, 10K |
| 2 | 74HC4051 | 01 Custom:MUX_74HC4051_Module | MUX 1, MUX 2 |
| 2 | AQY212EH | Package_DIP:DIP-4_W7.62mm | photoMOS 1, photoMOS 2 |
| 1 | 100 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 100 |
| 1 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 1k |
| 1 | 220 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 220 |
| 1 | 2k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 2k |
| 1 | 3.3k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 3.3k |
| 1 | 330 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 330 |
| 1 | 470 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 470 |
| 1 | 6.8k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | 6.8k |
| 1 | Conn_01x03_Pin | Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_Vertical | J1 |
| 1 | Conn_01x04_Pin | Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical | J2 |
| 1 | Conn_02x06_Top_Bottom | Connector_PinHeader_2.54mm:PinHeader_2x06_P2.54mm_Vertical | J3 |
| 1 | ESP32-C3_SUPERMINI_TH | 01 Custom:MODULE_ESP32-C3_SUPERMINI_TH | U4 |

abhijithvijayan/wireless-steering-wheel-controls
Wireless steering-wheel audio controls for a car head unit.


ThunderSloth/walkin-pir-interface
Battery-Powered PIR Motion Interface (Isolated Dry Contact)

fossasia/pslab-hardware
PSLab Hardware Design and Schematics https://pslab.io

eddyem/stm32samples
Code samples and ready projects based on bare-metal STM32




sporkus/le_capybara_keyboard
Capactive sensing (EC) pcb for Le Chiffre keyboard
It measures 56 × 47 mm and has 2 copper layers, 1.6 mm thick.
26 parts, built around the 74HC4051 and AQY212EH. 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.
From the abhijithvijayan/wireless-steering-wheel-controls repository on GitHub, at the commit this page was made from: the board is circuit/receiver/receiver.kicad_pcb and its schematic circuit/receiver/receiver.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
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).