As it happens, I’d like the ability to quickly take measurements into a spreadsheet, mainly for quickly taking the average of 3D printer filament measurements. Unfortunately, these cables seem needlessly expensive ($150 for the cheapest compatible Mitutoyo cable, $80 for the official cables from iGaging). That and, as it happens, these two devices use two different cables. I’ll focus on the Micrometer today.
The calipers use the same SPC form factor and protocol that a bunch of Mitutoyo products use. Here’s the official cable from Amazon, and here’s some info about DIY interfacing that with Arduino. Unfortunately, the micrometer, being in their cheaper product range, doesn’t use this same standard. Instead, it’s got a regular old USB plug up top.
Best I can tell, this is just to trip you up. I plugged it in to my computer, and predictably, nothing happened – it’s not USB. On the plus side, whatever it is, I can probably interface with it using a regular old micro USB cable. I spent a few minutes assuming it was the same pinout and protocol as the SPC cable, but just a different form factor. After being unable to probe anything useful with a micro USB breakout for a few minutes, I decided to crack the case open and have a look. Bingo.
This is actually pinned out for a “21-bit” protocol that’s got little to do with the SPC protocol. There’s a wealth of information on interfacing this protocol over at Yuri’s Toys, without which I’d be totally lost. After following that guide and loading up the current version of the Arduino sketch from Rysiu M, I was up and running seeing real data from the mic. The TL;DR version is: there’s a clock and data line. From the reader attached to the micrometer, you feed a 9kHz clock in on SSY, and read out 21 bits in LSB-first one’s compliment. Unfortunately, there’s a bit more to it.
What you get out isn’t actually the value displayed on the screen, like it seems to be for SPC. It appears to be the number of absolute ticks of the internal rotary encoder. For example, with my micrometer closed and zeroed, the value I got out was -109125. This seems to be the number of encoder ticks until an arbitrary “max open” point that occurs for my mic around the 1″ mark. Opening the mic exactly 1mm, the value out is -105095. It follows that there are roughly +4030 ticks per mm, or about 1/4 micron per tick.
But how do we go from that to useful click-a-button-and-get-data-in-excel? It would seem that the interface cable needs a microcontroller in it with a button to set the zero point, and another to select mm or inches, the current state of which you just guess-and-check.
Sure enough, if we look at the official iGaging cable on Amazon that’s compatible with this mic, it’s got three buttons: zero, units, and read out.
So that sort of ends things for now. One button is fine to DIY, but three is RIGHT out 😉 My next move is to build a little board with the requisite buttons, an Arduino Leonardo core, and USB jacks for input and output. We’ll see if I ever get around to it.