0% found this document useful (0 votes)
188 views

Lesson 22 LCD Display

This document provides instructions for wiring up and using an alphanumeric LCD display with an Arduino. It describes the components needed, including an LCD display module, Arduino Uno, breadboard, jumper wires and potentiometer. It explains how to connect the LCD to the Arduino, load the LiquidCrystal library, and run the example code to display "Hello World" and a counting number on the LCD screen.

Uploaded by

Yahya AIDARA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

Lesson 22 LCD Display

This document provides instructions for wiring up and using an alphanumeric LCD display with an Arduino. It describes the components needed, including an LCD display module, Arduino Uno, breadboard, jumper wires and potentiometer. It explains how to connect the LCD to the Arduino, load the LiquidCrystal library, and run the example code to display "Hello World" and a counting number on the LCD screen.

Uploaded by

Yahya AIDARA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lesson 22 LCD Display

Overview

In this lesson, you will learn how to wire up and use an alphanumeric LCD display.

The display has an LED backlight and can display two rows with up to 16 characters on

each row. You can see the rectangles for each character on the display and the pixels that

make up each character. The display is just white on blue and is intended for showing text.

In this lesson, we will run the Arduino example program for the LCD library, but in the next

lesson, we will get our display to show the temperature, using sensors.

Component Required:

(1) x RexQualis UNO R3

(1) x LCD1602 module

(1) x Potentiometer (10k)

(1) x 830 tie-points Breadboard

(16) x M-M wires (Male to Male jumper wires)

Component Introduction

LCD1602

Introduction to the pins of LCD1602:

VSS: A pin that connects to ground

VDD: A pin that connects to a +5V power supply

VO: A pin that adjust the contrast of LCD1602

RS: A register select pin that controls where in the LCD’s memory you are writing data to.

You can select either the data register, which holds what goes on the screen, or an

instruction register, which is where the LCD’s controller looks for instructions on what to

do next.
R/W: A Read/Write pin that selects reading mode or writing mode

E: An enabling pin that, when supplied with low-level energy, causes the LDC module to

execute relevant instructions.

D0-D7:Pins that read and write data

A and K: Pins that control the LED backlight

Connection

Schematic

Wiring diagram
The LCD display needs six Arduino pins, all set to be digital outputs. It also needs 5V and

GND connections.

There are a number of connections to be made. Lining up the display with the top of the

breadboard helps to identify its pins without too much counting, especially if the

breadboard has its rows numbered with row 1 as the top row of the board. Do not forget,

the long yellow lead that links the slider of the pot to pin 3 of the display.

The 'pot' is used to control the contrast of the display.

You may find that your display is supplied without header pins attached to it. If so, follow

the instructions in the next section.

Code

After wiring, please open the program in the code folder- Lesson 22 LCD Display and click

UPLOAD to upload the program. See Lesson 3 for details about program uploading if
there are any errors.

Before you can run this, make sure that you have installed the < LiquidCrystal > library or

re-install it, if necessary. Otherwise, your code won't work.

For details about loading the library file, see Lesson 2.

Upload the code to your Arduino board and you should see the message 'hello, world'

displayed, followed by a number that counts up from zero.

The first thing of note in the sketch is the line:

#include <LiquidCrystal.h>

This tells Arduino that we wish to use the Liquid Crystal library.

Next we have the line that we had to modify. This defines which pins of the Arduino are to

be connected to which pins of the display.

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

After uploading this code, make sure the backlight is lit up, and adjust the potentiometer

all the way around until you see the text message In the 'setup' function, we have two

commands:

lcd.begin(16, 2);

lcd.print("Hello, RexQualis!");

The first tells the Liquid Crystal library how many columns and rows the display has.

The second line displays the message that we see on the first line of the screen.

In the 'loop' function, we aso have two commands:

lcd.setCursor(0, 1);

lcd.print(millis()/1000);

The first sets the cursor position (where the next text will appear) to column 0 & row 1.

Both column and row numbers start at 0 rather than 1.


The second line displays the number of milliseconds since the Arduino was reset.

Example picture

You might also like