Arduino and LCD display


Arduino and LCD display

controller HD44780



1. Display

LCD display with controller HD44780 is one of the most popular devices of this type. The main advantages are: low cost, large availability and ease of operation. The layout can be found in several wesjach. They differ from each other: the illumination color and symbols and sizes, that is, the maximum number of characters displayed at one point.


In our shop available displays:

16x2 - 16 columns and 2 lines (32 characters)


8x2 - 8 columns and 2 lines (16 characters)


20x4 - 20 columns and 4 lines (80 characters)



2. HD44780 - management

Often displays have sixteen pins. Power (VDD, VSS), pin adjust the contrast (V0), three control lines (RS, R/W, ENABLE), eight data bus lines (D0...D7) and a separate backlight (LEDA+ , LEDK-).


The figure shows the size and output of LCD display 16x2.



No. Name Description
2VDDPower (+5V)

The registry selection guide display (low state) or data register(high)

5R/WRead (low) / Write (high status). In the mode without reading the busy flag, the output can be tied to ground.
6EIf there is a falling edge, the display is ready to read data from the bus.




Data bus. These lines are transmitted data and instructions for display.

15LEDAThe backlight.
16LEDKMass illumination


The display will be using four data lines: D4, D5, D6, D7 and output: E, RS. R/W is connected to ground. For more information on control modes can be found in the display description.

Thanks to the library LiquidCrystal display support with the Arduino is as follows:

  • Incjalizacji - this method is used LiquidCrystal(rs, rw, enable, d4, d5, d6, d7) in parentheses podwane the number of relevant conclusions. For example:
    LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); 
    //RS pin connected to digital output 12, G-11 etc.) 
    LCD.begin(16, 2); // select a display type, in that case, 16x2 
  • The input to display:
    LCD.setCursor(kolumnal, poem);- the indication of place from which to begin viewing characters. For example
    LCD.setCursor(0, 1) 
    // column number 0, row number 1 (numbering starts from zero) 

    LCD.print(data)- input line (string) to view the tags in the "data". For example, prod.print("hello, world!"); - in the display appears the inscription" hello, world!


A broad description, libraries, and sample programs can be found in the documentation of the Arduino project.


3. Example


Program documentation library for Arduino. Hello World



Example program for the LCD 16x2 in 4-bit without reading the busy flag


LCD RS pin connected to digital output No. 12

LCD Enable pin connected to digital output 11

LCD D4 pin connected to digital output No. 5
LCD D5 connected to digital output of No. 4
LCD D6 is connected to the digital output No. 3
LCD D7 connected to digital output No. 2

LCD R/W pin is connected to the ground

VO (contrast) connected to a potentiometer. The potentiometer can be replaced with a voltage divider. In some cases, effective is also a resistor with a nominal value of several hundred ohms, is connected from the output V0 to the masses.

LCD LED+ backlight power (5V)

LCD display - weight backlight

Despite the fact that some displays have a built in resistor that limits the supply current of led backlight crystals is to use an external limiter. In this przyopadku line 5B is connected through a resistor 200 Ohms.


The figure shows the connection of module display with Arduino Uno.


//Initialization calls 
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 

void setup() { 
// Select the display type 16x2 
LCD.begin(16, 2); 
//The message to display the string hello, world! 
LCD.print("hello, world!"); 

void loop(){ 
//Move the cursor to the first column of the second row 
LCD.setCursor(0, 1);? 
//Read and display the time elapsed since the last reset in seconds 

Similarly, should arrive with the devices of smaller and greater the number of displayed characters.


4. Summary

The display is an important tool in the communication process of the electronic device with the person. Useful for detecting errors during testing or reviewing data collected using the microcontroller. Along with the buttons forms the basis of the user interface.

Modules alphanumeric based on the HD44780 controller they are very easy to use. In the case when there is no need of displaying graphics, these devices worked very well, and they are used by Amateurs and profesjonalitów.


The figure shows the connection of display LCD 16x2 using contact plates and connecting przewdów.