• First Steps
  • General
  • Projects
Facebook Twitter YouTube
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
  • Hardware & GPIO
  • Sensors & Components
  • Scale
  • Cases
  • Fingerprint
  • Gas Sensor
  • Heartbeat
  • German
  • French
Tutorials for Raspberry Pi Tutorials for Raspberry Pi
Home»Hardware & GPIO»Raspberry Pi LCD Display: 16×2 Characters Display (HD44780)

Raspberry Pi LCD Display: 16×2 Characters Display (HD44780)

Facebook Twitter LinkedIn Tumblr Email Reddit
Raspbery Pi LCD Display
Share
Facebook Twitter LinkedIn Email Tumblr Reddit Telegram WhatsApp

The most common controller of multi-line character displays is the HD44780. There are several Raspberry Pi LCD display sizes (8×2, 16×2, 20×4, etc.) that run with it. In this tutorial, I will show how to use a 16×2 character display and also run a test script.

A few words said in advance: In this tutorial, all pins are addressed directly, which occupies quite a few GPIOs. Another method is the connection via I2C.

 

Required Hardware Parts

The following parts are required:

  • Display with a HD44780 controller
  • Jumper Cable
  • A resistor or alternatively a potentiometer (to control the backlight)
  • Breadboard

 

Setup

In this case, I refer to the pin numbering (GPIO.BOARD), not to the GPIO numbers:

 

Raspbery Pi GPIO Assignment
Raspberry Pi GPIO Assignment

 

LCD Pin to RPi GPIO Description
 1. VSS  Pin 6 (GND) Supply Voltage (ground)
 2. VDD  Pin 2 (5V) Supply Voltage 5V
 3. V0  Pin 6 (GND) Contrast Voltage
 4. RS  Pin 7 (GPIO4) Register Selection (0: Command Register, 1: Data Register)
 5. RW  Pin 6 (GND)  Read/Write (0: Write Modus, 1: Read Modus)
 6. E  Pin 11 (GPIO17) Clock Edge
 7. D0  – Data Line 0
 8. D1  – Data Line 1
 9. D2  – Data Line 2
 10. D3  – Data Line 3
 11. D4  Pin 12 (GPIO18) Data Line 4
 12. D5  Pin 15 (GPIO22) Data Line 5
 13. D6  Pin 16 (GPIO23) Data Line 6
 14. D7  Pin 18 (GPIO24) Data Line 7
 15. A  Pin 2 (5V) (mit Poti) Backlight Anode
 16. K  Pin 6 (GND) Backlight Cathode

 

Schematically, the whole thing looks like this:

Raspberry Pi LCD Display Connection
Raspberry Pi LCD Display Connection

 

The backlight can be adjusted by turning the potentiometer. Some displays cannot stand 5V for the backlight, so you should either look at the datasheet or at least always connect a 470Ω – 510Ω resistor.

 

Testing the Raspberry Pi LCD Display

You can either view the script I used here or just download it and try.

wget http://www.tutorials-raspberrypi.de/wp-content/uploads/scripts/hd44780_test.py
chmod +x hd44780_test.py
python hd44780_test.py

If you have chosen a different display or pin assignment, do not forget to adapt the script.

Through the simple control, you can create different scripts, which, for example, show the status of the Pi.

HD44780 1602A hd44780 display lcd controller python
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleMit dem Raspberry Pi Machine Learning erlernen – Teil 1
Next Article Build a Raspberry Pi door / window sensor with Reed Relais

Related Posts

Control all GPIOs with the Raspberry Pi REST API via Python

How to build a ESP8266 Scale (with Weight Sensor HX711)

Using TensorFlow Lite with Google Coral TPU on Raspberry Pi 4

How-To: Bluetooth Connection between ESP32’s and Raspberry Pi’s

3 Comments

  1. Peter on 24. April 2019 8:55

    I would lik to follow these raspberry pi tutorials but there’s just too much advertising !!

    Reply
    • Paul on 15. September 2020 12:17

      Peter,
      I used an ad-blocker I have NO ads on this page at if they stop me form looking at them via ad-blocker detection I just will not look at them I white list no site at all.

      Reply
  2. Aidan on 14. April 2021 4:36

    If you have contrast issues or need to edit the code for a 20×4 screen i’ve made a youtube clip to fix some issues i had after following the tutorial. https://www.youtube.com/watch?v=geEA-5f74Gk

    Reply

Leave A Reply Cancel Reply

Raspberry Pi: Set Up USB Boot Using a Stick or SSD Hard Drive

Run a Raspberry Pi on rechargeable Batteries

Transfer Raspberry Pi Raspbian OS to an SD Card (Windows)

Infrared Distance Measurement with the Raspberry Pi (Sharp GP2Y0A02YK0F)

Raspberry Pi Traffic Light Circuit with GPIO Part 2

How to let an Arduino and Raspberry Pi communicate with each other

Subscribe to Blog
Subscribe to Raspberry Pi Tutorials and don't miss any new Tutorial!
Subscribe

Thank you!

We will contact you soon.

Tutorials for Raspberry Pi
Facebook Twitter YouTube
  • Contact & Disclaimer

Type above and press Enter to search. Press Esc to cancel.