Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 3

For this exercise we are going to control the LCD display using 4-bit mode.

Whilst is is possible to
connect to it in other ways using I2C or the UART this is the most direct method. In order to control
the display in this way will we need to use 6 pins on the GPIO port, 4 data pins and 2 control pins.

LCD pin layout


Data pins- We will use pins 11 to 14 (data4-7) to send data to the display by toggling
high/low
Enable Will be toggled to write data to the registers
Read/Write Since we only want to write to the display not read, this will be toggled to
low(write)
Register Select This toggles the Lcd display between two modes, Command mode (high)
and Data mode (low). Command mode gives a Instruction to the LCD. Example Clear the
display , Move cursor to home etc and Data tells the LCD to display characters.
Contrast Voltage This adjusts the contrast on the display and will controlled by the
potentiometer when wired up to the circuit.
VDD Will be wired to a 5V supply from the Pi's GPIO port.
Step 2 - Assemble the circuit
Below is a schematic of the circuit and a wiring diagram, taken from the Adafruit website:

In order for the LCD to work we will wire the circuit up in a fashion similar to the diagram above,
but hold off connecting everything together for now! The list below tells you exactly what the pins
on the LCD connect to:

Pin #1 (VSS) connects to ground (black wire)


Pin #2 (VDD) connects to +5V (red wire)
Pin #3 (VE) connects to the middle leg of the potentiometer (orange wire)
Pin #4 (RS) connects to the Cobber #25 (yellow wire)
Pin #5 (RW) goes to ground (black wire)
Pin #6 (EN) connects to cobber #24 (green wire)
Skip LCD Pins #7, #8, #9 and #10
Pin #11 (D4) connects to cobber #23 (blue wire)
Pin #12 (D5) connects to cobber #17 (violet wire)
Pin #13 (D6) connects to cobber #21 (gray wire)
Pin #14 (D7) connects to cobber #22 (white wire)
Pin #15 (LED +) goes to +5V (red wire)
Pin #16 (LED -) goes to ground (black wire)

Begin assembling the circuit by inserting the Adafruit cobbler into the breadboard. Remember to
straddle the cobbler over the centre of the breadboard so that no two pin is in the same row. Next
insert the LCD display into the breadboard. Connect the 5V and GND pins from the cobbler to the
top of breadboard and also connect Pins 1, 2, 15 on the LCD and 16 to their respective power rails.

You might also like