Interfacing a Digital Micrometer to a Microcontroller

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. Parts available from Hacktronics. Email me if you want a kit.

Digital Micrometer

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 2×5 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.

Step 3: Reading the Mitutoyo output

Digital Micrometer Schematic

The heavy lifting part of the code, that reads the data stream, reassembles it in correct order and prints a measurement is as follows:// get data from mic// {

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)); // read data bits, and reverse order )


// extract data

mydata[i] = k;

//      sign = mydata[4];

//      decimal = mydata[11];

//      units = mydata[12];


// assemble measurement from bytes

char buf[7];

for(int lp=0;lp<6;lp++)



num=atol(buf); //assembled measurement, no decimal place added

// Serial.println(num);

[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]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


Arduino Mega or compatible

Protoshield recommended

2 PN2222A transistors
four 10k Ohm resistors
2×5 shrouded header
one momentary pushbutton[/box]

For more detail: Interfacing a Digital Micrometer to a Microcontroller

1 thought on “Interfacing a Digital Micrometer to a Microcontroller”

  1. Hey there! I’m at work browsing your blog from my new iphone! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the superb work!

Leave a Comment

Your email address will not be published.

= 3 + 7

(Spamcheck Enabled)

Scroll to Top