ESP32 Haptic Telemetry

HAXEL

A unified Hardware Abstraction Layer, declarative pattern engine, and real-time haptic control portal.

01 // INTRODUCTION

What Is Haxel?

Haxel is what happens when you ask "why doesn't WLED exist for haptics?" It's open-source firmware that turns any ESP32 board and a motor driver into a web-controlled haptic engine you can tune from any wireless device with a browser.

The name is the concept. A haxel (haptic pixel) is one discrete sample of vibration: amplitude and frequency collapsed into a single addressable value, just as a pixel collapses red, green, and blue into one unit of visible light. Where LED engines stream spatial arrays of color to pixel strips, Haxel streams temporal arrays of intensity to mechanical actuators.

The architecture is directly inspired by Pixelblaze, which drives thousands of LEDs through a scriptable expression engine on an ESP32. Haxel applies the same model to haptics, but the stakes are different. For the Deaf and Hard-of-Hearing community, programmable audio-reactive haptics aren't a novelty; they're a sensory bridge. Haxel's goal is to make that bridge open-source, zero-cost, and accessible to anyone with an ESP32 and a motor.

Feature Legacy Haptic Control Haxel (HAL)
Driver Integration Hardware-specific register hacking per driver IC Unified Hardware Abstraction Layer
Pattern Generation Hardcoded non-blocking loops Declarative pattern library runtime
Control Interface Serial monitor & manual uploads Mobile-first captive portal web UI
Audio Reactivity Custom DSP / external hardware filters Built-in 32-band FFT & envelope follower
Actuator Support Single actuator style per compile Dynamic LRA, ERM, Solenoid mapping

Live Portal Simulator

Tactile Actuator Telemetry
60 FPS
Active: Pulse Wave
connected

Quick Control Panel

70%
150 Hz
1.0x
15%
Type 130 Motor Gentle / LRA
ESP32-C3 Hardware Board Emulator AP: HAXEL-ESP32
ESP32-C3 GPIO8 (RGB) SDA (G1) SCL (G2) PWM (G3) TX (G21) RX (G20) 3V3
USB Serial Monitor (115200 baud)
02 // THE PROBLEM

Why Haptic Accessibility Is Hard

The idea of converting sound into touch is not new. It belongs to a research tradition called sensory substitution, the systematic replacement of one sensory channel with another. Paul Bach-y-Rita demonstrated tactile-visual substitution in 1969, and the field has since produced devices like the BrainPort (tongue-based electrotactile vision) and David Eagleman's VEST (a vibrotactile vest for hearing). The underlying neuroscience of cross-modal plasticity shows that the brain can repurpose cortical areas when an input modality is missing. This prior work suggests that structured tactile signals could, over time, become interpretable by the wearer (a hypothesis Haxel intends to evaluate in the Section 11 user study).

But building an accessible, programmable haptic device runs into two distinct challenges.

The Frequency Mismatch

Human hearing spans roughly 20 Hz to 20,000 Hz, a 1000:1 range. Haptic actuators respond to maybe 50 to 250 Hz, a 5:1 range. Compressing a thousandfold dynamic range into a fivefold one produces what is effectively brown noise: the actuator vibrates in a constant, muddy hum with no distinguishable structure, and the mechanical stress will eventually destroy it. Direct linear mapping is not viable.

Hardware Fragmentation

Every actuator type is fundamentally different. An LRA needs AC resonance tracking. An ERM just wants a DC voltage threshold. A solenoid is a different beast entirely. Normally that means a separate codebase for each one, locking projects into a single hardware configuration and making experimentation expensive.

04 // AUDIO-REACTIVE PIPELINE

From Sound to Structured Touch

Haxel's audio-reactive pipeline ingests raw sound through either an analog aux port or an I2S digital microphone and runs a 256-point FFT to decompose the full 0โ€“20 kHz spectrum into 32 log-spaced bands in real time. The goal is sensory substitution: translating the structure of sound into tactile patterns that a user can feel, learn, and eventually interpret, serving as a direct accessibility bridge for the Deaf and Hard-of-Hearing.

Instead of mapping the full spectrum linearly (which, as described in Section 02, produces brown noise), the FFT output is divided into configurable frequency brackets. By default, these are low (bass), mid (vocal), and high (treble), and each bracket drives an independent haptic pattern generator. Bass energy might trigger sharp staccato solenoid impacts. Mid-range vocal presence could modulate a sustained ERM rumble. High-frequency transients produce rapid micro-pulses. The design aims to establish **structured tactile semantics**: the user doesn't feel "sound"; they feel distinct, learnable textures that correspond to acoustic categories.

