The Weekend Project 1 – GRBL LCD Display

I really want an LCD display for my CNC router and I have a 20×4 LCD lying around in my collection that I really want to make use of. It was purchased for a project that never went ahead but I love it’s blue backlight and I have been planning on building a panel for the CNC to neaten things up and this would be perfect for it!

I have noticed on the internet there was an XLCD project by the team that made the XStepper board but it looked a little too complicated for my needs. (It uses a great serial spy library though that I have saved!)

My aim this weekend is to see what I can get out the TX and RX pins on the Arduino running GRBL. I can’t find much documentation on this, but I’m sure I’ve seen people using this to stream GRBL down from Arduino SD card projects. I have a few Arduino pro mini’s lying around in the bits box so I’m going to hook up the TX pin from the GRBL Arduino to the RX pin on the pro mini and see what I can spit out onto the screen!

I have some code written for this which is just simply spitting out whatever is on the serials rx line:

#include <LiquidCrystal.h>
LiquidCrystal lcd(A5, 3, 4, 5, 6, 7);
void setup(){
    lcd.begin(20, 4);
    Serial.begin(115200);
}
void loop(){
    if (Serial.available()) {
        delay(100);
        lcd.clear();
        while (Serial.available() > 0) {
            lcd.write(Serial.read());
        }
    }
}

For my notes this is how to hook the display to the pro mini:

LiquidCrystal lcd(A5, 3, 4, 5, 6, 7);

skv_arduino_pro_mini_e-schema arduino-pro-mini_en

 

I2c setup for pro mini 2004LCD:
http://arduino-info.wikispaces.com/LCD-Blue-I2C

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);

void setup(){
    lcd.init();
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("lcd on");
}
void loop(){
    lcd.setCursor(0, 1);
    lcd.print('Hello World');
    delay(100);
}

I’ve just included some reference pictures as to how to hook up the LCD to the pro mini, I’ve only ever hooked it up to the uno so this will be a first.

As you can see in the featured image I’ve attached that is the final result that I would like to achieve with this. The final data may not be the same, I think I want to add spindle RPM and board temperature to the final data output but this will be a start just getting something out the display.

I’ve been playing with the verbose output from universal gcode sender and I imagine this is just what the RX is spitting out directly from GRBL:

[verbose]<Idle,MPos:0.000,0.000,0.000,WPos:0.000,0.000,0.000>

If this is the case and this is whats spat out on the LCD this weekend  then I’ll be a very happy boy! I can then go about parsing this information into what I want it to display :D

I’ve just got to wait and see now. Hurry up Saturday!

Leave a Mesage