Arduino: Basic LCD Display Messaging

LCD Arduino connection diagram
This entry is part 12 of 13 in the series Arduino

Join our Arduino Programming Course

Vidyasagar Academy conducts short term course in Arduino Programming. We have fresh new batch EVERY MONDAY. Want to know more?
Call us: 99-60-991-991.

You can display two different messages on 16×2 LCD display using Arduino UNO dev. board. For that you need to do the proper connections of LCD display with your Arduino UNO Board, as shown below.

Then burn the given program into your Arduino and then connect power supply to display the two messages.

Important: If you see nothing on the LCD display, then adjust the 4.7k ohm PRESET to suitable position to display dark message on it. This control is called as contrast control of LCD display.

Connection Diagram

LCD Arduino connection diagram

Pin-wise Connection Details

  • Pin-1 (from left top, front view) – Ground
  • Pin-2 – +5V
  • Pin-3 – Middle terminal of variable resistor PRESET (4.7kΩ). Then connect 1st and 3rd terminal of the PRESET to +5V & ground randomly.
  • Pin-4 – Pin-12
  • Pin-5 – Ground
  • Pin-6 – Pin-11
  • Pin-7 – No connection
  • Pin-8 – No connection
  • Pin-9 – No connection
  • Pin-10 – No connection
  • Pin-11 – Pin-5
  • Pin-12 – Pin-4
  • Pin-13 – Pin-3
  • Pin-14 – Pin-2
  • Pin-15 – To +5V through 330Ω resistor.
  • Pin-16 – Ground

Practical Construction of Project

Tested Code

The lab tested code is given below. You can also download the text file of this code. Copy the complete code and then paste it into your Arduino Software by creating new project.

/*
 * Project of Basic LCD Display using Arduino
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * LCD VSS pin to ground
 * LCD VCC pin to 5V
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
*/

// include the library code:
#include 'LiquidCrystal.h' // replace (') single quote by (<>) parenthesis quote

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("VSagar Academy");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print("www.vsagar.org");
}

Download Detailed .pdf File

Series Navigation<< Arduino UNO: Ultrasonic Sensor Basic ProjectFritzing! The powerful tool for expressing your ideas! >>