03 // ARCHITECTURE

How the HAL Works

Haxel's Hardware Abstraction Layer solves the fragmentation problem. A single firmware image supports LRAs, ERMs, and solenoids through a unified driver pipeline running inside a FreeRTOS task. You swap hardware, not codebases.

Dynamic Resonance Tracking

LRAs only feel right at their physical resonant frequency, usually somewhere between 170 and 235 Hz. Haxel reads back-EMF signals from the active driver continuously and nudges the output frequency to stay locked to resonance, so you don't have to measure it yourself or recompile when you swap actuators.

Waveform Synthesis

Patterns run through a flat-bytecode interpreter that outputs normalized intensity values between 0.0 and 1.0. The active HAL driver then translates those into whatever the hardware actually needs: voltage ramps for an LRA, PWM duty cycles for an ERM, or timed pulses for a solenoid.

Input

Pattern Studio / FFT

Generates normalized bytecode values (0.0 to 1.0)

0.0 - 1.0
โ†’
HAL Core

Dynamic Calibration

  • Resonance Tracker (reads back-EMF)
  • Motor Startup Floor offset
  • Weber-scale compensation
โ†’
Drivers
LRA Driver
AC Resonance Loop
ERM Driver
PWM Duty Cycle
Solenoid Driver
Timed Pulse Triggers
โ†’
Actuators
LRA (Mechanical Resonance)
ERM (DC Centrifugal Force)
Solenoid (Linear Impact)
05 // PATTERN STUDIO

Scriptable Expression Engine

Haxel's Pattern Studio provides a Pixelblaze-inspired scripting environment for authoring haptic waveforms. Users write mathematical expressions using built-in functions like wave(), triangle(), square(), and noise(), which are compiled in real-time and executed against the virtual motor at 60 ticks per second. Variables like t (elapsed time), freq (frequency shift), and speed (playback rate) are injected automatically.

Haptic Scripting Examples

Write math formulas directly in the studio console. Key code patterns include:

Sharp Pulse (Click)
wave(t * 10) * (wave(t * 10) > 0.85)

Sawtooth Ramp Sweep
(t * speed) % 1.0

Rhythmic Staccato
square(t * 4) * noise(t) * 0.7

Resonant Sine Breathing
wave(t * (freq * 0.05)) * 0.5 + 0.5

Workflow Integration

Custom patterns can be saved to the library and immediately assigned to any frequency bin in the audio-reactive pipeline. This closes the loop between authoring and deployment: you write a pattern, feel it on your phone or actuator, and assign it to respond to bass hits, vocal presence, or cymbal transients, all without recompiling firmware.

06 // PRIOR ART

Related Work & Differentiation

Haptic feedback for music and accessibility is an active research area with several notable systems:

Neosensory Buzz

A wristband for Deaf users that maps audio to vibrotactile patterns across multiple actuators. While functionally related, Haxel distinguishes itself by focusing on a fully open-source platform, utilizing standard off-the-shelf components, and exposing a client-side user-scriptable pattern sandbox.

Subpac

A wearable bass transducer (backpack/seat form factor) designed for music producers. Focuses on single-channel low-pass tactile sub-bass reproduction, whereas Haxel targets multi-band frequency-band partitioning and scriptable pattern modulation.

Eagleman's VEST

David Eagleman's Versatile Extra-Sensory Transducer: a vibrotactile vest for hearing. Demonstrates cross-modal plasticity in longitudinal academic studies. Haxel aims to adapt these sensory-substitution principles into a low-cost, highly accessible DIY framework.

Emoti-Chair

Ryerson University's multi-channel vibrotactile chair for music appreciation. Maps audio bands to physical zones across the chair. Haxel scales down these multi-channel sound-localization advantages into a portable, field-configurable, and wearable package.

Haxel's differentiation is the intersection of four properties: open-source design, user-scriptable patterns, configurable frequency-band partitioning, and near-zero hardware cost (an ESP32-C3 board plus a motor driver typically costs under $8 in components).

07 // NOVEL CONTRIBUTION

Frequency-Band Partitioning

The core technical contribution of Haxel is its approach to the audio-to-haptic mapping problem. Rather than applying a single transfer function to the entire audio spectrum or distributing linear frequency bands across a fixed actuator array, Haxel decomposes the FFT output into N user-configurable frequency brackets, each driving an independent haptic pattern generator.

