Using a 16x2 LCD display

Overview

You will need a form of display for many projects and a 16x2 LCD works great for displaying small amounts of text/data

I will be using a 16x2 LCD display, specifically the 1602A.

LCD 16 x 2

What You'll Need

What to Do:

1. We need to wire up the LCD to the Pi

  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07
  • 08
  • 09
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • GND
  • +5V
  • GND via 2200Ω resistor
  • GPIO_7
  • GND
  • GPIO_8
  • N/A
  • N/A
  • N/A
  • N/A
  • GPIO_25
  • GPIO_24
  • GPIO_23
  • GPIO_18
  • +5V via 540Ω resistor
  • GND

2. Next, we can run this example code I adapted. Download it using this command:

$ - wget https://raw.githubusercontent.com/fraser148/pi-project-files/master/LCD-16x2.py

That was another very simple tutorial to get you set up but this code can be easily implemented into other programs as long as you keep the modules. With the modules you can use the main function: lcd_string().