Display data to LCD using Arduino 🖥️
In your daily life, you deal with many devices that have an LCD display. These LCDs help the user to interact with different devices and use them more easily.
LCDs are used in a range of everyday applications, including the automobile radio and the house air conditioning remote. They display data and let you control it through menus.
In this tutorial, we will print data on your LCD using the Arduino. It is basic and straightforward. Let's find out more together!
Overview
The LCD (Liquid Crystal Display) is made up of a number of rectangular areas which define its size. The one used in this tutorial is a 16x2 LCD, which means it has two rows of 16 rectangular areas. Each of which is made up of smaller ones that light up like pixels to print out the character.
The LCD is commonly light up with green or blue background light.
It will be much easier to connect the LCD to the Arduino if you use the I2C module since you will use fewer connecting wires.
Let's find out together!

Getting the items
For this project you will need the following components, you can buy them from our store.
Wiring it up
The connection is really simple, with just four jumper wires, you can light the LCD and print on it. The image demonstrates how to connect the wires between the LCD and the Arduino. Once the LCD and the Arduino are connected to each other, connect the Arduino to your computer using the USB cable.

Connections from the Arduino to the LCD:
Arduino GND pin → I2C module GND pin
Arduino 5V pin → I2C module VCC pin
Arduino pin A4 → I2C module SDA pin
Arduino pin A5 → I2C module SCL pin
Coding
This sketch's function is to print a string on the LCD and use the delay function to create basic animations.
To make the code work, you must first download the liquid crystal I2C and wire.h libraries. Libraries are files that you can download and copy to the Arduino IDE software files so the Arduino can recognize different sensors. You can download the library files from the resources section and then install it by following this tutorial.
Make certain that you are using a 16x2 LCD with an I2C module.
/*
Voltaat learn (https://www.voltaat.com/pages/voltaat-learn)
Link for full tutorial: https://bit.ly/3s8Grcv
LiquidCrystal I2C Library: https://bit.ly/3Tgc7IT
Wire Library: https://bit.ly/3DdjWJB
Tutorial: Display data to LCD using Arduino
The function of this sketch is to print a string on the LCD
and use the delay function to make simple animations.
Connections from the Arduino to the LCD:
Arduino GND pin → I2C module GND pin
Arduino 5V pin → I2C module VCC pin
Arduino pin A4 → I2C module SDA pin
Arduino pin A5 → I2C module SCL pin
*/
// This library allows you to connect with I2C/TWI devices.
#include < Wire.h >
// The library allows you to control I2C displays using functions that are quite similar to those found in the LiquidCrystal library.
#include < LiquidCrystal_I2C.h >
// LCD instance (0x27 is the I2C address), 16 is 16 number of columns, 2 is number of rows.
// make sure you are using 16x2 LCD with I2C module.
LiquidCrystal_I2C lcd(0x27,16,2);
// Commands inside void setup run once
void setup()
{
// initialize the lcd
lcd.init();
// turn on the LCD backlight.
lcd.backlight();
}
// Commands inside void loop run forever
void loop()
{
// Clear what is displayed on the LCD
lcd.clear();
// Delay for 800 milli second to make simple animation you can change this value to get a To get a different response.
delay(800);
// set the cursor of the LCD to column 2, line 1
lcd.setCursor(2,0);
// Print "Voltaat Store" on the LCD
lcd.print("Voltaat Store");
// Delay for 1200 milli second to make simple animation you can change this value to get a To get a different response.
delay(1200);
// set the cursor of the LCD to column 0, line 1
lcd.setCursor(0,1);
// Print "You are welcome!" on the LCD
lcd.print("You are welcome!");
// Delay for two second to make simple animation you can change this value to get a To get a different response.
delay(2000);
}
Testing it out

When you upload the code to your Arduino board and connect the LCD to the I2C module as described before, you will see the LCD show the words "Voltaat Store" starting at the third column and first row since we made this function lcd.setCursor(2, 0).
The second row then prints "You are welcome!" starting from the first column.
The delay function was used to animate it. Makes the words appear and disappear at different times. Play with different delay values in the code and find out different outcomes!
Related Tutorials
A keypad is a set of keys that are used to input data into a computer or electronic device. Most keypads consist of numeric, symbol, and navigation keys.
The ultrasonic sensor is a device that can measure distance by sending out sound waves and calculating how long it takes for them to bounce back.
The RFID reader is a module that reads a unique number from a tag or a card when it comes near it. You can then use the scanned number to identify the card holder.