Interfacing A Digital Micrometer To A Arduino & VGA Monitor - 7 Steps - Instructables
Interfacing A Digital Micrometer To A Arduino & VGA Monitor - 7 Steps - Instructables
Monitor
By sspence in CircuitsArduino
103,348
57
Open Menu
33 circuits
workshop
Save PDF
Favorite
craft
cooking
Introduction:
living
Interfacing a Digital Micrometer to a Arduino
& VGA outside
Monitor
Log InSignup
Search
Professionally, I'm an IT Engineer (Executive Level) and Electronics Tech. I'm a Amateur Radio
Oper… More »
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.
https://groups.yahoo.com/neo/groups/spc_dro/
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.
Breadboard
PN2222A - https://amzn.to/2Mk8XEf
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
and
Mitutoyo 05CZA662, Digimatic Cable, 40", With Data Switch for Coolant Proof Micrometers
OR
Following
Mitutoyo Absolute LCD Digimatic Indicator ID-C, Calculation Type, Inch, #4-48 UNF Thread,
0.375" Stem Diameter
OR
Mitutoyo 500-171-30 Advanced Onsite Sensor Absolute Scale Digital Caliper, 0-6" Range
OR
Mitutoyo 572-211-20, Horizontal Digimatic Scale Unit, 0 -6" X .0005"/0.01mm, With Output
Protoshield recommended
2 PN2222A transistors
four 10k Ohm resistors
2x5 shrouded header
one momentary pushbutton
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.
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.
Projects
I've included
backdatasheets for the PN2222A and drivers for the CH340 based Arduino Nano that
we now use.All Projects
Circuits
Attachmentsback
All
PN2222A.pdfApple
Download Arduino
Art (1).zip
ch340 drivers
Download Assistive Tech
Audio
Cameras
Step 3: Reading Clocks
the Mitutoyo Output
Computers
Electronics
The heavy lifting Gadgets
part of the code (thanks to Mark Burmistrak for his modifications from my
original), that reads
Lasers
the data stream, reassembles it in correct order and prints a measurement
is as follows: LEDs
Linux
int req = 5; //micMicrocontrollers
REQ line goes to pin 5 through q1 (arduino high pulls request line low)
int dat = 2; //micMicrosoft
Data line goes to pin 2
int clk = 3; //micMobile
Clock line goes to pin 3
int i = 0; Raspberry Pi
int j = 0; Remote Control
int k = 0; Reuse
int signCh = 8; Robots
int sign = 0; Sensors
int decimal; Software
float dpp; Soldering
int units; Speakers
Tools
byte mydata[14]; USB
String value_str;Wearables
long value_int; //was an int, could not measure over 32mm
Websites
float value; Wireless
void setup() {
Serial.begin(9600);
pinMode(req, OUTPUT);
pinMode(clk, INPUT_PULLUP);
Workshop
pinMode(dat, INPUT_PULLUP);
back
All
digitalWrite(req,LOW); // set request at high
3D Design
} 3D Printing
Cars
void loop() { CNC
Electric Vehicles
digitalWrite(req,Energy
HIGH); // generate set request
Furniture
for( i = 0; i < 13; i++ ) {
k = 0; Home Improvement
Home
for (j = 0; j < 4; j++) { Theater
Hydroponics
while( digitalRead(clk) == LOW) {
Knives
} // hold until clock is high
Laser Cutting
while( digitalRead(clk) == HIGH) {
Lighting
} // hold until clock is low
Metalworking
bitWrite(k, j, (digitalRead(dat) & 0x1));
} Molds & Casting
Motorcycles
mydata[i] = k; Organizing
Pallets
} Repair
sign = mydata[4]; Science
value_str = String(mydata[5])
Shelves + String(mydata[6]) + String(mydata[7]) + String(mydata[8] +
String(mydata[9] Solar
+ String(mydata[10]))) ;
decimal = mydata[11];
Tools
units = mydata[12];
Woodworking
Workbenches
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;
if (sign == 0) {
Serial.println(value,decimal);
} Craft
if (sign == 8) { back
Serial.print("-");All
Serial.println(value,decimal);
} Art
Books & Journals
Cardboard
digitalWrite(req,LOW);
delay(100); Cards
} Clay
Costumes & Cosplay
AttachmentsDigital Graphics
Duct Tape
Embroidery
Digimatic interface.pdf
Download Fashion
Felt
Fiber Arts
Step 4: A Few More Auxiliary
Gift Wrapping Schematics
Jewelry
Knitting & Crochet
Leather
Mason Jars
No-Sew
Paper
Parties & Weddings
Photography
Printmaking
Reuse
Sewing
Soapmaking
Wallets
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
Cooking
back
All
Bacon
BBQ & Grilling
Beverages
Bread
Breakfast
Cake
Candy
Canning & Preserving
Cocktails & Mocktails
Coffee
We used a uVGA-II (SGC) module from 4D to take the serial output of our Arduino, and display
Cookies
it on a typical vga monitor. The code to do this can be seen in the final step of this instructable.
Cupcakes
A special thanksDessert
to Rei Vilo for his assistance in this section - https://github.com/rei-vilo and
http://reivilohobbies.weebly.com/
Homebrew
Main Course
This has been replaced with the uVGA-III.
Pasta
In your ArduinoPiesketch, when you want to send data to the uvga module, use a statement like
this: Pizza
Salad
uvga("N", value);Sandwiches
Snacks & Appetizers
where N is the name
Soupsof&the
Stews
variable on the uvga, and value is a variable containing the value
you want passed. Vegetarian & Vegan
At the end of your sketch (after the closing bracket of void loop) you have the following
function:
Serial3.print("$");
Serial3.print(x);
Serial3.println(y, DEC);
}
Living on a Mega 2560, but you can use softserial and a UNO.
I'm using Serial3
back
The code runningAllon the uvga accepts that serial "packet", and puts the value passed into the
Beauty
variable that was passed, where it can then be displayed on the screen. Example code for the
uvga is attached.Christmas
It's a plain text file. You will need 4D's Workshop software and a USB to TTL
cable to upload Cleaning
code to the uvga.
Decorating
AttachmentsEducation
gearmic.4dgGardening
Download Halloween
Health
Step 6: Complete Hiding PlacesCode With Measurement Sampling and
Holidays
Vga Output Homesteading
Kids
Kitchen
LEGO & K'NEX
If you would like to see
Life Hackshow 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
Music
developed with Office
the assistance of many others from the Arduino, 4D, and Arduinohome forums.
Supply Hacks
Organizing
More details arePest
available at
Control
http://tech.groups.yahoo.com/group/arduinohome/files/Arduino%20-%20VGA%20-
Pets
%20Micrometer/Pranks, Tricks, & Humor
Relationships
And http://arduinotronics.blogspot.com/2012/03/arduino-to-vga.html
Toys & Games
Travel
The smaller file Video
is just Games
the code needed to display the raw readings from the micrometer.
Divide the variable "num" by 1000 to get output in mm.
Attachments
micrometer_2.ino
Download
micrometerGFX.ino
Download
View Contest
I Made It
Teachers
Recommendationsback
All
ELA
Math
Side View Bird Box Camera and BlueTit Diary by Hey Jude
Micro:bit
Science
AI Lamp - How to Use AI in Arduino! by mondal3011
Social Studies
Engineering
AI-Designed Night Lamp by Aarav G
MakeyMakey
Coding
A Spotify Jukebox for Your Wall (No-Code) by PatrickF29
Electronics
Robotics
Farm to Table
Arduino
Contest
CNC
Laser Cutting
3D Printing
Colors of3Dthe Rainbow Contest
Design
Art
Music
Theatre
Water Contest
Wood Shop
Metal Shop
Resources
Grades K-2
Grades 3-5
Grades 6-8
Grades 9-12
University+
Comment I Made It
We have a be nice policy. Please be positive and constructive.
33 Comments
Hi, I'm planning to use this as a basis to read a Mitutoyo 543-271 dial indicator with an
Arduino Uno on an automated cam measuring bench. If I'm understanding your code
correctly you use the data cable button to trigger a measurement, but I want to trigger a
measurement with a signal from the Arduino instead and use a cable without a button
(905338). Are you able to advise if the interface circuit and code would work for this or
would they need modifying for what I need?
Thanks for any help you can provide, electronics and coding aren't my strong point!
Reply
Hello!
I have been trying to get 1 of the interface between mitutoyo equipment and an arduido
but the web page is not working. Could you please let me know if you still have them for
sale? If available I would like to get one overnight for testing and 3 more in a the next
couple of days.
Reply
Contests
Teachers
majstor76 5 years ago
hi, we need 6 axes (6 digital mitutoyo dial indicators) to measure flatnes of flange, can this
project do that (or at least show all 6 readouts)? Can it show tolerances? tnx
Reply
Hello! I need to do something like this, but connecting 4 mitutoyo LCD and a load cell. For
getting a load - displacement curve for a concrete cylinder test specimen. Is it possible?
Can you help me?
Reply
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.
Reply
Reply
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?
Reply
1 reply
Hi,
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...
Cheers
Reply
2 replies
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.
Reply
Hello,
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!
Bob
Reply
1 reply
Reply
Reply
The product specs claim it's a digimatic protocol, so it "should" work. I don't have one of
those to test.
Reply
Hello,
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
Reply
2 replies
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...
Reply
5 replies
Now trying to do the same project with an Igaging Origin SpeedMic. Igaging is not being
helpful with the pinout or the data spec.
Reply
2 replies
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...
Reply
Hi !
Could you please send me a link here to buy the complete kit ?
Thank you !
Reply
1 reply
Questions, advice, or general observations appreciated. Please vote if you like this
instructable.
Reply
Post a comment
AboutContact
© 2024
I Made It Favorite View Comments Share More Options
Facebook Twitter Pinterest Google Classroom
Flag
Wrong Category
Inappropriate
Incomplete
Spam
Cancel Confirm
Edit