Skip to content

Fyfar/digital_caliper_protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Caliper to OLED Display

ESP32 firmware that reads measurement data from a cheap digital caliper and displays it on a 128×32 SSD1306 OLED screen.

OLED display showing measurement

How It Works

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.

Hardware

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

Getting Started

  1. Clone: git clone https://github.com/Fyfar/digital_caliper_protocol.git
  2. Open digital_caliper.ino in Arduino IDE.
  3. Install the GyverOLED library (Library Manager).
  4. Wire up the hardware (see table above).
  5. Flash to your ESP32.

Logic Analyzer Captures

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.

License

MIT — see LICENSE.

About

This is a fun little project for anyone who wants to mess around with digital calipers and microcontrollers. I built this using an ESP32 board I had lying around to read data from a cheap digital caliper and display the measurements on an OLED screen.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages