Arduino: Basic LCD Display Messaging

This entry is part 9 of 9 in the series All About 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

// include the library code:
#include 

// 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 Fritzing Drawings