Project tutorial
Do It Yourself Digital Read Out

Do It Yourself Digital Read Out © GPL3+

Make your own custom DRO that measures distance for lathes, milling machines, woodworking tools, cut-off saws and other purposes.

  • 2,620 views
  • 0 comments
  • 8 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
5210733
Alphanumeric LCD, 20 x 4
IC 2, 20 x 4 LCD Display
×1
87f6105 40
Sensor Cable, Encoder
Rotary quadrature encoder 600 pulses/revolution
×1

Apps and online services

About this project

I decided to build an inexpensive rugged custom digital read out for myself and for other hobbyists. My DRO design is fairly simple. It can be modified to measure short and very long lengths. It also allows the user to modify an Arduino sketch for personal measuring preferences and for the language of their choice.

I explain how to make it in this video.

Code

X and Z AxisPlain text
These are the sketches for measuring distances in my DRO project and displaying the results on a LCD screen
// Z Axis Sketch 

// James Rovere 2019 Z Axis
// A Digital Readout using a quaduture rotary encoder,an IC2 LCD display
// and a GT2-16 pulley, 16 teeth spaced 2 mm apart; .37" outside Diameter.
#include <Encoder.h>// Encoder library.
Encoder myEnc(2,3);// Connected to Digital pins 2 and 3.
#include <LiquidCrystal_I2C.h> //IC2 LCD library.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() {
  lcd.begin(20, 4); // My display has 20 Columns, 4 Rows.
}
long oldPosition = -999;
void loop() {
  const float Wv = (.1 * PI) / 600; // Math formula for .37" diameter pulley
                                    //and 600 pulse/revolution encoder.

  lcd.setCursor(7, 0); // (Column 7,ROW 0) (Column #0-19,Row #0-3)
  lcd.print("Z Axis");
  lcd.setCursor(2, 1);
  lcd.print("inch");
  lcd.setCursor(14, 1);
  lcd.print("mm");
  lcd.setCursor(8, 2);
  lcd.print("<->");// Graphic symbols for a Z axis left and right travel.
  long newPosition = myEnc.read();
  if (newPosition != oldPosition)
  lcd.setCursor (0, 0);
  lcd.print (newPosition); // Display number of pulses, 1"~=1902.2 pulses.                       
  lcd.setCursor(2, 3);
  lcd.print(Wv * newPosition, 3);//Math formula * Encoder reading ,3 decimals
  lcd.setCursor(9, 1);
  lcd.print("|");// Graphic symbol to separate imperial and metric display.
  lcd.setCursor(9, 3);
  lcd.print("|");
  lcd.setCursor(11, 3);
  lcd.print(Wv * newPosition * 25.4, 2); // Formula to convert imperial
                                         // and metric, 2 decimals.
}


// ______________________________________________________________________

// X Axis Sketch

// James Rovere 2019 Lathe X Axis
// A Digital Readout using a quaduture rotary encoder,an IC2 LCD display
// and a GT2-16 pulley, 16 teeth spaced 2 mm apart; .37 outside Diameter.
#include <Encoder.h>// Encoder library.
Encoder myEnc(2, 3);// Connected to Digital pins 2 and 3.
#include <LiquidCrystal_I2C.h> //IC2 LCD library.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
 
void setup() {
  lcd.begin(20,4);// 20 Columns, 4 Rows.
  }
long oldPosition= -999;
  
  
void loop() {
  const float Wv =(.1 * PI)/600; // Formula to set the linear distance travelled in one pulse.
    
    lcd.setCursor(8,0); //(Column 8, Row 0)
    lcd.print("X Axis");
    lcd.setCursor(3,1);
    lcd.print("inch");
    lcd.setCursor(14,1);
    lcd.print("mm");
    lcd.setCursor(9,1);
    lcd.print(":");
    lcd.setCursor(9,2);
    lcd.print("|");
    lcd.setCursor(9,3);
    lcd.print(":");
    lcd.setCursor(3,2);
    lcd.print("D");
  long newPosition = myEnc.read();
  if (newPosition != oldPosition)
    lcd.setCursor (0,0);
    lcd.print (newPosition);// Display pulse count.   
    lcd.setCursor(2,2);
    lcd.print(Wv*newPosition*2,3);//Diameter multiply by 2, 3 decimal places
    lcd.setCursor(0,2);
    lcd.print("D");
    lcd.setCursor(11,2);
    lcd.print("D");
    lcd.setCursor(11,3);
    lcd.print("R");
    lcd.setCursor(0,3 );
    lcd.print("R");
    lcd.setCursor(13,2);
    lcd.print(Wv*newPosition*25.4*2,2);// mm Diameter multiply by 2, 2     //decimal places.
    lcd.setCursor(2,3);
    lcd.print(Wv*newPosition,3);// inch Raidius of workpiece.
    lcd.setCursor(13,3);
    lcd.print(Wv*newPosition*25.4,2);// mm Raidius of workpiece.
          
}

Schematics

Encoder wiring diagram
It is a diagram that shows how to connect an encoder to an Arduino UNO.
Arduino en kajobplx72

Comments

Author

Default
PracticeMakesBetter
  • 3 projects
  • 1 follower

Additional contributors

  • Music "irie" by Quincas Moreira

Published on

December 27, 2019

Members who respect this project

20160424 111205 erhgzh01gr84c60d4b d9f1 4928 b40b 9165670809ddArduinogetstartedDefault

and 4 others

See similar projects
you might like

Similar projects you might like

Digital Clock with Mirrored Display Driven by Accelerometers

Project tutorial by LAGSILVA

  • 16,584 views
  • 2 comments
  • 42 respects

Digital 3D Printer Filament Counter Using PS/2 Mouse

Project in progress by ArtSuzhou

  • 10,357 views
  • 11 comments
  • 36 respects

Digital Clock with Arduino, RTC and Shift Register 74HC595

Project tutorial by LAGSILVA

  • 34,060 views
  • 26 comments
  • 76 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project tutorial by LAGSILVA

  • 21,845 views
  • 22 comments
  • 76 respects

4-Stroke Digital Clock With Arduino

Project tutorial by LAGSILVA

  • 14,930 views
  • 15 comments
  • 45 respects
Add projectSign up / Login