Interfacing a Digital Micrometer to a Arduino & VGA Monitor




About: 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), Wind, and veggie oil fueled diesel generator power for 6 y...

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.


male shrouded header to fit mitutoyo cable -

PN2222A -

(2) 10k Ohm Resistors -

6 pin male header (wires to Arduino) -

optional momentary push-button switch -

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

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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;
long value_int; //was an int, could not measure over 32mm
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 - and

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


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, and we are grateful for the input from 4DSYSFAN and others.

Make It Real Challenge

Participated in the
Make It Real Challenge

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    29 Discussions


    4 months ago

    Just needed to get data off my mitutoyo digimatic to print in arduino. Worked first try, no troubleshooting necessary. This is great, thank you so much.


    Question 1 year ago

    Very nice, thanks. I plan to use this setup for long term measurements to be taken periodically each day/week or even month using Mitutoyo indicator. I plan to put Arduino to deep sleep between the measurements, it should be easy.

    What about the Mitutoyo indicator? Will it auto power-off or stay on forever, possibly depleting batteries quite soon? And if it does auto power-off, would it wake up once the activity on cable pins happens? Or do I need to press the ON button possibly by a small servo attached to the Arduino?

    1 answer

    Answer 8 months ago

    Most Mitutoyo indicators do not power off automatically and their digimatic absolute instruments usually will run a year or more on a battery before it runs down.


    1 year ago


    Found that there is a bug (I'm using ID-F150). When going over 32mm with dpp = 3 the output changes to -32mm and heads back down to 0. Changed the value_int to long type and fixed the problem. Int is a signed two's complement so once the leading 1 is zero the polarity flips...


    2 replies

    Reply 1 year ago

    No worries. My apologies, I forgot to say great instructable!


    2 years ago

    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.

    The solution turned out to be very easy. I changed the i variable for loop to close on the line after "mydata[i] = k;" vs "value = value_int / dpp;" as it's shown above.


    3 years ago


    Great job. I want to get "continuous" 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).

    Thank you!


    1 reply

    Reply 3 years ago

    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.


    3 years ago

    If you could.


    3 years ago

    do you have a spec sheet for both? The website says the new one has the SPC data output. What voltage differences do you see?


    3 years ago

    The product specs claim it's a digimatic protocol, so it "should" work. I don't have one of those to test.


    3 years ago


    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?

    Thank You

    2 replies

    Reply 3 years ago

    Yes on both counts. I'll try to get the code posted shortly.


    Reply 3 years ago

    Thank you for the reply, I am looking forward to seeing it. Awesome project by the way.


    4 years ago on Introduction

    hello, great instructable.

    Two questions please.

    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?

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

    Thanks again for the info...

    3 replies

    Reply 4 years ago

    Now that I have the Igaging SPC connectivity working, I have more time to build a VGA output 3 axis reader. Still need one?


    Reply 3 years ago

    Just finished the 2 interface board. Two such boards will give you up to 4 instrument measurements.


    Reply 4 years ago

    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.