Tim's Digital Calliper Interface

by Palingenesis in Workshop > Tools

5543 Views, 67 Favorites, 0 Comments

Tim's Digital Calliper Interface

Tims Digital Calliper Interface 002.png
Tim's Digital Calliper Interface [Talk data transfer]

🛠️ 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:

  1. Wire and decode the calliper’s data stream via UART
  2. Prototype the interface on a solderless breadboard
  3. Create a polished PCB version with help from PCBWay
  4. 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 PCB from PCBWay.— 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

Tims Digital Calliper Interface 007.png
STM8S103F Module 02.png
830 Solderless Breadboard.png
Cable Breadboard.png
NPN.png
MH MINI 360.png
Logic Level Converter 01.png
USB to Serial.png
Cable Flat 4 Way.png
Resistors.png
Digital Calliper.png
PCBWay1200x1000.png


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:

  1. A full Bill of Materials (BOM) is available on my Shared Projects Page at PCB from PCBWay.
  2. 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

  1. Solderless Breadboard (830-point)
  2. Many connecting cables

Core Interface

  1. STM8S103 Module Make sure the chip ends in 3P — the 2P version doesn’t have enough memory.

Small Components

  1. 2× 4.7kΩ Resistors — I²C pull-ups
  2. General Purpose NPN Transistors — for 1.5V level shifting
  3. 4× 10kΩ Resistors — used in the level shifter
  4. 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.
  2. 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
  2. LED (Blue) — useful for debugging STM8S103F code
  3. 1× 76Ω Resistor — for LED current limiting

Cables & Connectors

  1. 1× UART to USB Module. For Prototype version.
  2. USB Cable (USB-A Plug) For pro, version.
  3. Four-core cable — for connection to the calliper. I use 4-Way servo cable.
  4. 1× Four-pin connector — to fit the calliper This connector may need to be fabricated.

Programming Tools

  1. ST-Link V2 Programmer
  2. ST Visual Develop IDE — available from STMicroelectronics

Prototype [Fritzing]

Tims Digital Calliper Interface 003.png
Tims_Digital_Caliper_Interface_bb.png
Tims_Digital_Caliper_Interface_schem.png

🧭 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.

  1. The digital calliper runs on a small 1.5V battery, and the voltage supplied by your interface must not exceed this.
  2. The battery inside the calliper is not rechargeable — it should be removed before connecting the interface plug.
  3. 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]

Tims Digital Calliper Interface 004.png
Tims Digital Calliper Interface 005.png
Tims Digital Calliper Interface 006.png
Phone Extension 01.png
Phone Extension 02.png

🔍 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

ST-Link v2.png
STM8S103F Module 02a.png
ST-Link.png

the STM8S103F microcontroller needs to be programmed.

🧰 What You’ll Need:

  1. ST Visual Programmer Download and install the ST Visual Develop IDE from STMicroelectronics — it includes the programmer tool.
  2. 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:

  1. SWIM (Single Wire Interface Module) — this is the method we’ll use for STM8
  2. 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:

  1. 3.3V
  2. GND
  3. RST
  4. SWIM

These are same-to-same connections — match each pin directly between the ST-Link and the STM8 module.

Your attached images show:

  1. The STM8S103 module with labelled programming pins
  2. The ST-Link device as bought and assembled
  3. The correct wiring setup

💾 Programming the Microcontroller

To program the STM8S103F:

  1. Open ST Visual Programmer
  2. 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]

01 Configuration 001.png
01 Configuration 002.png
01 Configuration 003.png

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:

  1. Make sure STM8S103F3 is selected in the dropdown box at the top toolbar (A)
  2. You can also set this in the Configuration Dialog Window (B)

⚙️ Opening the Configuration Window

Follow these steps to configure ST Visual Programmer:

  1. Click Configure on the toolbar (1)
  2. Choose Configure ST Visual Programmer (2)
  3. In the dialog window that opens:
  4. Set Hardware to ST-LINK (3)
  5. Set Port to USB (4)
  6. Set Programming Mode to SWIM (5)
  7. Set Device to STM8S103F3 (6)
  8. Click OK to confirm (7)

⚠️ Notes on Module Variants

I’ve purchased several STM8S103F modules from eBay. So far, I’ve encountered two variants:

  1. STM8S103F2 8 KB ❌ Not compatible
  2. STM8S103F3 16 KB ✅ Works for this project
  3. Only the STM8S103F3 variant works reliably for this build due to its larger flash memory.


🔐Programming [OPTION BYTE]

04 Options 001a.png
04 Options 002.png
04 Options 003.png
04 Options 004.png

The OPTION BYTE tab is used to configure special settings on the STM8S103F3, including unlocking the microcontroller if needed.

🧭 Loading the Option Byte File

  1. Select the OPTIONS BYTE tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. Browse to the location where you downloaded OPTIONS_BYTE.s19 (4)
  5. Select the file (5)
  6. Click Open

🚀 Uploading the Option Byte

Once the file is loaded:

  1. Click Program on the toolbar (6)
  2. Select Current tab (7)
  3. This will apply the option byte settings to the microcontroller.


🧠Programming [DATA MEMORY]

03 Data 001.png
03 Data 002.png
03 Data 003.png
03 Data 004.png

This step uploads the data memory configuration to the STM8S103F3.

