[Maris] wanted a way to read measurements from a digital caliper electronically. He ended up using the TI Launchpad to accomplish this, but not all of the necessary hardware is seen above. The calipers cost him about $7 on eBay, and they have four interface pins which made this hack quite a bit easier. After a bit of probing he established their purpose; voltage, ground, clock and data. A bit of scoping proved that data was being sent in 24-bit burst in packets that are quite easy to decode.
From there it’s just a matter of interfacing with a microcontroller. The chip he’s using is an MSP430G2231 that runs at 3.3V, but the caliper’s logic high is only 1.5v. By constructing an adapter using a pair of transistors, the data and clock from the calipers are able to pull pins on the MSP430 low. This is collected and analyzed by [Maris’] firmware and can be read on a PC using a terminal program.
21 thoughts on “Reading A Digital Caliper With A Microcontroller”
This is an interesting hack that has already been hashed over a few times in several machinists forums. There’s a couple projects out there to read multiple calipers at the same time so you can use the cheap Chinese calipers as DRO’s (digital readouts) to know the absolute positions of your X/Y/Z/Quill on a vertical/horizontal mill or lathe
that uC works great with two rechargeable AA batteries @ 2.4V, datasheet says 1.8V minimum.
$7 is a nice price for those i can only find one for $12.
now pair it with a laser.
Nice hack, now we can monitor fruits growth
Nice link Kris.
They have a iPod DRO. That looks slick. It would probably look really nice with a larger screen. Like the colour nook, or any android tablet.
this is a malicious link now
I always figured that was an unpopulated usb jack.
Please tell me I’m not the only person who read the title as Reading a digital caliper with a micrometer
I had run an experiment a year ago. I put 2 different calipers n the oscilloscope and reverse-engineered the protocols they used. They had different protocols, and also i found a third one:
Glad you like it! I have the link in my article to guy I bought it from for 7$ including slow shipping (I have no connection to him whatsoever). Others where closer to 10$ as you say.
Yeah, you could pair couple of those with miling machine and make small CNC type of thing. My initial idea was to use it as position sensor for motocycle suspesion data loging, but 8 times a second won’t be enough for that.
“Nice hack, now we can monitor fruits growth”
And use the fruit’s acid to run the low-power TI uC !
NO! I read it once , thought about it, and thought reading a digital caliper digitally. And thought well gee thats dumb just look at the lcd. Then the second time I realized what they meant.
You guys covered [David Cook] using a digital caliper as a depth gauge on his milling machine.
It would be nice to get that RS232 protocol converter miniaturized; you could go wireless with a bluetooth-serial module.
If you need more speed, try this: give up on the SPC data interface and get the encoder signals directly. I suggest you try to find them, not at the pickup or read head, but after a stage of amplification. You’re looking for a pair of square waves in quadrature (90 deg. apart in phase).
Since the signals would probably not be CMOS- or TTL-compatible, you might have to buffer them up with a couple of transistors.
Your Launchpad should be plenty quick enough to keep up with the count at the rate your bike suspension will move.
I’ve done a couple of projects with microcontrollers reading and doing math on encoder outputs. If you should need a little insight, feel free to ask.
He is lucky with those transistors. Conditioning a bidirectional push-pull line (think MOSI/MISO at 10 MHz) with ubiquitous discrete components would be nightmare in comparison.
You mean to read directly before that small caliper mcu, like directly those capacitance sensors? Yeah, that sounds interesting… but as you say I’m not sure how much “energy” those signals would have… If you have any more pointers/links, feel free to send them my way. If that works out, could be nice topic for another article :)
There is an open source package called OpenDRO that has C code to read these using an ARM. I know a lot of work has been put into that project with different scales. Some of them use different protocols.
One thing that’s really nice is that the OpenDRO code puts the capable calipers into a high resolution mode so you can actually get more digits out, though probably at questionable accuracy.
Oh hell yes! I’ve been wondering how to interface with the port on my digital caliper (Same as pictured) and I have three Launchpads I’ve barely touched! :3
Similar post with tons of basic explanation and video:
I e-mailed you a rather long thing of my comments on how to parse the two square waves – I thought it too long to post here. Sorry everybody; I don’t have a good place where I can leave it forever.
However I thought that two other comments might be of interest:
1. As to low-energy signals, let me suggest that I would connect them to the gates of FETs, then the loading would be very small.
2. Here’s a new idea I just had this week to get a longer linear encoder from cheap calipers. I’m excited to try it. You see I have a very small home milling machine with 14″ X-axis travel, so no cheap caliper will have a long enough stroke. Here’s my idea: I chain two of them together in series. They will both extend and collapse randomly together. Since we now know how to do conversion math on the square wave inputs, I run the outputs of BOTH calipers to my conversion circuit and output equivalent A, Abar, B and Bbar signals equivalent to the sum of what the two calipers are doing.
Happy Holidays, all.
The TI [censored] still haven’s shipped my order from August. Calling TI support is like calling the phone company “We don’t care. We don’t have to.”
Hi, Im doing a project also using a digital caliper, what type of caliper would you surgest using, I will also pickup the signal, (the data stream) to fead into my own circuit, and where can I find the type of protocols they use?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)