how to display text in an LCD screen using Arduino UNO IDE

lcd arduino UNO
Share this blog with others!
  • 22
    Shares

Hello everyone, welcome to my new blog which is our Third project #4 (How To Display Text In An LCD Screen Using Arduino IDE). In this blog, we are going to display text in an LCD display Using Arduino UNO. Display units play an important role in establishing good communication between the human and machine worlds. And so they are a big part of embedded systems. In the previous blog, I explained only How to connect the LCD display to Arduino.

Introduction

The 16×2 LCD will have a total of 32 characters 16 in 1st line and a further 16 in 2nd line. In 16×2 LCD there are 16 pins overall if there is a backlight, 14 pins if there is no backlight In each character there are 50 pixels.

Components Required

Hardware: 

  • ARDUINO UNO
  • power supply (5v)
  • (16x2LCD),
  • 100uF capacitor.
  • Breadboard

Software:

  •  Arduino IDE
  • LiquidCrystal Library

Circuit connection of LCD Display To Arduino Uno:

Now let’s build the circuit. A circuit layout can be described in several ways. For this project ( How To Connect LCD 16×2 Display To Arduino ), we are using a physical layout diagram similar to the one shown in the above figure 2.

  • 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)
lcd arduino display
The above figure 2 shows the circuit diagram of 16×2 LCD connected to ARDUINO UNO.

LCD Code For Displaying Text on LCD Screen


// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

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

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(millis() / 1000);
}
 

Explanation of Displaying Text In An LCD Screen Using Arduino Uno

We write all main programs in the main section as you see we use the setCursor() function which is used for setting the location at which text written to the LCD will be displayed. We also used the Lcd.begin() function which means we initialize the LCD screen of 16×2 (16×2 LCD means 16 characters can be shown per line and 2 of those lines exist).

Attach your Arduino now, and upload your sketch from the Arduino IDE. After a second the inbuild LED should start blinking.

However, if nothing happens then remove the USB cable immediately From Arduino and verify that the sketch has been typed correctly. 
Fix a mistake, and upload the sketch again If your sketch matches exactly and the LCD still doesn’t ON check your wiring on the breadboard.

If you want to see the stimulation of the project. Click here https://www.tinkercad.com/things/bg9LRuK48VV.


Share this blog with others!
  • 22
    Shares

Leave a Comment

Your email address will not be published. Required fields are marked *