Overview
A DIY RC ride-height gauge built around an ESP32, an AS5600 magnetic angle sensor, and a small SSD1306 OLED display. A linkage converts suspension height into sensor rotation, which the firmware turns into a live height readout in millimeters or inches.
Hardware
- ESP32 DevKit (WROOM) - any ESP32 board
- AS5600 I2C magnetic angle sensor (
0x36) - SSD1306 0.91" 128x32 I2C OLED (
0x3C) - 2x tactile buttons (ZERO and optional UNIT toggle)
Shared I2C bus: SDA = GPIO21, SCL = GPIO22. Buttons are active-low using internal pull-ups (ZERO = GPIO0, UNIT = GPIO4).
Calibration
MM_PER_COUNT maps AS5600 counts (0-4095) to millimeters of height change:
// Example: 0 mm -> 2000 counts, 10 mm -> 3000 counts
// MM_PER_COUNT = 10.0 / (3000 - 2000)
#define MM_PER_COUNT 0.01f
#define INVERT_DIRECTION false
Features
- Direct AS5600 register reads (no external library dependency)
- Large, readable height display to 2 decimal places
- Zero calibration via button, mm/inch unit toggle
- Wrap-around handling for angle transitions, button debouncing and flicker-reduced updates
Build
pio run --target upload
pio device monitor # 115200 baud
An Arduino IDE workflow (Adafruit SSD1306 / GFX libraries) is also documented.