Arduino LCD 1602 I2C Display Tester

by ohpetya in Circuits > Arduino

35 Views, 0 Favorites, 0 Comments

Arduino LCD 1602 I2C Display Tester

English

In this project, we will build a simple tester for a 16x2 LCD 1602 display with an I2C interface using an Arduino Uno.

The project is designed to help beginners check whether their LCD display is working correctly and learn how to connect and control an I2C display using Arduino.

After uploading the program, the display will show the number of days since the Arduino started and a running timer in HH:MM format. The display updates automatically every second.

This is a useful first project when working with LCD displays, as it allows you to quickly test the screen, its backlight, and communication over the I2C bus.

Supplies

English

Components

  1. Arduino Uno R3 – 1 pc.
  2. LCD 1602 display with I2C backpack – 1 pc.
  3. Jumper wires (female-to-male) – 4 pcs.

Libraries

  1. Wire library (included with Arduino IDE)
  2. LiquidCrystal_I2C library

No soldering is required if your LCD module already has an I2C backpack and the necessary pins installed.

Identify the LCD 1602 I2C Pins

Before connecting the display, identify the four pins on the I2C module:

  1. GND – Ground
  2. VCC – Power supply (5V)
  3. SDA – I2C data line
  4. SCL – I2C clock line

The I2C backpack makes connecting the LCD much easier because only four wires are needed instead of many individual connections.

Connect the Display to Arduino Uno

English

Connect the LCD 1602 I2C module to the Arduino Uno using four jumper wires.

Use the following connections:

LCD 1602 I2C -> Arduino Uno

GND -> GND

VCC -> 5V

SDA -> A4

SCL -> A5

Make sure all connections are correct before powering on the Arduino.

Important: On Arduino Uno, the SDA and SCL signals are available on pins A4 and A5 respectively. The dedicated SDA/SCL pins on the Uno R3 are electrically connected to the same I2C lines.

Install the Required Libraries

To control the LCD display, we need the LiquidCrystal_I2C library.

  1. Open Arduino IDE.
  2. Go to Sketch → Include Library → Manage Libraries.
  3. Search for LiquidCrystal I2C.
  4. Install a compatible LiquidCrystal_I2C library.
  5. The Wire library is included with the Arduino IDE, so no additional installation is required.

Make sure the installed library supports the lcd.init() function used in the sketch.

Upload the Test Program

Now it is time to upload the program to the Arduino Uno.

  1. Connect the Arduino Uno to your computer using a USB cable.
  2. Open Arduino IDE.
  3. Create a new sketch.
  4. Copy the program below into the editor.
  5. Select Arduino Uno as the board.
  6. Select the correct COM port.
  7. Click Upload and wait until the upload process is complete.

Arduino code

The program calculates the time elapsed since the Arduino started and displays it on the LCD.

Downloads

Test the LCD Display

After uploading the sketch, the LCD display should turn on and show a startup message.

After a short delay, the display will start showing two lines:

  1. First line: Days – the number of days since the Arduino started.
  2. Second line: Time – the elapsed time in hours, minutes, and seconds.

The timer updates automatically every second.

If everything works correctly, your LCD 1602 I2C display is successfully connected and tested!

Troubleshooting

If the display does not show any text, check the following:

  1. Check the wiring. Make sure GND, VCC, SDA, and SCL are connected correctly.
  2. Check the I2C address. The default address in the sketch is 0x27. Some LCD modules use 0x3F. If the display does not respond, try changing the address:
  3. LiquidCrystal_I2C lcd(0x3F, 16, 2);
  4. Adjust the contrast. Turn the small potentiometer on the back of the I2C module until the characters become visible.
  5. Check the library. Make sure the installed LiquidCrystal_I2C library is compatible with the sketch.
  6. Check the power supply. Make sure the display receives the correct voltage.