NederlandsKlik deze knop voor de Nederlandstalige website

16×2 LCD display on the Geekcreit UNO Arduino

Together with the “Geekcreit UNO” Arduino-clone I also bought a 16×2 LCD display from VNG Systems. The Hitachi HD44780 compatible display has a I2C serial interface module soldered on the back.

The information I found on the internet about this combination of board and display was a bit contradicting. Therefore, it took me a while to get things working right. This is how I finally got the display working together with the Geekcreit Arduni Uno R3. Your mileage may vary for other brands of boards and displays, of course.

Tested with:
Arduino IDE version: 1:1.0.5+dfsg2-2
Linux Mint version: 17.3 Cinnamon 64-bit
Geekcreit UNO revision: unknown

16x2 LCD display
16×2 LCD display
16x2 LCD display, achterkant met I2C -module
16×2 LCD display with the attached I2C module

Installing the alternative LCD-library

First of all, you need to replace the standard Arduino LCD-library with the ‘new-liquidcrystal’ library. You can download it here: https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads.

On Linux Mint the libraries directory can be found here:
/usr/share/arduino/libraries/
In the libraries directory you will find the directory called ‘LiquidCrystal’. You should remove or rename it.

Then you copy the ‘Newliquidcrystal’ directory (from the archive you just downloaded) to the libraries directory and rename it to ‘LiquidCrystal’.

Wiring the 16×2 LCD display to the Geekcreit Arduino UNO R3

You should wire the LCD display to the Geekcreit UNO as follows:

LCD display Geekcreit UNO board
GND GND
VCC 5V
SDA A4
SCL A5
Arduino Uno with 16x2 Hitachi HD44780 I2C module
Arduino Uno with 16×2 Hitachi HD44780 I2C module

After this you can connect your Geekcreit UNO to your computer using the USB cable.

Controlling the 16×2 LCD display from a sketch

Open the Arduino IDE and copy this code to a new sketch:


/*
      Hello World! for 16x2 LCD display on Geekcreit Uno
 */
 
#include 
#include 

#define I2C_ADDR    0x3F // Display address
#define BACKLIGHT_PIN     3

#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

LiquidCrystal_I2C	lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
  lcd.begin (16,2); // 16x2 display
  
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); // Backlight on
  lcd.setBacklight(HIGH);
}

void loop()
{
  lcd.clear ();
  lcd.print("Hello World!");  
  delay(3000);
  
  lcd.clear ();
  lcd.print("1234567890ABCDEF");
  lcd.setCursor (0,1);
  lcd.print("GHIJKLMNOPQRSTUV"); 
  delay(3000);
}

This example is also available on GitHub at https://github.com/oneguyoneblog/arduino-16×2-lcd

 

16x4 LCD display: Hello World!
16×4 LCD display: Hello World!
Geekcreit® UNO R3 ATmega328P Development Board For Arduino
Tested and recommended by OneGuyOneBlog.com:

Geekcreit® UNO R3 ATmega328P Development Board For Arduino
Banggood.com
Geekcreit® IIC / I2C 1602 Blue Backlight LCD Display Module For Arduino
Tested and recommended by OneGuyOneBlog.com:

Geekcreit® IIC / I2C 1602 Blue Backlight LCD Display Module For Arduino
Banggood.com
3 Comments