How to Use an I2C LCD Display With Raspberry Pi Pico

Raspberry Pi Pico with LCD Screen
(Image credit: Tom's Hardware)

LCD screens are useful and found in many parts of our life. At the train station, parking meter, vending machines communicating brief messages on how we interact with the machine they are connected to. LCD screens are a fun way to communicate information in Raspberry Pi Pico projects and other Raspberry Pi Projects. They have a big bright screen which can display text, numbers and characters across a 16 x 2 screen. The 16 refers to 16 characters across the screen, and the 2 represents the number of rows we have. We can get LCD screens with 20x2, 20x4 and many other configurations, but 16x2 is the most common.

In this tutorial, we will learn how to connect an LCD screen, an HD44780, to a Raspberry Pi Pico via the I2C interface using the attached I2C backpack, then we will install a MicroPython library via the Thonny editor and learn how to use it to write text to the display, control the cursor and the backlight.

Latest Videos FromTom's Hardware
Les Pounder
Associate Editor

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • iwestbury
    Hi Tom. Nice tutorial. Works well with the change below.

    I think line 3 should read:

    from pico_i2c_lcd import I2cLcd

    Not:

    from machine_i2c_lcd import I2cLcd
    Reply
  • parisaa.pbn
    hello guys
    when i use lcd i2c with Raspberry Pi pico this error show for me!

    line 5 in my code : I2C_ADDR = i2c.scan()

    MicroPython v1.16 on 2021-06-18; Raspberry Pi Pico with RP2040

    Type "help()" for more information.
    >> %Run -c $EDITOR_CONTENT
    Traceback (most recent call last):
    File "<stdin>", line 5, in <module>
    IndexError: list index out of range
    Reply