Learn How to Read Cheap Digital Caliper Values on a Raspberry Pi

Matthias Wandel's guide demonstrates how to use a Raspberry Pi to communicate with cheap digital calipers.

Cameron Coward
2 months agoCommunication

Cheap digital calipers are incredible tools. For about $20, you can purchase a simple device that will let you take very precise and accurate linear measurements. They aren’t quite as good as their more expensive brethren, but they’re suitable for most tasks that makers tackle. However, you have to look at the built-in LCD screen to see the measured values. If you want to use those values in some piece of software, you have to enter them manually. Except, you don’t! Matthias Wandel has a guide that will walk you through reading digital caliper values on a Raspberry Pi.

Wandel used the same inexpensive digital calipers that we all own. They’re available from a bunch of different retailers and with a bunch of different brand names printed on the bodies, but they’re all pretty much the same. And, as Wandel notes, they all have a PCB with pads for data communication. Those are usually underneath a removable cover—though some models may omit the cover and force you to cut a hole in the plastic.

By examining the communication from those pads with an oscilloscope, Wandel was able to determine that the data consists of two 24-bit words sent over synchronous serial at 76800 baud, three times every second. That operates at a 1.5V logic level, matching the battery.

To read the data on a Raspberry Pi, Wandel first had to bring that logic level voltage up to something more appropriate. On a Raspberry Pi, the dividing line between HIGH and LOW sits at 1.8V, so 1.5V logic levels would always read LOW. A converter IC would fix that, but Wandel simply used a few resistors to build a voltage divider circuit. It provides 1.5V to the calipers (eliminating the battery) and boosts logic levels to straddle that 1.8V threshold.

With suitable logic levels, Wandel then wrote a program to read the measurements. The incoming data provides an absolute value and a negative value for the zero point. With both of those, the program can return either the absolute value or the relative measurement based on the zero. The program can also reset the zero point. Wandel originally wrote that in Python, but switched to C for better performance.

This could be useful for all kinds of applications. You could, for instance, use cheap calipers to provide closed-loop feedback for motor control on a machine. Or you can build custom software that uses the readings for reverse-engineering purposes.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles