Rachana Jain
Published © Apache-2.0

Getting Started with 16×2 LCD Interfacing Using Arduino Uno

In this tutorial, we will explore how a 16×2 LCD works, understand its internal registers, and interface it with an Arduino Uno.

BeginnerFull instructions provided2 hours32
Getting Started with 16×2 LCD Interfacing Using Arduino Uno

Things used in this project

Hardware components

Arduino UNO R3
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
10 kΩ Potentiometer
×1
Resistor 220 ohm
Resistor 220 ohm
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Interfacing LCD with Arduino in 4-bit mode

Arduino
/*
Interfacing LCD with Arduino in 4-bit mode
by www.playwithcircuit.com 
*/ 
#include <LiquidCrystal.h> // We are using JHD 16x2 alphanumeric LCD using HD44780 controller for its controller
// initialize the library with the numbers of the interface pins
// Here We initialize LCD in 4-bit mode when R/W pin (Pin 5 of LCD) is permanently attached to GND
// LCD side   / Arduino Side Pin 
// (Pin 4 )RS = 12
// (Pin 6 )E  = 11
// (Pin 7 )D0 (pulled to GND) = No connection with Arduino
// (Pin 8 )D1 (pulled to GND) = No connection with Arduino
// (Pin 9 )D2 (pulled to GND) = No connection with Arduino
// (Pin 10)D3 (pulled to GND) = No connection with Arduino
// (Pin 11)D4 = 6
// (Pin 12)D5 = 7
// (Pin 13)D6 = 8
// (Pin 14)D7 = 9
// Pin No 1 and 16 of LCD of should be connected to GND
// Pin No 2 and 15 of LCD of should be connected to VCC
// A 10k pot should be connected b/w VCC and GND and its variable o/p pin shpuld be connected to VEE (pin 3 of LCD) to control contrast of LCD.
LiquidCrystal lcd(12, 11, 6, 7, 8, 9);
void setup() {
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 // set the cursor to (column = 0,row = 0)
 lcd.setCursor(0, 0); 
 lcd.print("Eternal Timer :"); 
}
void loop() {
 // set the cursor to (column = 0,row = 1)
 lcd.setCursor(0, 1);
 lcd.print(millis()); 
}

Credits

Rachana Jain
22 projects • 13 followers
I'm an avid Arduino and electronics enthusiast with a passion for tinkering, experimenting, and bringing innovative ideas to life.

Comments