One of the most commonly used devices on Arduino to display information is the 16×2 LCD screen. Liquid Crystal Displays (LCD) have the advantage of creating flat displays with low power consumption.
They work by polarizing light through polarizing filters. Liquid crystals do not produce light but modify their transparency depending on the orientation of the filters. This is why an external light source is necessary for them to be visible.
Let’s look at the different pins of the LCD screen:
Vss: Connect to ground
Vdd: Connect to +5V
VEE or VO: Connect to a potentiometer to adjust contrast
Rs: Control the memory register
R/W: Select read or write mode
E: When low, triggers the execution of instructions by the LCD module
D0-D7: Read and write data
A and K: Control the backlight
To use the LCD screen, you need a library: LiquidCrystal.zip. It contains a set of functions that will simplify your code and the use of the 16×2 screen.
To install it, open the Arduino IDE and click on Sketch, then Include Library, and finally Add .ZIP Library as shown below:
Here is the program to use with the Arduino IDE for your Raspberry Pi Pico: