Write to the LCD1602
Use the LiquidCrystal library in 4-bit mode. RS=D12, E=D11 and data D4–D7=D5,D4,D3,D2. Print a greeting and elapsed seconds.
Use the LiquidCrystal library in 4-bit mode. RS=D12, E=D11 and data D4–D7=D5,D4,D3,D2. Print a greeting and elapsed seconds.
Use the Uno R3 Learning Kit. Build with power disconnected, check the labelled connections, then upload the supplied sketch. Drag or zoom the 3D model to inspect it from any angle.
Also needed
Use matching female-ended jumper leads or a soldered 2.54mm header if your LCD is supplied with empty pads.
Step 1 — Watch the complete build
Press Play for the narrated build. You can rotate and zoom the model while it plays, or follow the individual steps below.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around. Connect the Arduino’s five volt output to the separate motor supply rail. Connect Arduino ground to the lower ground rail. Add the 16 × 2 character L C D. Keep its terminals accessible for the connections that follow. Add the 10 kiloohms rotary potentiometer. Its 1 lead goes into column 10 row E; the highlights show the remaining holes. Add the 330 ohms resistor. Its Pin 0 lead goes into column 20 row H; the highlights show the remaining holes. Connect the screen's ground supply pin to the lower ground rail. Connect the screen’s positive supply pin to the separate motor supply rail. Connect the screen’s RW pin to the lower ground rail. Connect the potentiometer’s 1 pin to the separate motor supply rail. Connect the potentiometer’s 3 pin to the lower ground rail. Connect the potentiometer’s WIPER pin to the screen’s VO pin. Connect the screen’s RS pin to Arduino digital pin 12. Connect the screen’s E pin to Arduino digital pin 11. Connect the screen’s D4 pin to Arduino digital pin 5. Connect the screen’s D5 pin to Arduino digital pin 4. Connect the screen’s D6 pin to Arduino digital pin 3. Connect the screen’s D7 pin to Arduino digital pin 2. Connect the separate motor supply rail to one end of the resistor. Connect the other end of the resistor to the screen’s A pin. Connect the screen’s K pin to the lower ground rail. Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 2 — Understand the breadboard
Keep USB disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Loading assembly…
Keep U S B disconnected while you build. On this breadboard, each group of five holes shares a connection; the centre channel separates the two halves. You can drag the 3D view to look around.
Step 3 — Connect Uno 5V → B+ rail 3
Connect the Arduino’s five volt output to the separate motor supply rail.
| Connect | To |
|---|---|
| Uno 5V | B+ rail 3 |
Loading assembly…
Connect the Arduino’s five volt output to the separate motor supply rail.
Step 4 — Connect Uno GND → B- rail 1
Connect Arduino ground to the lower ground rail.
| Connect | To |
|---|---|
| Uno GND | B- rail 1 |
Loading assembly…
Connect Arduino ground to the lower ground rail.
Step 5 — Place 16 × 2 character LCD
Add the 16 × 2 character LCD. Keep its terminals accessible for the connections that follow.
Loading assembly…
Add the 16 × 2 character L C D. Keep its terminals accessible for the connections that follow.
Step 6 — Place 10 kΩ rotary potentiometer
Add the 10 kΩ rotary potentiometer. Its 1 lead goes into column 10 row E; the highlights show the remaining holes.
Exact breadboard holes
- pot · 1 → column 10 row E
- pot · WIPER → column 9 row E
- pot · 3 → column 8 row E
Loading assembly…
Add the 10 kiloohms rotary potentiometer. Its 1 lead goes into column 10 row E; the highlights show the remaining holes.
Step 7 — Place 330 Ω resistor
Add the 330 Ω resistor. Its Pin 0 lead goes into column 20 row H; the highlights show the remaining holes.
Exact breadboard holes
- r · Pin 0 → column 20 row H
- r · Pin 1 → column 24 row H
Loading assembly…
Add the 330 ohms resistor. Its Pin 0 lead goes into column 20 row H; the highlights show the remaining holes.
Step 8 — Connect 16 × 2 character LCD VSS → B- rail 23
Connect the screen’s VSS pin to the lower ground rail.
| Connect | To |
|---|---|
| 16 × 2 character LCD VSS | B- rail 23 |
Loading assembly…
Connect the screen's ground supply pin to the lower ground rail.
Step 9 — Connect 16 × 2 character LCD VDD → B+ rail 25
Connect the screen’s VDD pin to the separate motor supply rail.
| Connect | To |
|---|---|
| 16 × 2 character LCD VDD | B+ rail 25 |
Loading assembly…
Connect the screen’s positive supply pin to the separate motor supply rail.
Step 10 — Connect 16 × 2 character LCD RW → B- rail 27
Connect the screen’s RW pin to the lower ground rail.
| Connect | To |
|---|---|
| 16 × 2 character LCD RW | B- rail 27 |
Loading assembly…
Connect the screen’s RW pin to the lower ground rail.
Step 11 — Connect column 10 row A → B+ rail 10
Connect the potentiometer’s 1 pin to the separate motor supply rail.
| Connect | To |
|---|---|
| column 10 row A | B+ rail 10 |
Loading assembly…
Connect the potentiometer’s 1 pin to the separate motor supply rail.
Step 12 — Connect column 8 row A → B- rail 8
Connect the potentiometer’s 3 pin to the lower ground rail.
| Connect | To |
|---|---|
| column 8 row A | B- rail 8 |
Loading assembly…
Connect the potentiometer’s 3 pin to the lower ground rail.
Step 13 — Connect column 9 row A → 16 × 2 character LCD VO
Connect the potentiometer’s WIPER pin to the screen’s VO pin.
| Connect | To |
|---|---|
| column 9 row A | 16 × 2 character LCD VO |
Loading assembly…
Connect the potentiometer’s WIPER pin to the screen’s VO pin.
Step 14 — Connect 16 × 2 character LCD RS → Uno D12/MISO
Connect the screen’s RS pin to Arduino digital pin 12.
| Connect | To |
|---|---|
| 16 × 2 character LCD RS | Uno D12/MISO |
Loading assembly…
Connect the screen’s RS pin to Arduino digital pin 12.
Step 15 — Connect 16 × 2 character LCD E → Uno D11 PWM/MOSI
Connect the screen’s E pin to Arduino digital pin 11.
| Connect | To |
|---|---|
| 16 × 2 character LCD E | Uno D11 PWM/MOSI |
Loading assembly…
Connect the screen’s E pin to Arduino digital pin 11.
Step 16 — Connect 16 × 2 character LCD D4 → Uno D5 PWM
Connect the screen’s D4 pin to Arduino digital pin 5.
| Connect | To |
|---|---|
| 16 × 2 character LCD D4 | Uno D5 PWM |
Loading assembly…
Connect the screen’s D4 pin to Arduino digital pin 5.
Step 17 — Connect 16 × 2 character LCD D5 → Uno D4
Connect the screen’s D5 pin to Arduino digital pin 4.
| Connect | To |
|---|---|
| 16 × 2 character LCD D5 | Uno D4 |
Loading assembly…
Connect the screen’s D5 pin to Arduino digital pin 4.
Step 18 — Connect 16 × 2 character LCD D6 → Uno D3 PWM
Connect the screen’s D6 pin to Arduino digital pin 3.
| Connect | To |
|---|---|
| 16 × 2 character LCD D6 | Uno D3 PWM |
Loading assembly…
Connect the screen’s D6 pin to Arduino digital pin 3.
Step 19 — Connect 16 × 2 character LCD D7 → Uno D2
Connect the screen’s D7 pin to Arduino digital pin 2.
| Connect | To |
|---|---|
| 16 × 2 character LCD D7 | Uno D2 |
Loading assembly…
Connect the screen’s D7 pin to Arduino digital pin 2.
Step 20 — Connect B+ rail 20 → column 20 row J
Connect the separate motor supply rail to one end of the resistor.
| Connect | To |
|---|---|
| B+ rail 20 | column 20 row J |
Loading assembly…
Connect the separate motor supply rail to one end of the resistor.
Step 21 — Connect column 24 row J → 16 × 2 character LCD A
Connect the other end of the resistor to the screen’s A pin.
| Connect | To |
|---|---|
| column 24 row J | 16 × 2 character LCD A |
Loading assembly…
Connect the other end of the resistor to the screen’s A pin.
Step 22 — Connect 16 × 2 character LCD K → B- rail 29
Connect the screen’s K pin to the lower ground rail.
| Connect | To |
|---|---|
| 16 × 2 character LCD K | B- rail 29 |
Loading assembly…
Connect the screen’s K pin to the lower ground rail.
Step 23 — Place USB-A to USB-B cable · Uno
Check all wiring. Connect the square USB-B plug to the Uno and the USB-A plug to your computer. Use Verify and Upload in the code editor below.
Loading assembly…
Check all wiring. Connect the square U S B-B plug to the Uno and the U S B-A plug to your computer. Use Verify and Upload in the code editor below.
Step 24 — Program your Uno
Choose Arduino Uno. Verify, pair the board and Upload this sketch. Keep USB connected. Use the LiquidCrystal library in 4-bit mode. RS=D12, E=D11 and data D4–D7=D5,D4,D3,D2. Print a greeting and elapsed seconds.
Step 25 — Try it and troubleshoot
Turn the contrast potentiometer until the characters appear clearly. The second line counts elapsed seconds.
If it does not work
Backlight without text is often a contrast setting or an incorrect RS/E/data connection. Check the header labels rather than the viewing orientation.
Parts List
Required Parts (1)
Use the components named in this tutorial. A computer and any additional power supply are not included.
x1
$64.70
In stockProject Summary
1 part total
Unavailable items will be skipped