Update: Igaging Origin Series use a Mitutoyo cable and output the Mitutoyo 52 bit datastream. The code and schematics below work with SPC Digimatic Calipers, Micrometers, Dial indicators, and Scales from both companies.

Discuss a variety of manufacturer's data formats and interfacing for all microcontrollers and SPC enabled measuring systems, like scales, micrometers, calipers, dial indicators, and more.


We had a project that required connection to a digital micrometer with a data output jack. The idea was to connect a microcontroller to the micrometer, to read the measurements and make decisions based on the readings. The micrometers that we used are made by Mitutoyo, and have a funky 52 character data stream in reverse bit order. The microcontroller we chose is the Arduino, and we used a 4D systems uVGA-II to take serial output from the Arduino and display it on a VGA monitor.

Order a prebuilt interface kit:

male shrouded header to fit mitutoyo cable
(2) 10k Ohm Resistors
6 pin male header (wires to Arduino)

Now includes an onboard Arduino Nano clone with usb cable. No seperate Arduino needed.

Major Components:

Mitutoyo 293-335 Coolant Proof LCD Micrometer, Friction Thimble, 0-1"/0-25.4mm Range, 0.001mm/0.00005" Graduation, +/-0.00005" Accuracy, SPC Output


Mitutoyo 05CZA662, Digimatic Cable, 40", With Data Switch for Coolant Proof Micrometers


Mitutoyo Absolute LCD Digimatic Indicator ID-C, Calculation Type, Inch, #4-48 UNF Thread, 0.375" Stem Diameter


Mitutoyo 500-171-30 Advanced Onsite Sensor Absolute Scale Digital Caliper, 0-6" Range


Mitutoyo 572-211-20, Horizontal Digimatic Scale Unit, 0 -6" X .0005"/0.01mm, With Output


Arduino Mega or compatible

Protoshield recommended

2 PN2222A transistors
four 10k Ohm resistors
2x5 shrouded header
one momentary pushbutton

Step 1: Mitutoyo Cable Schematic

This is a diagram showing how the Mitutoyo cable is wired. There is a red "data" button on the micrometer end of the cable that we were not using in this application, so we decided to use it as a "menu" button.

Step 2: Connecting the Cable to the Arduino

The Arduino connects to the Mitutoyo cable with a few components. A 2x5 shrouded header that mates to the female plug on the cable, a PN2222A transistor, and two 10k Ohm resistors. One resistor is used with the PN2222A to protect the micrometer (or caliper) from excessive voltage, the other to bias the "menu" button to +5vdc.

I've included datasheets for the PN2222A and drivers for the CH340 based Arduino Nano that we now use.

Step 3: Reading the Mitutoyo Output

The heavy lifting part of the code (thanks to Mark Burmistrak for his modifications from my original), that reads the data stream, reassembles it in correct order and prints a measurement is as follows:

int req = 5; //mic REQ line goes to pin 5 through q1 (arduino high pulls request line low)
int dat = 2; //mic Data line goes to pin 2
int clk = 3; //mic Clock line goes to pin 3
int i = 0;
int j = 0;
int k = 0;
int signCh = 8;
int sign = 0;
int decimal;
float dpp;
int units;

byte mydata[14];
String value_str;
int value_int;
float value;

