Hi Guys since many projects needs a screen to display the data whether it is some diy meter or YouTube subscribe count display or a calculator or a keypad lock with display and if all these kinds of projects are made with arduino they will definitely need a display and since most of the displays are not very cheap except 1602 LCD display so its a good idea to use 16x2 lcd display with arduino for projects but the only problem is it is spi display and needs a lot of connections so in this tutorial we will see how i connected my display with arduino and wrote a code to display some data on the lcd display.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Things You Need
Step 2: Pins of 1602 LCD Display
These following pins are available on the display :
VSS: This is the ground pin.
VDD: This is the 5V pin.
V0: This pin controls the contrast of the LCD.
RS (Register Select Pin): This pin control where you are writing data in the LCD’s memory. There are two types of registers; Data register which holds what goes on the screen and the instruction register where the LCD looks for the next instruction.
R/W (Read/Write Pin): This pin selects the mode; Reading mode or Writing mode. Connecting it to ground will put the LCD in the read mode.
E (Enable Pin): This pin enables the writing to the registers.
Data Pins: There are 8 data pins (D0-D7). The high or low state of these pins represents the bits that you are writing to register in the write mode or the values you are reading in the read mode.
The last two pins are for the LCD back light. Some LCD’s have 16 pins and some have 14 pins. If you have a 14 pin LCD then it means that there is no back light.
A (LED+): This pin is the positive connection of the back light.
K (LED-): This pin is the negative connection of the back light.
Step 3: Connections
The LCD can be connected in the 4 bit as well as 8 bit mode. In the 4 bit mode we have to use only the 4 data pins while in the 8 bit mode we will have to use all the 8 data pins. You can do almost everything in the 4 bit mode, so in this example we are going to connect it in the 4 bit mode.
The connections of LCD with Arduino are as follows
16X2.LCD. Arduino Uno
V0 Middle of 10K potentiometer
Connectthe two ends of potentiometer to GND and 5V
RS. Pin 7
E pin 6
D4 Pin 5
D5. Pin 4
D6 Pin 3
D7 Pin 2
A To 5V through 220 ohm resistor
Step 4: Code
Before uploading the code in the Arduino, you will have to download the library for the LCD. The library will have the built in functions which will help us to make the code simple. Download library from below link if you IDE shows error for display Library
LCD Library : https://github.com/arduino-libraries/LiquidCrystal
After downloading, extract it into the library folder of Arduino.
#include "LiquidCrystal.h" //Initializing the library for LCD
LiquidCrystal lcd(7,6,5,4,3,2); //Initializing the pins where we have connected the LCD
void setup() //Anything written in it will only run once
lcd.begin(16, 2); //Initializing the interface on the LCD screen
lcd.setCursor(0, 0);// set the cursor to column 0, line1
lcd.print(" Welcome to ");//print name
lcd.setCursor(0, 1); // set the cursor to column 0, line 2
lcd.print(" Arduino World ");//print name
void loop() //Anything written in it will run again and again
Step 5: Output
After uploading the code whatever the text you put into the code it will displayed on your lcd display as mine and you can use the Potentiometer to adjust the brightness of the display to see it more clearly.
1 Person Made This Project!
Bennettshih made it!