Haptic Mapping Algorithm

01

FFT Decomp

256-point FFT at 44.1 kHz sample rate produces 128 raw frequency bins. Haxel downsamples and aggregates these into 32 log-spaced bands (0 to 20,000 Hz) to capture full musical details.

โ†’
02

Partitioning

Dividers split the 32 log-spaced bands into N contiguous brackets (up to 5 bands).

โ†’
03

Envelope

Each band's average magnitude is computed and scaled by gain.

โ†’
04

Modulation

Volume envelope modulates its assigned haptic pattern function.

โ†’
05

Max-Merge

Output takes the maximum of all band outputs to drive the motor.

Why Configurable Granularity Matters

The optimal number of frequency bands is not universal. For music with simple spectral structure (solo voice, acoustic guitar), two or three bands may suffice. For complex electronic music with distinct sub-bass, mid-bass, vocal, presence, and air bands, five partitions provide meaningfully different tactile textures. The ability to add or subtract bins at runtime, and to assign NONE to any bin, gives users control over the information density of their haptic experience.

08 // PSYCHOPHYSICS

Haptic Perception Science

The design decisions in Haxel are grounded in the psychophysics of vibrotactile perception. Understanding the biological hardware that receives haptic signals constrains what is possible and guides what is useful.

Mechanoreceptors

Pacinian corpuscles, located deep in the skin and joints, are the primary vibration detectors. They are most sensitive between 200 and 300 Hz. While standard LRAs operate slightly lower at 170 to 235 Hz, this range overlaps significantly with the Pacinian response band, allowing effective coupling. Meissner's corpuscles, closer to the skin surface, respond to lower frequencies (10 to 50 Hz) and detect flutter and texture. Haxel's frequency shift control allows tuning output to target either receptor population.

Pacinian (250 Hz)
Meissner (25 Hz)

Perceptual Thresholds

The Just Noticeable Difference (JND) for vibrotactile amplitude is approximately 15 to 20% change in intensity. This means pattern functions that modulate below this threshold will feel like a constant hum. Haxel's pattern library is designed with JND-exceeding contrast: pulse patterns alternate between 0% and 100%, and even subtle patterns like "ambient" maintain at least 25% peak-to-trough variation.

Above JND (ฮ” 30%)
Below JND (ฮ” 5%)

Temporal Resolution

Humans can distinguish separate haptic events spaced as close as 5 to 10 milliseconds apart. Haxel's animation loop runs at approximately 60 ticks per second (16.7 ms per tick), which falls within the temporal resolution window for distinct event discrimination. For patterns requiring faster modulation (staccato, micro-pulse), the underlying PWM frequency operates in the kilohertz range.

Discrete (>10ms)
2 Felt Impacts
Fused (<5ms)
1 Constant Buzz

Weber's Law

Perceived intensity follows a logarithmic relationship, not a linear one. A doubling of voltage does not produce a doubling of perceived vibration strength. Haxel's master intensity slider operates on a linear 0-255 scale, but the Motor Startup Floor calibration and HAL driver curves compensate for the nonlinear perceptual response of the actuator-skin system relative to Weber's Law.

Input Power (Linear)
Perceived Strength (Logarithmic)
09 // REAL-TIME CONSTRAINTS

Latency Budget

Research on audio-haptic synchronization perception shows that users detect desynchronization above approximately 50 milliseconds. Haxel's end-to-end latency budget from audio input to actuator response must stay below this threshold to feel "live."

Real-time Constraints

To prevent perceptible audio-haptic lag, the entire pipeline must execute well under the 50 ms human synchronization threshold. Haxel schedules tasks directly in FreeRTOS to prioritize motor output.

Total Budget

Estimated end-to-end latency is 10 to 15 ms, calculated as empirical design constraints based on the ESP32-C3 firmware execution model (DMA buffer intervals and FreeRTOS task timings). FreeRTOS task scheduling runs the haptic loop at elevated priority with core jitter below 1.4 ms, ensuring that haptic feedback feels instantaneous relative to the audio events.

