Vous êtes sur la page 1sur 5

Blog (https://learn.sparkfun.

com/blog)

Curriculum (https://learn.sparkfun.com/curriculum)

Tutorials (https://learn.sparkfun.com/tutorials)

Classes (https://learn.sparkfun.com/events)

Calendar (https://learn.sparkfun.com/calendar)

Tour (https://learn.sparkfun.com/tour)
Search

Account

Graphic LCD Hookup Guide


Hardware Assembly & Hookup
Before we get to uploading code and sending data to the display, lets take care of the hardware
stuff first. That includes assembling the display, and hooking it up to the Arduino.

Assembly
To assemble the LCD, youll need to solder (https://learn.sparkfun.com/tutorials/how-to-solder--through-hole-soldering) something to one (or both) of the 8-pin headers. There are plenty of
options available here. To make the LCD breadboard-compatible, straight
(https://www.sparkfun.com/products/116) or right-angle male headers
(https://www.sparkfun.com/products/553) can be soldered in.

(https://dlnmh9ip6v2uc.cloudfront.net/assets/7/3/6/5/5/52718001757b7f4c758b4567.png)
LCD with strait male headers soldered in, plugged into a mini blue breadboard
(https://www.sparkfun.com/products/11660).
Otherwise, wires (https://www.sparkfun.com/products/11375) or other connectors
(https://learn.sparkfun.com/tutorials/connector-basics) can be soldered to the display pins.

Hookup
In this example well be connecting the LCD up to an Arduino, but this hookup should be easily
adaptable to other development platforms. For the data transmission pins SCLK and DN(MOSI)
well use the Arduinos hardware SPI pins, which will help to achieve a faster data transfer.
The chip select (SCE), reset (RST), and a data/command (D/C) pins can be connected to any digital
I/O pin. Finally, the LED pin should be connected to a PWM-capable Arduino pin, so we can dim
the backlight as we please.
Unfortunately, the LCD has a maximum input voltage of 3.6V, so we cant hook up a standard
5V Arduino straight to it. We need to shift levels. This leads us to a few options for hookup:

Direct Connect
The easiest hookup is to connect the Arduino pins directly to the LCD. To allow for this easy
hookup, youll need a 3.3V-operating Arduino like the 3.3V/8MHz Pro
(https://www.sparkfun.com/products/10914) or 3.3V Pro Mini
(https://www.sparkfun.com/products/11114).

This setup can work for 5V Arduinos, ignoring the 3.6V limit on the VCC and data lines. Weve
done this. It works. But it may decrease your LCDs life.

(https://dlnmh9ip6v2uc.cloudfront.net/assets/4/3/0/8/2/52570af8757b7f550c8b456b.png)
The data pins are connected as follows:
LCD Pin

Arduino Pin

Notes

1 - VCC

3.3V (VCC)

3.3V only (not 5V!)

2 - GND

GND

3 - SCE

Can be any digital pin.

4 - RST

Can be any digital pin.

5 - D/C

Can be any digital pin.

6 - DN(MOSI)

11

Cant be moved.

SCLK

13

Cant be moved.

LED

Can be any PWM pin. 330 resistor in between the pins.

Limiting Resistors
Sticking resistors in-line with the data signals is a cheap, and easy way to add some protection to
the 3.3V lines. If you have an Arduino Uno (or similar 5V duino) and some 10k and 1k
resistors lying around, try this:

(https://dlnmh9ip6v2uc.cloudfront.net/assets/3/e/9/5/3/52570cf9757b7fa70c8b4567.png)
The pins are connected the same as in the above example, however each signal has an inline
resistor. There are 10k resistors between the SCLK, DN, D/C, and RST pins. A 1k resistor
between SCE and pin 7. And the 330 resistor remains between pin 9 and the LED pin.

Lev el Conv erters


Finally, a third option for hookup is to use actual level converters to switch between 5V and 3.3V.
Boards like the Bi-Directional Logic Level Converter (https://learn.sparkfun.com/tutorials/bidirectional-logic-level-converter-hookup-guide) and the TXB0104
(https://learn.sparkfun.com/tutorials/txb0104-level-shifter-hookup-guide) are perfect for
something like this.

(https://dlnmh9ip6v2uc.cloudfront.net/assets/6/4/d/c/0/526ec17e757b7f69088b456c.png)

Unfortunately, the LCD has five 3.3V signal inputs and the level shifters only have four channels.
If you want to keep the circuit to a single shifter, you can permanently tie RST high (through a
10k resistors), and run the other signals through the shifter. You lose remote reset capability,
but the rest of the control remains.
Check out the hook up guides for those boards for more help in shifting the signal between
Arduino and LCD.

Display Overview (https://learn.sparkfun.com/tutorials/graphiclcd-hookup-guide/display-overview) | Example Code 1: LCD Demo


(https://learn.sparkfun.com/tutorials/graphic-lcd-hookupguide/example-code-1-lcd-demo)
W ant more information about SparkFun's classes? Interested in getting involved with teaching
electronics? Just want to talk? Send an e-mail to our education department.
education@sparkfun.com (mailto:education@sparkfun.com)
SparkFun is a company built around one core idea sharing ingenuity. W e think everyone should have the
hardware and resources to learn and play with cool electronic gadgetry.
Share, give, learn, SparkFun. (https://learn.sparkfun.com/license)
Do you regularly instruct classes and workshops in a formal or informal learning environment? SparkFun
offers Educator Discounts to people teaching and sharing electronics.
Find out more. (https://learn.sparkfun.com/educators)

(https://www.sparkfun.com)

SparkFun Electronics (https://www.sparkfun.com)

Vous aimerez peut-être aussi