Arduino Interface for Mitutoyo SPC Data Port

I started looking for an inexpensive electronic indicator with digital output port, and ended up splurging for a genuine Mitutoyo. Sure it is over five times the cost of the Harbor Freight alternative, but I thought it would be worth the price for two reasons. One: Mitutoyo is known for high quality precision instruments, and two: they are popular enough that the data output port should be documented somewhere online.

The second point turned out to be moot because the data output port was actually documented by pamphlet in the box, no need to go hunting online. But I went online anyway to get a second opinion, and found this project on Instructables. Most of the information matched up, but the wiring pinout specifically did not. Their cable schematic had a few apparent inconsistencies. (Example: one end of the cable had two ground pins and the other end did not.) They also had a “Menu” button that I lacked. These may just be the result of different products, but in any case it is information on the internet to be taken with a grain of salt. I took a meter to my own cable to ensure I have the pinout described by the pamphlet in my own instrument.

Their Arduino code matched the pamphlet description, so I took that code as a starting point. I then released my derivative publicly on GitHub with the following changes:

  • Calculate distance within numeric domain instead of converting to string and back.
  • Decimal point placement with a single math expression instead of a list of six if statements.
  • Their code didn’t output if value is inch or millimeter, I added units.

A limitation of their code (that I did not fix) is a recovery path, should the Arduino falls out of sync. The Mitutoyo protocol was designed with a recovery provision: If the communication gets out of sync, we can sync back up using the opening 0xFFFF. But since there’s no code watching for that situation, if it falls out of sync our code would just be permanently confused until reset by the user.

For debugging I added the capability to output in raw hex. I was going to remove it once I had the distance calculation and decimal point code figured out, but I left it in place as a compile-time parameter just in case that would become handy in the future. Sending just hexadecimal data and skipping conversion to human-readable text would allow faster loops.

Note that this Mitutoyo Statistical Process Control (SPC) protocol has no interactive control — it just reports whatever is on the display. Switching units, switching direction, zeroing, all such functions are done through device buttons.

Once it all appears to work on the prototyping breadboard, I again soldered up a compact version and put it inside a custom 3D printed enclosure.

This image has an empty alt attribute; its file name is mitutoyo-spc-arduino-compact.jpg

4 thoughts on “Arduino Interface for Mitutoyo SPC Data Port

  1. Hello! I am trying to recreate this, bought the cord and the dial indicator, but mine did not come with a technical data sheet that included what the different pins on the data output cable were. Can you possibly post or share that information? Thanks!

    Like

    1. My cord didn’t come with any documentation, only the dial indicator had information describing which electrical contacts served which function. From there I had to probe electrical continuity on the cord to figure out which pin went where.

      My indicator documentation is visible in the title image of this post and previous post (first link on this page.) Right-click on the image and open in a new tab. Edit the URL to remove the width scaling parameter (it’ll look something like “?w=1200”) to download the full resolution image.

      If you say “what title image?” Some WordPress reader apps don’t show my title image, I don’t know why. If so, please try reading this page on a desktop computer browser.

      Like

  2. Hi Roger,

    I am building an instrument that needs to read a frequency response up to 22.3 Hz. I would like to use a Mitutoyo scale with SPC. But I don’t know its data transfer rate. Do you know how fast your setup can sample?

    Regards,

    Rodney

    Like

    1. I have not explored maximum sampling rate as my application did not have the same performance requirements as yours. However, I do know the serial transmission consumed majority of time. Higher sampling rate will require some optimizations. Ideas off the cuff: increase baud rate beyond 9600, use a different protocol (I2C?), batch data for higher throughput, etc.

      Like

Leave a Reply to Rodney Wong Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s