How to control an LCD display with Arduino

LCD displaying ""

We spend many hours sitting in front of screens, but few understand how they actually work. In this post we will show you how to programme a LCD display with an Arduino boardThis allows you to display messages on the screen and even use the functions of the LiquidCrystal library to create effects and display images.

This will be very useful, especially if you have a more complex project in mind where you need to display data on screenThe information obtained by different sensors connected to the Arduino, for example, can be used to monitor all this information and much more. You can monitor all this information and much more.


  • Arduino UNO Rev3. (Buy it in our shop)
  • An LCD (Liquid Crystal Display). In our case we will use a 16×2 (Columns x Rows) LCD, which are the most common. I will use a LCM1602C.
  • Single-line connection wires.
  • One 10K potentiometerΩ.
  • A breadboard or protoboard to make connections more conveniently.
  • Arduino IDE installed on our Raspberry Pi, PC or Mac, in order to make the sketch.


The LCD screen connected to the Arduino will allow us to display text in a simple way. The Arduino platform has libraries such as "LiquidCrystal"(written by Limor Fried) that allows you to control LCD displays compatible with the driver. Hitachi HD44780 (very common in the market). What we will do is to display the message on screen, but you can modify it to show what you want.

If you look at the LCD screen you have, it usually has inscriptions on the front or back indicating what each of these is. connection pin. In my case it comes from the back, as you can see in the following illustration:

Pins of the LCM1602C

Note: If you are not sure, you can look at the model of LCD screen you have and search on Google to access or download the datasheet (pdf) of your screen. In this document, the manufacturer will give you all the information you need to make it work.

It can be seen that in the case of the LCM1602C the numbering of the connection pins starts from right to left, but from the back! (16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1). If we continue observing we can see that pin 1 corresponds to GND, pin 2 to the voltage input Vdd, pin 3 to Vo, pin 4 to RS, pin 5 to RW, pin 6 to E, pin 7-14 to Dbx, pin 15 to BL1 and pin 16 to BL2. A priori, if you haven't handled LCD screens, it will sound like a Chinese thing, but now I'll explain what each thing is:

  • RS (Register Select)The memory pin is the pin that controls the memory of the LCD, and indicates which memory register will be read or written. From this memory you get the data to display on the screen, but you also get instructions that the LCD controller needs to act.
  • RW (Read/Write): is the read/write pin, which will tell whether it is written to memory or read at any given time.
  • E (Enable): pin that enables registrations.
  • DB0-DB7: are the data pins, from which the bits that reach the register are taken. In the case of the display I have, it designates them as DB0-DB7 and they correspond to the numbering 7-14, but this may vary depending on the manufacturer or model of the LCD. For example, in some I have seen that they designate it as DO0-D07.
  • Vo: is the contrast pin of the display, with which we can modify the contrast of the screen.
  • Vdd: is the power supply pin, which supplies the voltage that will operate the LCD. Normally it is +5v.
  • GND: complements the previous pin, with the other power supply pin to be connected to ground.
  • BL1 and BL2: are the backlight pins. They control the brightness of the LCD. On some displays they may appear with the symbols Bklt+ and Bklt-. The abbreviation stands for "Back Light".

At first it all seems a bit tedious, but it's simple. It's just that there is too much information to give to be clear about how the screen works, but once you know how it works, it's a piece of cake.

Now that you should be clear on what each pin is for, let's explain how it should be used. make the connection for our example (it is not the only one, you can add thousands of other elements or even make the connection in other possible ways). What we will do is to connect the LCD screen to a breadboard to make the connection easier. Then we will connect the RS pin to the Arduino digital I/O 12 and the E pin to the Arduino digital I/O number 11 with the single wires. We connect the DB4-DB7 data pins to the digital I/O from 5 to 2 (i.e. 4-5 / 5-4 / 6-3 / 7-2, the rest of the DB0-DB3 data pins will not be connected as we will only work with 4 bits instead of 8). We continue by connecting, respectively, the Vdd and GND pins to the +5V and GND outputs of the Arduino board. We will then connect the Vo pin to the centre pin of a potentiometer (which in turn will have the end pins connected to +5V and GND), ignoring BL1 and BL2 which we will not use. As a picture is worth a thousand words...

Wiring diagram

Now we have everything, the circuit is created and everything is ready to make the sketch that programs its operation. Now it's time to use our computer or Raspberry Pi to write the necessary code in the Arduino IDE:


//LCD display control

#include //Library needed for LCDs

//Initialise the pins to be used
LiquidCrystal lcd(12,11,5,4,3,2);

void setup() {
///Express the number of columns and rows of our LCD.
lcd.begin(16, 2);
//Print the desired message on the LCD

void loop() {
//Prepare the cursor in column 0 of line 1
//This indicates where the text will start printing.


And I will end by explaining something that I have not explained before, which is the functionality of the potentiometer. It will help you to adjust the contrast, the screen may not have a good contrast if you don't adjust it and the text may not look good. Try moving it around until you are happy with the result. Best of luck and happy disproject!

Buy - Arduino UNO rev. 3

More information - Arduino control via Raspberry Pi

9 thoughts on “Cómo controlar una pantalla LCD con Arduino”

  1. Thank you very much for the guide. I'm having a problem, when I connect everything as it is in the diagram, I only get some squares on the screen and it doesn't show any kind of text. No matter how much I vary the contrast with the potentiometer, it only changes the intensity of the squares. Any suggestions?
    Thank you!

    1. Hi, well, take a look at the line of code:


      The first number indicates where the cursor starts, i.e. in which column the first letter goes. In this case it is 0 and therefore starts at the beginning. The second number, in this case 1, indicates the row in which the text appears. If you want to use row 2, you replace the 1 with a 2.


  2. Hector Etura Hilario

    Could a 7-inch screen with different pin connections to the one you show be used in the same way?

    1. Hi Hector. They sell 7 inch TFT/LCD display modules for Arduino. So it is possible for the Arduino to drive such displays, even touch screens, but the code and connection configuration in this article would have to be adapted to the new display. Also, such displays are more complex and require more sophisticated driver chips (which in the case of Arduino modules are already built in and do not need to be purchased separately).

      If you are interested in this type of screen, I recommend that you look for the specific model and manufacturer of the screen to access a datasheet of the product and thus know in depth the characteristics and wiring of the screen.

      I hope I have answered your question. Regards and don't hesitate to ask if you have any other questions.

Leave a Comment

Your email address will not be published.

Scroll to Top