STAGE 01
Audio Capture
~5.8 ms
I2S DMA buffer fills in ~5.8 ms at 44.1 kHz sample rate
โ†’
STAGE 02
FFT Analysis
~1.2 ms
256-point FFT on ESP32-C3 RISC-V core: ~1.2 ms
โ†’
STAGE 03
Pattern Eval
< 0.5 ms
Bytecode interpreter tick completes in < 0.5 ms
โ†’
STAGE 04
Driver Output
~0.3 ms
DRV2605L register write via 400 kHz I2C: ~0.3 ms
โ†’
STAGE 05
Motor Response
3-8 ms
Mechanical ring-up LRA response takes 3 to 8 ms
Perceptual Budget Comparison
Haxel: ~10-15 ms Limit: 50 ms
10 // CALIBRATION

Motor Startup Floor

The Motor Startup Floor control addresses a real electromechanical engineering problem: static friction (stiction). All rotating and oscillating actuators have a minimum input energy required to overcome bearing friction and begin moving. Below this threshold, the motor receives power but produces no perceptible vibration; the energy is entirely consumed by friction.

ERM Stiction

Eccentric Rotating Mass motors have the highest stiction threshold due to bearing friction and the inertia of the offset weight. Typical minimum duty cycle to initiate rotation is 15 to 25% of maximum input. Below this, the motor stalls: it heats up without spinning.

LRA Ring-Up

Linear Resonant Actuators don't have bearings, but they do have a ring-up period: the number of oscillation cycles needed to reach steady-state amplitude at their resonant frequency. If the pattern switches direction before ring-up completes, the actuator produces weak, inconsistent output. The startup floor ensures the minimum drive level exceeds the ring-up threshold.

Haxel's startup floor remaps the entire pattern output range. At 0% floor, the output spans 0.0 to 1.0 as authored. At 15% floor, the output spans 0.15 to 1.0, guaranteeing that any nonzero pattern value produces perceptible motion. The simulator's stall detection warns when the floor is set too low for the selected actuator type.

Hardware Safety & Motor Protection

Hardware & Electromechanical Protection: Because Haxel is a general-purpose engine driving inductive motor loads, several firmware and circuit safety boundaries are supported:

  • Engine Fault State Machine: The firmware implements a dedicated EngineState::FAULT safety state. When a fault is raised (via raiseFault()), the engine halts the real-time execution loop (Engine::tick() returns early) and shuts off all motor drive. Haptics remain completely stopped until the user explicitly clears the fault state via the web API (sending a {"clear": true} state patch).
  • Watchdog Extensions: While the fault-handling engine is fully implemented, active triggers (e.g., continuous duty-cycle timeout or temperature sensor inputs) are left as customizable hardware extension points. Builders can easily bind custom safety checks to trigger raiseFault() on their specific ESP32 pin configurations.
  • Inductive Back-EMF Protection: Vibration motors are inductive loads. When drive current is cut, the collapsing magnetic field creates high-voltage spikes. The hardware implementation must include flyback diodes or dedicated driver ICs (like the DRV2605L) with integrated overcurrent and thermal shutdown.
  • Stall Protection: Operating motors below their stiction threshold (startup floor) causes them to draw current without rotating, producing purely resistive heat. Configuring a proper startup floor directly mitigates this electromechanical stall condition.
11 // FUTURE WORK

Roadmap & Evaluation

Several research and engineering directions remain open for future development:

User Study

A controlled evaluation with Deaf and Hard-of-Hearing participants is the next critical milestone. The proposed study design: N=5 to 10 participants, each exposed to bass-heavy, vocal-heavy, and treble-heavy music tracks through haptic-only feedback. Primary metric: can participants correctly identify which frequency category dominates? Secondary metrics: subjective preference ratings, pattern discriminability scores, and learning curves over repeated sessions.

Multi-Actuator Arrays

The current architecture drives a single actuator. Extending the HAL to support spatial arrays (multiple actuators mapped to different body locations) would enable richer tactile experiences, similar to the Emoti-Chair's spatial approach but with Haxel's scriptability and portability.

Over-the-Air Pattern Sharing

A community pattern repository where users can upload, share, and download haptic patterns. This would accelerate the discovery of effective audio-to-haptic mappings through collective experimentation rather than individual trial and error.

Adaptive Frequency Partitioning

Machine learning models that automatically adjust bin boundaries based on the spectral content of incoming audio. For example, detecting that a song is bass-heavy and automatically narrowing the bass bin to increase resolution in that range, while widening treble bins where less information is present.

This work is suitable for submission to venues such as ACM CHI (Human-Computer Interaction), ACM ASSETS (Accessible Computing), or IEEE World Haptics Conference, particularly once user evaluation data is collected.