void setup() {


pinMode(req, OUTPUT);

pinMode(clk, INPUT_PULLUP);

pinMode(dat, INPUT_PULLUP);

digitalWrite(req,LOW); // set request at high


void loop() {

digitalWrite(req, HIGH); // generate set request
for( i = 0; i < 13; i++ ) {
k = 0;
for (j = 0; j < 4; j++) {
while( digitalRead(clk) == LOW) {
} // hold until clock is high
while( digitalRead(clk) == HIGH) {
} // hold until clock is low
bitWrite(k, j, (digitalRead(dat) & 0x1));

mydata[i] = k;

sign = mydata[4];
value_str = String(mydata[5]) + String(mydata[6]) + String(mydata[7]) + String(mydata[8] + String(mydata[9] + String(mydata[10]))) ;
decimal = mydata[11];
units = mydata[12];

value_int = value_str.toInt();
if (decimal == 0) dpp = 1.0;
if (decimal == 1) dpp = 10.0;
if (decimal == 2) dpp = 100.0;
if (decimal == 3) dpp = 1000.0;
if (decimal == 4) dpp = 10000.0;
if (decimal == 5) dpp = 100000.0;

value = value_int / dpp;

if (sign == 0) {
if (sign == 8) {
Serial.print("-"); Serial.println(value,decimal);


Step 4: A Few More Auxiliary Schematics

There are a couple more external connections that we added. First, a pair of "sample" buttons (foot and finger) for taking sample measurements of 3 points of a gear before averageing and using the final average number (and rejecting if the samples are too far apart). Second, a reset circuit for the uVGA Card.

Step 5: Output to VGA

We used a uVGA-II (SGC) module from 4D to take the serial output of our Arduino, and display it on a typical vga monitor. The code to do this can be seen in the final step of this instructable. A special thanks to Rei Vilo for his assistance in this section - https://github.com/rei-vilo and http://reivilohobbies.weebly.com/

This has been replaced with the uVGA-III.

In your Arduino sketch, when you want to send data to the uvga module, use a statement like this:

uvga("N", value);

where N is the name of the variable on the uvga, and value is a variable containing the value you want passed.

At the end of your sketch (after the closing bracket of void loop) you have the following function:

int uvga(char* x, int y){



Serial3.println(y, DEC);


I'm using Serial3 on a Mega 2560, but you can use softserial and a UNO.

The code running on the uvga accepts that serial "packet", and puts the value passed into the variable that was passed, where it can then be displayed on the screen. Example code for the uvga is attached. It's a plain text file. You will need 4D's Workshop software and a USB to TTL cable to upload code to the uvga.

Step 6: Complete Code With Measurement Sampling and Vga Output

If you would like to see how we applied this particular solution, we are using it to generate bin numbers for gear sets, based on measurements. Attached is our completed code, which was developed with the assistance of many others from the Arduino, 4D, and Arduinohome forums.

More details are available at http://tech.groups.yahoo.com/group/arduinohome/files/Arduino%20-%20VGA%20-%20Micrometer/

And http://arduinotronics.blogspot.com/2012/03/arduino-to-vga.html

The smaller file is just the code needed to display the raw readings from the micrometer. Divide the variable "num" by 1000 to get output in mm.

Step 7: Now in GFX Mode (4DGL)

We just did a major upgrade to the project. The screen output looks the same, but all the graphics processing has been moved to the uVGA-II. We bought a programming cable from 4D systems, and uploaded the new PmmC file which switches the card from SGC mode (dumb mode) to GFX (co-processor mode). This has greatly sped up the operation of the program. We also integrated a "packet" serial transmission function which sends data to the uVGA-II in serial packets, with a start symbol, a packet ID (designating which variable on the receiving end the data is destined for), and a end of packet symbol). This makes multiple destination data passing very reliable.

Details on this phase of the project can be found at http://4d.websitetoolbox.com/post?id=5858304, and we are grateful for the input from 4DSYSFAN and others.
<p>Based on the comments this hasn't been an issue for anyone else but the code above wouldn't read the bits correctly for my igaging caliper, mic or dial indicator. My oscilloscope showed the right data coming in but the arduino wasn't reading it correctly. </p><p>The solution turned out to be very easy. I changed the i variable for loop to close on the line after &quot;mydata[i] = k;&quot; vs &quot;value = value_int / dpp;&quot; as it's shown above. </p>
<p>Hello,</p><p>Great job. I want to get &quot;continuous&quot; readings from my iGaging IP-54 depth gauge. I have the SPC cable from iGaging. From my noob status it looks like your void section does the measurement, so I wonder if the void section is looped, how many samples per second could I expect to get from this? (using iGaging with Arduino Uno).</p><p>Thank you!</p><p>Bob</p>
The reading is continuous (void loop be definition is looped) and real time. I have not counted the samples per second, but it's faster than the eye can see.
<p>Hello, </p><p>Have you finish the code that would allow for multiple calipers to measured at once? Also do you know how to read if the caliper is either positive or negative?</p><p>Thank You</p>
Yes on both counts. I'll try to get the code posted shortly.
<p>Thank you for the reply, I am looking forward to seeing it. Awesome project by the way.</p>
<p>hello, great instructable.</p><p>Two questions please. </p><p>Are you intending at any point in to making this a 3 (or 4) axis reader? and any tips how I would identify (before I purchase) if a prospective calliper or micrometre would be compatible with this? </p><p>for $15 it's not worth me losing sweat and tears trying to build my own but I would need three axis on the same VGA output. OR serial/ i2c or some sort of output I could connect to a raspberry pi and make my own three axis display. I believe a lot of the cheap Chinese calipers etc use a different protocol but I'm not sure which ones are which...</p><p>Thanks again for the info...</p>
<p>Now that I have the Igaging SPC connectivity working, I have more time to build a VGA output 3 axis reader. Still need one?</p>
<p>Just finished the 2 interface board. Two such boards will give you up to 4 instrument measurements.</p>
If a 3-axis machine DRO for use with Chinese caliper (or even higher quality) scales is what you're after, then search TouchDRO. I've built set ups for a mill and a lathe, and it is a killer way to a DIY DRO.
I looked at TouchDRO, and it's not what I'm looking for. I want more control over what I can do with the signals I'm reading, for activating other equipment, inventory and process control. The Arduino gives me that. I can easily measure a dozen different devices, and save data to a mysql database, display on a vga monitor, and direct other processes to happen. I'm currently reading micrometers, calipers, and scales, and will be expanding the number and types of data formats I can read. I'm working on Igaging Origin series now.<br>
This particular project only works with the Mitutoyo calipers and micrometers. It would be easy to use three gauges,and read all three axis. I'm presently working on a companion piece that works with Igaging equipment. Poor man's DRO if you will.<br>
<p>Now trying to do the same project with an Igaging Origin SpeedMic. Igaging is not being helpful with the pinout or the data spec.</p>
<p>Shumatech has a write-up about the iGaging interface here - <a href="http://www.shumatech.com/web/21bit_protocol?page=0,0" rel="nofollow"> http://www.shumatech.com/web/21bit_protocol?page=...</a></p><p>I have a mitutoyo and am thinking I'll try your example to log data to a PC. I specifically want to automate height profiles as a function of length. This looks like a great way to do it cheaply. Thanks for sharing!</p>
<p>The interface for the Igaging Origin SPC series is not 21 bit, it's the same as the Mitutoyo 52 bit protocol. Igaging bought the SPC interface from a third party.</p>
<p>If you want to add software support for another brand of micrometer, these guys reverse engineered a cheap chinese device: http://robocombo.blogspot.com/2010/12/using-tis-launchpad-to-interface.html and published the specs for the 24bit data stream. I'm not 100% sure, but I suspect (from a quick eyeball with a scope) it may be compatible with the cheap micrometer sold at Harbor Freight, which I've seen priced anywhere between $8 and $16 depending on their convoluted sales and coupon promotions...</p>
<p>Hi !</p><p>Could you please send me a link here to buy the complete kit ?</p><p>Thank you ! </p>
<p>A link to the kit is listed above! It's $15 for the interface board, and comes assembled.</p>
Questions, advice, or general observations appreciated. Please vote if you like this instructable.

About This Instructable




Bio: Professionally, I'm an IT Engineer (Executive Level) and Electronics Tech. I'm a Amateur Radio Operator (KK4HFJ). I lived off grid, with Solar (PV ... More »
More by sspence:DIY I2C LCD Display with Inputs Raspberry Pi & the Neo 6M GPS Earthquake / Vibration Sensor 
Add instructable to: