ESP32 firmware that reads measurement data from a cheap digital caliper and displays it on a 128×32 SSD1306 OLED screen.
Digital calipers expose a 2-wire interface (CLK + DATA). The ESP32 captures each 24-bit packet via a rising-edge interrupt on CLK, then decodes the measurement value, sign, and unit (mm/inch) from the packet's bit fields. The result is rendered on the OLED with a proportional ruler graphic.
| Part | Notes |
|---|---|
| ESP32 dev board | Any variant works |
| Digital caliper | Standard cheap caliper; open it to access the data pads |
| 128×32 SSD1306 OLED (I2C) | Connected to default ESP32 I2C pins |
Wiring
| Caliper | ESP32 |
|---|---|
| DATA | GPIO 14 (DATA_PIN) |
| CLK | GPIO 13 (CLK_PIN) |
| GND | GND |
| OLED | ESP32 |
|---|---|
| SDA | GPIO 21 |
| SCL | GPIO 22 |
| VCC | 3.3 V |
| GND | GND |
- Clone:
git clone https://github.com/Fyfar/digital_caliper_protocol.git - Open
digital_caliper.inoin Arduino IDE. - Install the GyverOLED library (Library Manager).
- Wire up the hardware (see table above).
- Flash to your ESP32.
The logic_analyzer_data/ directory contains Saleae Logic capture files (.sal) of real caliper packets at known positions — useful for understanding the protocol without hardware:
| File | Measurement |
|---|---|
0mm.sal |
Zero position |
0.1mm.sal |
0.1 mm |
1mm.sal |
1 mm |
2mm.sal |
2 mm |
100mm.sal |
100 mm |
-0mm.sal |
Negative zero (after zeroing at non-zero position) |
-100mm.sal |
−100 mm |
*capture.sal |
Same positions, longer recording window |
2mm 5s timer.sal |
2 mm with 5 s idle to capture the auto-sleep transition |
Open any .sal file in Saleae Logic 2 to inspect CLK and DATA traces.
MIT — see LICENSE.