Tim's Digital Calliper Interface
by Palingenesis in Workshop > Tools
5543 Views, 67 Favorites, 0 Comments
Tim's Digital Calliper Interface
🛠️ Build a USB Digital Calliper Interface with STM8S
Featuring a Fractional Inch Display App — Available on Microsoft Store
Whether you're machining, woodworking, or just love precision, digital callipers are a must-have tool. But what if you could take that measurement data and display it on your PC — with full decimal accuracy and familiar imperial fractions like “5/8″”?
In this project, I’ll show you how to build a USB interface for a digital calliper using an STM8S microcontroller, and pair it with a custom desktop app that displays live measurements in both metric and imperial formats. The app even highlights common fractional inch values — just like commercial callipers do, but with more control and clarity.
You’ll learn how to:
- Wire and decode the calliper’s data stream via UART
- Prototype the interface on a solderless breadboard
- Create a polished PCB version with help from PCBWay
- Download and use the Windows app from the Microsoft Store
Let’s make precision measurement more readable, more shareable, and more fun.
📘 Terminology: “Calliper” vs “Callipers”
Why the spelling matters — and why it doesn’t
In this guide, you'll see the word calliper used to describe the digital measuring tool connected to your PC. Some readers might be more familiar with caliper (American spelling), or even callipers (plural form). Here's a quick breakdown:
TermMeaningUsage Notes
Calliper
Singular form (British English) for the measuring tool
Used in this guide to describe the tool as a system or interface
Callipers
Plural form, often used even for a single tool
Common in everyday speech due to the tool’s two jaws — like “scissors”
Caliper
American spelling (singular or plural)
Appears in datasheets, product listings, and US-based documentation
🔧 Why “calliper” here? This project focuses on building an interface for a single digital calliper — a tool with multiple components working together to take precise measurements. While “callipers” is widely accepted, especially in casual use, we’ve chosen “calliper” to reflect the tool as a unified system and to match British technical writing conventions.
🧠 Tip for readers: If you're searching for parts or datasheets online, try both spellings — calliper and caliper — to get the widest results.
🔍 What You’ll Build
This guide walks you through interfacing a digital calliper with a PC, enabling live measurement display and fractional inch recognition. Unlike traditional vernier callipers, which require manual reading, this project uses a microcontroller to decode and transmit data from the digital calliper’s internal protocol.
You’ll start with a breadboard prototype, then move on to a professional PCB version I have had made from
.— ready for repeatable builds and clean documentation.
⚠️ Note: This Instructable isn’t about how to use a set of digital callipers — it’s about how to interface them with a Windows-based PC via USB, and display live measurements on screen.
Supplies
Digital Calliper
This interface is designed for basic Chinese digital callipers, which use a simple protocol: a burst of two 24-bit values. These are commonly found on budget callipers and are ideal for DIY interfacing.
Software
The companion application for this project is available on the Microsoft Store — no warnings from Windows about unknown publishers! You can download it here:
️ Professional Version
For the PCB version:
- A full Bill of Materials (BOM) is available on my Shared Projects Page at
. - You can also order the PCB directly from that page.
Building the Prototype
The prototype is built on a solderless breadboard — perfect for quick testing and experimentation.
Prototyping Essentials
Core Interface
- 1× STM8S103 Module Make sure the chip ends in 3P — the 2P version doesn’t have enough memory.
Small Components
- 2× 4.7kΩ Resistors — I²C pull-ups
- 2× General Purpose NPN Transistors — for 1.5V level shifting
- 4× 10kΩ Resistors — used in the level shifter
- 1× 0.22µF Capacitor — smoothing
Power Supply & Logic Levelling
- 1× Logic Level Shifter Module Used only in the prototype — STM8S103 runs at 3.3V.
- 1× Buck Converter (e.g. MINI-360) Used to generate 1.5V for the calliper.
The STM8S103 module receives 5V from USB and regulates it down to 3.3V internally.
Optional Components
- 1× 1602 LCD with PCF8574 I²C adaptor
- 1× LED (Blue) — useful for debugging STM8S103F code
- 1× 76Ω Resistor — for LED current limiting
Cables & Connectors
- 1× UART to USB Module. For Prototype version.
- 1× USB Cable (USB-A Plug) For pro, version.
- 1× Four-core cable — for connection to the calliper. I use 4-Way servo cable.
- 1× Four-pin connector — to fit the calliper This connector may need to be fabricated.
Programming Tools
- 1× ST-Link V2 Programmer
- ST Visual Develop IDE — available from STMicroelectronics
Prototype [Fritzing]
🧭 Wiring Diagram & Voltage Warning
I’ve included a Fritzing File also added PDF and PNG for quick reference to show how the prototype should be wired on a solderless breadboard.
⚠️ Important Note:
Make sure the output voltage of the buck converter (MINI-360) is correctly set before powering the calliper.
- The digital calliper runs on a small 1.5V battery, and the voltage supplied by your interface must not exceed this.
- The battery inside the calliper is not rechargeable — it should be removed before connecting the interface plug.
- Always check the voltage at the plug before powering up to ensure there are no wiring mistakes or overvoltage risks.
🔌A Calliper Connector [A Rare Item]
🔍 One Thing to Check First
Before diving into the build, make sure your set of digital callipers has a data socket for external communication. Not all callipers support data transfer — some are purely standalone.
The socket is usually located above the battery compartment, and its cover slides upward, similar to how the battery cover slides down. If your callipers don’t have this socket, they won’t work with this interface.
🔌 Finding a Plug for the Calliper
Getting a plug to fit the digital calliper is surprisingly difficult — they’re pretty much non-existent unless you buy an expensive bespoke lead. You’d think the Chinese manufacturers would sell the plugs separately, considering they sell just about everything else… but no luck.
So I got creative.
I found something with the right pin spacing: an old land-line phone wall socket — not the plug, but the socket itself. These old phone line extensions are cheap to buy online, and inside them is a plastic frame that holds brass pins.
I dismantled the socket and carved out a plug from that frame. The brass pins needed a bit of reshaping to slide into the calliper’s connector properly, but it worked. Hopefully the images I’ve included show what I mean.
🧪 Alternative Method
If you can’t find a suitable plug or don’t want to modify one, there’s another option: You can solder wires directly to the traces on the calliper’s PCB. Or, if you have a compatible socket and plug pair, you could solder the socket to the calliper PCB and use that instead.
🧠Programming the STM8S103F
the STM8S103F microcontroller needs to be programmed.
🧰 What You’ll Need:
- ST Visual Programmer Download and install the ST Visual Develop IDE from STMicroelectronics — it includes the programmer tool.
- ST-Link v2 USB Programmer This is required to upload code to the STM8S103F.
🔌 Connecting the ST-Link to the STM8S103F
The ST-Link can connect in two ways:
- SWIM (Single Wire Interface Module) — this is the method we’ll use for STM8
- SWD (Serial Wire Debug) — used for ARM chips, not applicable here
For STM8, you’ll need to connect four wires between the ST-Link and the STM8S103F:
- 3.3V
- GND
- RST
- SWIM
These are same-to-same connections — match each pin directly between the ST-Link and the STM8 module.
Your attached images show:
- The STM8S103 module with labelled programming pins
- The ST-Link device as bought and assembled
- The correct wiring setup
💾 Programming the Microcontroller
To program the STM8S103F:
- Open ST Visual Programmer
- Follow steps 4 to 7.
Note: The attached files have a .s19.TXT extension to allow uploading. After downloading, remove the .txt extension so the files end in .s19.
These .s19 files contain the compiled firmware needed to run the Digital calliper Interface.
🛠️Programming [Configuration]
Once you're connected as described in Step 2, you're ready to configure the programmer.
🧭 Selecting the Correct Microcontroller
When you open ST Visual Programmer, it's crucial to select the correct device:
- Make sure STM8S103F3 is selected in the dropdown box at the top toolbar (A)
- You can also set this in the Configuration Dialog Window (B)
⚙️ Opening the Configuration Window
Follow these steps to configure ST Visual Programmer:
- Click Configure on the toolbar (1)
- Choose Configure ST Visual Programmer (2)
- In the dialog window that opens:
- Set Hardware to ST-LINK (3)
- Set Port to USB (4)
- Set Programming Mode to SWIM (5)
- Set Device to STM8S103F3 (6)
- Click OK to confirm (7)
⚠️ Notes on Module Variants
I’ve purchased several STM8S103F modules from eBay. So far, I’ve encountered two variants:
- STM8S103F2 8 KB ❌ Not compatible
- STM8S103F3 16 KB ✅ Works for this project
- Only the STM8S103F3 variant works reliably for this build due to its larger flash memory.
🔐Programming [OPTION BYTE]
The OPTION BYTE tab is used to configure special settings on the STM8S103F3, including unlocking the microcontroller if needed.
🧭 Loading the Option Byte File
- Select the OPTIONS BYTE tab (1)
- Click File on the toolbar (2)
- Choose Open (3)
- Browse to the location where you downloaded OPTIONS_BYTE.s19 (4)
- Select the file (5)
- Click Open
🚀 Uploading the Option Byte
Once the file is loaded:
- Click Program on the toolbar (6)
- Select Current tab (7)
- This will apply the option byte settings to the microcontroller.
🧠Programming [DATA MEMORY]
This step uploads the data memory configuration to the STM8S103F3.
📂 Loading the Data Memory File
- Select the DATA MEMORY tab (1)
- Click File on the toolbar (2)
- Choose Open (3)
- In the dialog window:
- Browse to the location where you downloaded DATA_MEMORY.s19 (4)
- Select the file (5)
- Click Open (6)
🚀 Uploading the Data Memory
Once the file is loaded:
- Click Program on the toolbar (7)
- Select Current tab (8)
The data memory file will now upload to the microcontroller.
💾Programming [PROGRAM MEMORY]
Now that the configuration is complete, it’s time to upload the main firmware to the microcontroller.
🧭 Loading the .s19 File
- Select the PROGRAM MEMORY tab (1)
- Click File on the toolbar (2)
- Choose Open (3)
- In the dialog window:
- Browse to the location where you downloaded tims_servo_tester.s19 (4)
- Select the file (5)
- Click Open (6)
🚀 Uploading the Firmware
Once the file is loaded:
- Click Program on the toolbar (7)
- Select Current tab (8)
The file will now upload to the STM8S103F3 microcontroller.
Software
💻 Software Overview
The LCD display is actually optional. I designed the Digital Calliper Interface specifically to show readings on a Windows PC, using a custom desktop application.
While creating the interface, I had enough space and resources on the microcontroller to add LCD support — but the main goal was always PC-based display.
Because distributing raw install files often makes Windows throw a wobbly and question my integrity, I’ve published the application through the Microsoft Store. You can download it here:
🔌 Connecting to the Callipers
To connect the interface:
- Select the COM Port that represents the USB connection to your callipers.
- Click the “Connect” button.
✨ Application Features
- Toggle Display Mode Double-click the metric or imperial output to isolate that unit. Double-click again to return to full display.
- Hidden Calibration Mode When connected to an interface, you can access a calibration check:
- Disconnect USB power from the callipers.
- Set the callipers to just over 1mm apart.
- Reconnect USB power.
- Select COM Port and click “Connect”.
- Click the “Cal” button to open the Calibration Check window.
- In this mode:
- Closing the callipers shows a reading of about +6mm.
- Opening them reduces the value.
- Once opened past 6mm, you’ll see negative values.
- Measuring a 6mm calibration block gives you a reversed value — this is the offset you add to normal measurements.
- I suspect this mode is used in commercial inspection setups where callipers are permanently connected to factory stations.
- Fractional Inch Display While measuring in imperial mode, the app shows a fraction equivalent to the decimal value — if it’s within ±0.005″ of a known fraction. This makes it easier to interpret measurements in familiar terms like “5/8″” or “3/16″”.
🧾Lets Go Professional [Building the PCB Version]
Let’s make a PCB for the hardware!
I get all my PCBs from
, and I’ve created a Shared Project on
that you’ll be able to order directly from.
🔧 Here: Tim's Digital Calliper Interface
I use
, Because of there fast turnaround and the quality of the PCB, The silk screen is very good and accurate for lining components up, also my graphics come out very nice. They have a selection of colours that you can chose from that makes the overall appearance so cool.
- I went for Blue Solder Mask instead of the traditional Green, I think Blue Solder Mask gives it a nice warm look and the contrast between the Blue Solder Mask and White Silk Screen makes text and graphics look verry clear.
- You can see how well the Solder Mask works in my video, it aids the solder paste pool up and position itself and the components in the correct place. This makes DIY a lot easier than with a home made PCB.
I like to populate my PCBs my self as you can see in my videos, if you are not up to this task
have an option for populated boards, just select "PCB + Assembly". This way you will receive a PCB all ready to go.
- You will still need to program the Microcontroller, That is quite easy just follow my instruction.
- You will still need to make the cable, I have not yet found a source for the plugs that go into the Callipers.
have a good and friendly team, you can ask questions if you need help.
Above are photos of the PCBs, I received.
- Please note I have changed one of the connectors to a USB socket. I have no Idea why I originally made all connectors the same, the PCBs on the
Shared Projects has been updated with a USB Socket. - In the videos you will notice mistake (Elephant in the room haha).
🔌 Programming the STM8S103F
On the back of the PCB, you’ll find four labelled pads for programming. I use fly-leads soldered directly to these pads to flash the firmware onto the STM8S103F.
🔗 Connector Layout
- The PCB uses standard 2mm pin-spaced connectors — the cheap kind, not Grove-style.
- You don’t have to use connectors — you can solder cables directly if you prefer. The option is there.
- The USB connector supplies power to the interface via the USB cable.
- The calliper connection should receive 1.5V — make sure to check this before powering up.
- There’s a dedicated I²C connector for adding an optional 1602 LCD with PCF8574 I²C adaptor (5V).
🧵 Cables & Wiring Tips
- If you’re making your own calliper plug using a phone extension socket, you’ll already have the cable you need.
- For USB, use a cable with a USB-A plug to the PC, Mini-USB to the Interface.
- ❌ Avoid USB-C — they’re more complicated and often have extra circuitry.
- ✅ USB-A cables use a simple 4-wire setup, perfect for this project.
🔩⚙️🔬Fabrication
🧰 Why No Case?
Oh, go on then — here’s a basic 3D-printable case for the PCB. But let’s be honest: does it really need one?
If you’re just using a single calliper at your desk, with the interface sitting next to your PC, then a case might be overkill. This simple shell will tidy things up — but it’s not essential.
🧠 I usually like showing off the bare PCB — especially when I’ve made it myself.
🏗️ When a Case Does Matter
If you’re integrating callipers into a DIY CNC machine, things change. You’ll likely be using three interfaces — one for each axis (X, Y, Z) — and mounting them somewhere permanent. That’s when a custom enclosure becomes useful.
In those setups, you might want:
- A cabinet to house three displays
- A way to mount LCDs in a visible spot (especially if the calliper’s own display is hidden)
- A more bespoke case tailored to your machine layout
🔩 Basic Case Details
- Screws: Flat-nose M1.7 × 6mm self-tapping
- Washers: 2x required
- Files: STL files for the basic case are attached
Optional Display
This is what the readout looks like an an LCD.
🔧Signal Protocol
🔧 PulseView Decoder for CN Protocol
When I first connected my digital callipers to a signal inspection interface, I realized there wasn’t a suitable decoder available for the CN protocol they use. I searched through existing PulseView decoders, but none matched the timing or bit structure of my callipers.
So I built one.
The decoder is written specifically for this protocol and is designed to be beginner-friendly, reproducible, and easy to inspect in PulseView. It’s available on GitHub here: 👉 Tim's Digital Calliper Interface [Protocol CN]
📎 Signal Timing and PulseView Insights
While developing the digital calliper interface, I used PulseView to inspect the raw protocol signals. This revealed a subtle timing issue:
At the start of the first frame, the data line transitions slightly before the clock pulse ends — potentially causing the decoder to misread the bit.
This anomaly is only visible when the calliper is connected to a signal inspection interface like mine. It does not affect normal operation, and measurements remain accurate when used standalone.
🔍 What I Learned
- The data line is typically stable during the clock pulse, but in rare cases (especially at start-up), it may shift early.
- My decoder samples the data line at the falling edge of the clock, which can catch the next bit’s value if the transition happens too soon.
- To avoid misreads, I considered sampling earlier — but since the pulse must be validated first, I chose to leave it as-is.
✅ Why It Doesn’t Matter for Users
This glitch only appears at the beginning of the first frame and doesn’t affect real-world measurements. It’s a start-up artifact, not a persistent error. Unless you’re decoding the protocol directly, you’ll never encounter it.
