Overview
The kit is designed for any Raspberry Pi - version 1 and 2.
If you want plug in a Cobbler or Gertboard at the same time, check out our Stacking Header, you can fit an IDC cable over it if the Plate is assembled with this part.
Page last edited November 21, 2012
Text editor powered by tinymce.
Parts List
We recently adjusted the kit so the buttons are on the RIGHT side instead of the left. The parts list is otherwise the same, its just a little more stable than before
1) Resistors
There is a total of 3 resistors in this kit. For resistors labeled RED and BLUE on the PCB, they are 1/4W 5% 220 ohm resistors (Red, Red, Brown, Gold). For the resistor labeled GREEN on the PCB, it is a 1/4W 5% 330 ohm resistor (Orange Orange Brown Gold).
2) Potentiometer
There is one 10k trim potentiometer. This part will go in the spot labeled Contrast
3) Pushbuttons
There are a total of 5 x 6mm tactile switch pushbuttons. These will be used in the UP, DOWN, LEFT, RIGHT and SELECT locations on the PCB.
4) i2c Port Expander Chip
There is one of these MCP23017 i2c (16 input/output) port expander chips in the kit. This is how we are able to only use 2 R-Pi pins to run the entire LCD and buttons. Click here for more info on this chip.
5) Male Header Pins
There is one strip of 36 male header pins in the kit. These will be used to attach the LCD to the PCB.
6) Printed Circuit Board
There will be one PCB in the kit as shown above.
7) Raspberry Pi Plate Header
There will be one extra-tall 26 pin female header for plugging into the Pi
8) Bumper
There will be one rubber bumper as shown above
Additional
You'll also need an LCD to place into the shield.
Your LCD may have 16 pins (Monochrome) or 18 pins (RGB) and may have 2 rows of connectors or one. This is normal and does not affect the display
You can also use 16x2 LCDs that are the same size that do not have an RGB backlight, or have no backlight at all.
We carry Negative type or Positive type LCDs as well as Blue and White LCDs
Page last edited November 21, 2012
Text editor powered by tinymce.
Assembly
Check the kit against the parts list to verify you have all the parts necessary
We recently adjusted the kit so the buttons are on the right side instead of the left. The parts list is otherwise the same, its just a little more stable than before
We'll start with the first resistor GREEN - which has orange, orange, brown, gold bands on it. This resistor acts as the backlight control resistor for the green backlight pin.
Bend the resistor into a 'staple' and slide it into the slot marked GREEN on the PCB. Resistors do not have a direction so you can put it in 'either way' and it'll work find.
Bend the 'legs' of the resistor out so it sits flat against the PCB and flip it over.
This way the resistor won't fall out while soldering.
With your soldering iron heated up and ready, solder in both leads of the resistor. To do this, heat up the round ring pad and the wire lead at the same time for 2 or 3 seconds, then dip the end of the solder into the heated joint to melt it in.
Then remove the solder and the soldering iron.
Since you did so great with the first resistor, we'll place all of the rest now at the same time.
The two 220 ohm resistors RED and BLUE - named because they are the backlight series resistors for the RGB backlights on the LCDs. These resistors are colored Red Red Brown Gold.
Next up we will place the buttons. These buttons are useful to send a signal to the Pi (say if you have a basic menu system). We have a 4-way 'direction pad' for up/down/left/right input and a button to the right called SELECT. These 5 buttons should be able to make 'talking' back to your project easy. These are connected to the I2C port expander chip so they require no extra pins on the Pi, our library does the work of reading whether they are pressed.
All the buttons are the same, and they should snap nicely into place. Press down onto each button until it snaps in and sits flat against the PCB.
We recently adjusted the kit so the buttons are on the RIGHT side
instead of the left. The buttons snap in the same but they're on the right
Solder each leg, taking care not to accidentally 'short' two button legs together. The ones for the directional pads are very close!
Next, place the 10K potentiometer (the orange-faced thing with three legs) into the spot above the RESET button. It will only fit one way. This is the contrast potentiometer which will adjust how dark the characters appear. All displays are slightly different so you'll adjust this once the display is soldered in.
The kit may come with two potentiometers - a big blue one for
breadboarding the LCD and a smaller orange one for the shield kit. You
can throw away or recycle the blue one, use only the orange one here!
We recently adjusted the kit to have the potentiometer in the center rather than the right, goes in the same way, just in the middle!
We're nearly done! Now we will place the I2C port expander chip. Double check that it has the MCP23017-E/SP marking on it. This is a 16-pin expander chip, that uses the i2c bus. That means you can send it commands using the i2c pins on an Pi and control 16 more digital pins! 5 of those pins go to the buttons, 6 go to the LCD control and 3 are used for the backlight (the remaining 2 are unused).
Unlike buttons or resistors, chips do have a direction and the must be put in the right way! First, use a flat table to carefully bend the legs of the chip so they are parallel. Then slip it into the silkscreened outline so that the notch at the end of the chip is on the right. Click the image to the left to make absolutely sure you've got it in the right way. Once you are sure, press the chip into place
We recently adjusted the kit so the chip is more to the left, its the same alignment, just shifted over
On kits where the buttons are on the left, put it right below the contrast pot, as shown. This will keep the pot from touching the Ethernet jack.
On kits where the buttons are on the right, put it right next to the buttons (it shouldnt overlap any button legs) sitting flat
Solder in one pin, we suggest the top right, then check if the plate is sitting flat. If not, heat up the joint with one hand while stabilizing with the other until its right.
Then solder the other 25 pins
Break off a piece of 18 or 16 pin header from the stick in the kit.
If you have an RGB display, you'll need 18, for a blue&white you'll need 16
Place the header into the remaining slot with the long ends of the pins sticking UP. If you have only 16 pins, leave the two rightmost pads empty
Your LCD may have two rows of connectors or one row. If its a two-row-connector LCD we do not use the bottom row, just continue using the LCD as it will fit just fine!
The LCD should 'snap' in against the buttons
Solder all the pins!
Model B+ Protection
With the new Raspberry Pi model B+ and its extra USB ports there's a slight problem with the layout of the character LCD shield. As you can see in the photo below, the three through-hole backlight resistors have their leads right above one of the metal USB ports. Unfortunately these leads are quite close and can potentially short against the metal USB port.
Note that if you are using a Raspberry Pi model A or B (i.e. Pi with only 1 or 2 USB ports) you can skip this step and move on. You only need to add this tape if you're using a Raspberry Pi model B+, the Pi with 4 USB ports.
Page last edited November 21, 2012
Text editor powered by tinymce.
Python Usage
It's easy to use the I2C 16x2 RGB LCD Pi plate with Python and the Adafruit CircuitPython CharLCD library. This library allows you to easily write Python code that controls the RGB character LCD.
Assemble the plate as shown in the previous pages and attach to your Pi.
Python Installation of CharLCD Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This will also require enabling I2C on your Raspberry Pi and verifying you are running Python 3.
Once that's done, from your command line run the following command:
pip3 install adafruit-circuitpython-charlcd
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
Python Code
To demonstrate the usage of the character LCD we'll initialize it and display text using CircuitPython code.
First, you'll need to import necessary modules, initialize the I2C bus, and create an instance of the character LCD class. Paste the following code into your REPL:
import board import busio import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd lcd_columns = 16 lcd_rows = 2 i2c = busio.I2C(board.SCL, board.SDA) lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
Now you're ready to start writing text and characters on the display! The usage of the LCD class is exactly the same as shown in the parallel LCD wiring guide. Be sure to check out that guide for a complete discussion of LCD usage.
To see usage of the buttons in Python, see this code for functions left_button, up button, down_button, right_button, and select_button.
As a quick test though you can run the following code to use the color property to set the backlight to red and the message property to write text to the display:
lcd.color = [100, 0, 0] lcd.message = "Hello\nCircuitPython"
See the parallel LCD guide for more functions you can call to control the LCD!
If you don't see anything, adjust the potentiometer on the plate until the message shows up. The potentiometer is located below the LCD on the side opposite the buttons.
That's all there is to using the RGB character LCD Pi Plate with Python and the Adafruit CircuitPython CharLCD library!
Full Example Code
Save the following file to your Pi and run it to see a demo of some of the different things the character LCD library has to offer!
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""Simple test for I2C RGB character LCD shield kit"""
import time
import board
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd
# Modify this if you have a different sized Character LCD
lcd_columns = 16
lcd_rows = 2
# Initialise I2C bus.
i2c = board.I2C() # uses board.SCL and board.SDA
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
# Initialise the LCD class
lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
lcd.clear()
# Set LCD color to red
lcd.color = [100, 0, 0]
time.sleep(1)
# Print two line message
lcd.message = "Hello\nCircuitPython"
# Wait 5s
time.sleep(5)
# Set LCD color to blue
lcd.color = [0, 100, 0]
time.sleep(1)
# Set LCD color to green
lcd.color = [0, 0, 100]
time.sleep(1)
# Set LCD color to purple
lcd.color = [50, 0, 50]
time.sleep(1)
lcd.clear()
# Print two line message right to left
lcd.text_direction = lcd.RIGHT_TO_LEFT
lcd.message = "Hello\nCircuitPython"
# Wait 5s
time.sleep(5)
# Return text direction to left to right
lcd.text_direction = lcd.LEFT_TO_RIGHT
# Display cursor
lcd.clear()
lcd.cursor = True
lcd.message = "Cursor! "
# Wait 5s
time.sleep(5)
# Display blinking cursor
lcd.clear()
lcd.blink = True
lcd.message = "Blinky Cursor!"
# Wait 5s
time.sleep(5)
lcd.blink = False
lcd.clear()
# Create message to scroll
scroll_msg = "<-- Scroll"
lcd.message = scroll_msg
# Scroll to the left
for i in range(len(scroll_msg)):
time.sleep(0.5)
lcd.move_left()
lcd.clear()
time.sleep(1)
lcd.message = "Going to sleep\nCya later!"
time.sleep(5)
# Turn off LCD backlights and clear text
lcd.color = [0, 0, 0]
lcd.clear()
Page last edited November 21, 2012
Text editor powered by tinymce.
Download
- Adafruit's Pi Python codebase
- EagleCAD PCB files on GitHub
- Fritzing object in the Adafruit Fritzing Library
Check the Usage page for how to install the example python code directly from your Pi using git.
Page last edited November 21, 2012
Text editor powered by tinymce.