📂 Loading the Data Memory File

  1. Select the DATA MEMORY tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. In the dialog window:
  5. Browse to the location where you downloaded DATA_MEMORY.s19 (4)
  6. Select the file (5)
  7. Click Open (6)

🚀 Uploading the Data Memory

Once the file is loaded:

  1. Click Program on the toolbar (7)
  2. Select Current tab (8)

The data memory file will now upload to the microcontroller.

💾Programming [PROGRAM MEMORY]

02 Program 001.png
02 Program 002.png
02 Program 003.png
02 Program 004.png

Now that the configuration is complete, it’s time to upload the main firmware to the microcontroller.

🧭 Loading the .s19 File

  1. Select the PROGRAM MEMORY tab (1)
  2. Click File on the toolbar (2)
  3. Choose Open (3)
  4. In the dialog window:
  5. Browse to the location where you downloaded tims_servo_tester.s19 (4)
  6. Select the file (5)
  7. Click Open (6)

🚀 Uploading the Firmware

Once the file is loaded:

  1. Click Program on the toolbar (7)
  2. Select Current tab (8)

The file will now upload to the STM8S103F3 microcontroller.

Software

Tims Digital Calliper Interface 007.png
Tims Digital Calliper Interface 008.png
Tims Digital Calliper Interface 009.png
Tims Digital Calliper Interface 010.png

💻 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:

  1. Select the COM Port that represents the USB connection to your callipers.
  2. Click the “Connect” button.

✨ Application Features

  1. Toggle Display Mode Double-click the metric or imperial output to isolate that unit. Double-click again to return to full display.
  2. Hidden Calibration Mode When connected to an interface, you can access a calibration check:
  3. Disconnect USB power from the callipers.
  4. Set the callipers to just over 1mm apart.
  5. Reconnect USB power.
  6. Select COM Port and click “Connect”.
  7. Click the “Cal” button to open the Calibration Check window.
  8. In this mode:
  9. Closing the callipers shows a reading of about +6mm.
  10. Opening them reduces the value.
  11. Once opened past 6mm, you’ll see negative values.
  12. Measuring a 6mm calibration block gives you a reversed value — this is the offset you add to normal measurements.
  13. I suspect this mode is used in commercial inspection setups where callipers are permanently connected to factory stations.
  14. 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]

Tims_Digital_Caliper_Interface_(Front).png
PCBWay1200x1000.png
Tims Digital Calliper Interface 015.png
Tims Digital Calliper Interface 016.png
Tims_Digital_Caliper_Interface_(Back ).png
Tims Digital Calliper Interface 014.png
Tim's Digital Calliper Interface [All done and working]

Let’s make a PCB for the hardware!

I get all my PCBs from PCB from PCBWay, and I’ve created a Shared Project on PCB from PCBWay that you’ll be able to order directly from.

PCB from PCBWay

🔧 Here: Tim's Digital Calliper Interface

I use PCB from PCBWay, 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.

  1. 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.
  2. 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 PCB from PCBWay have an option for populated boards, just select "PCB + Assembly". This way you will receive a PCB all ready to go.

  1. You will still need to program the Microcontroller, That is quite easy just follow my instruction.
  2. You will still need to make the cable, I have not yet found a source for the plugs that go into the Callipers.

PCB from PCBWay have a good and friendly team, you can ask questions if you need help.

Above are photos of the PCBs, I received.

  1. 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 PCB from PCBWay Shared Projects has been updated with a USB Socket.
  2. 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

  1. The PCB uses standard 2mm pin-spaced connectors — the cheap kind, not Grove-style.
  2. You don’t have to use connectors — you can solder cables directly if you prefer. The option is there.
  3. The USB connector supplies power to the interface via the USB cable.
  4. The calliper connection should receive 1.5V — make sure to check this before powering up.
  5. There’s a dedicated I²C connector for adding an optional 1602 LCD with PCF8574 I²C adaptor (5V).


🧵 Cables & Wiring Tips

  1. If you’re making your own calliper plug using a phone extension socket, you’ll already have the cable you need.
  2. For USB, use a cable with a USB-A plug to the PC, Mini-USB to the Interface.
  3. ❌ Avoid USB-C — they’re more complicated and often have extra circuitry.
  4. ✅ USB-A cables use a simple 4-wire setup, perfect for this project.


🔩⚙️🔬Fabrication

Tim's Digital Calliper Interface [PCB Part 1]

Tim's Digital Calliper Interface [PCB Part 2]

🧰 Why No Case?

Tims_Digital_Caliper_Interface_Case 003.png
Tims_Digital_Caliper_Interface_Case 004.png

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:

  1. A cabinet to house three displays
  2. A way to mount LCDs in a visible spot (especially if the calliper’s own display is hidden)
  3. A more bespoke case tailored to your machine layout


🔩 Basic Case Details

  1. Screws: Flat-nose M1.7 × 6mm self-tapping
  2. Washers: 2x required
  3. Files: STL files for the basic case are attached

Optional Display

Tims Digital Calliper Interface 013.png

This is what the readout looks like an an LCD.

🔧Signal Protocol

Calliper_CN.png
Tim's Digital Calliper Interface [Protocol CN]

🔧 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

  1. The data line is typically stable during the clock pulse, but in rare cases (especially at start-up), it may shift early.
  2. 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.
  3. 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.