Learning Goals 5 min
- Recognise the HD44780 — the chip behind the classic 16×2 character LCD — and explain why almost every "blue" or "green" backlit 2-line display in hobby kits uses it.
- Compare the two wiring options: the bare 16-pin parallel interface (lots of jumpers) vs the I²C backpack (just 4 wires), and pick which one to use for which situation.
- Wire the LCD all the way to "contrast knob shows row of dark blocks", without writing any code yet — proving the hardware is healthy before adding software.
Warm-Up 10 min
The 16×2 character LCD is the most universal hobby display: 16 columns of 2 rows, each cell a 5×8 pixel character. You've seen it on microwave ovens, coffee machines, vending machines, photocopiers. The chip behind it — the Hitachi HD44780 — was released in 1987 and is still in mass production. That means the same code you write today would have worked on a hobby project in 1990.
Pre-task: identify your board
Look at your LCD. Two common forms in a classroom kit:
- Bare LCD: 16 pins along the top edge, nothing on the back. You wire all 16 to the breadboard yourself.
- LCD with I²C backpack: a tiny green PCB soldered to the back of the LCD with only 4 pins on the edge (GND, VCC, SDA, SCL).
The backpack version is far easier to wire (4 wires vs 12) and uses fewer Arduino pins (2 vs 6+). The bare version teaches you what's actually happening. We'll cover both today; subsequent lessons will use whichever you have.
New Concept · Wiring the LCD 25 min
The HD44780's 16 pins (bare module)
| Pin | Name | Role | Connect to (typical) |
|---|---|---|---|
| 1 | VSS | Ground | GND |
| 2 | VDD | +5 V power | +5 V |
| 3 | V0 | Contrast adjust | Middle of a 10 kΩ potentiometer (ends to +5 V and GND) |
| 4 | RS | Register select | D12 |
| 5 | RW | Read/Write | GND (always "write") |
| 6 | EN | Enable | D11 |
| 7–10 | D0–D3 | Lower data bits | Not used in 4-bit mode |
| 11–14 | D4–D7 | Upper data bits | D5, D4, D3, D2 |
| 15 | A (LED+) | Backlight + | +5 V (sometimes through a 220 Ω resistor) |
| 16 | K (LED−) | Backlight − | GND |
The Arduino tutorial pin order — D12, D11, D5, D4, D3, D2 for RS/EN/D4/D5/D6/D7 — is what the LiquidCrystal library examples use. Stick with it for tomorrow's lesson.
"4-bit mode" sends each character as two 4-bit nibbles instead of one byte, saving 4 Arduino pins. The library handles this automatically.
The contrast pot (V0)
Without the right voltage on the contrast pin, the LCD shows either nothing (V0 too high) or a row of solid dark blocks (V0 too low) or invisible text (V0 nearly perfect but slightly off). Always include the 10 kΩ potentiometer between +5 V and GND with the wiper on V0. Turn it slowly until you see fine text.
A common "help me my LCD doesn't work" cause: V0 wired straight to GND or +5 V instead of the pot wiper.
The I²C backpack version (only 4 wires)
The backpack contains a PCF8574 chip that converts I²C signals into the 16 parallel signals the LCD needs. From the Arduino:
| Backpack pin | Connect to |
|---|---|
| GND | GND |
| VCC | +5 V |
| SDA | UNO A4 |
| SCL | UNO A5 |
The contrast knob is still there but it's a tiny blue trim-pot on the back of the backpack — adjust with a small screwdriver instead of a knob. There's also a backlight on/off jumper.
Power-up self-test (no code yet!)
For either wiring style, you can verify the hardware is alive before writing any sketch:
- Apply power (USB or external).
- Turn the contrast pot/trimmer slowly from one end to the other.
- At some setting you should see one full row of dark blocks on the top line (the bare LCD), or dark blocks on both lines (some I²C versions).
Seeing those blocks means: power is good, the LCD is functional, the contrast is set correctly. No code needed. The blocks are the LCD's "test pattern" on cold boot — they go away once you send the first character.
Seeing nothing at any contrast setting → backlight isn't on (check pin 15/16 on bare; check the jumper on the backpack). Seeing nothing but the backlight glows → contrast pot isn't wired right.
Worked Example · Wire-and-test, no code 25 min
Today is a hardware-only lesson — no sketches. Your goal is to wire your LCD, power it, and see the test pattern. Tomorrow we add code.
Path A — bare 16-pin LCD
- Plug the LCD into the breadboard so all 16 pins are accessible. The pin row often spans 2 breadboards or needs an extender header.
- Wire the 10 kΩ potentiometer: end pins to +5 V and GND, wiper (middle) to LCD pin 3.
- LCD pin 1 (VSS) → GND.
- LCD pin 2 (VDD) → +5 V.
- LCD pin 5 (RW) → GND.
- LCD pin 15 (A) → +5 V (or via 220 Ω if your kit suggests).
- LCD pin 16 (K) → GND.
- Leave RS, EN, D4–D7 disconnected for now — we'll wire those tomorrow.
- Power up. Slowly turn the pot.
You should see the backlight glow (blue or green), and at one specific pot setting a row of dark rectangles appears across the top line. That's the pre-init test pattern. Pot too far one way → blank screen. Pot too far the other → very dark / completely black. Tune it to where the rectangles are crisp but the rest of the screen is clean.
Path B — I²C backpack LCD
- Plug 4 jumpers into the backpack (GND, VCC, SDA, SCL).
- GND → UNO GND. VCC → UNO +5 V.
- SDA → UNO A4.
- SCL → UNO A5.
- Power up.
- Adjust the blue trim-pot on the backpack with a tiny screwdriver. (Quarter-turn at a time — these pots are sensitive.)
Same outcome: backlight glows, dark rectangles appear at some trim-pot setting. Most I²C backpacks ship with the trim very close to the right value, so a tiny adjustment is all you need.
Troubleshooting
| Symptom | Most likely cause |
|---|---|
| Backlight off | Pin 15/16 wrong (bare); jumper missing on backpack |
| Backlight on, screen completely black | Contrast too low — turn pot the other way |
| Backlight on, screen completely blank | Contrast too high — turn pot the other way |
| Backlight on, faint stripes | Power supply weak; check +5 V at the LCD's VDD pin |
| Screen flickers | Loose breadboard wire; reseat all connections |
| Hot smell | Power off NOW — VDD and VSS swapped on a bare LCD |
Photograph your wiring
Take a clear photo of your working setup with the dark-rectangle test pattern visible. It's your reference if anything stops working in a future lesson — you can compare back to today's known-good state.
Try It Yourself 15 min
Goal: Read the data sheet (or product page) for your specific LCD module and find: the supported character set (some include Japanese katakana!), the backlight current draw in mA, and the supply voltage range.
Hint
Search "HD44780 datasheet" for the chip, then your module's sticker for the panel-specific values. Common figures: backlight 15–40 mA, supply 4.5–5.5 V, character set A00 (Japanese) or A02 (European).
Goal: Without code, prove the LCD's backlight current draw. Measure it with a multimeter on the DC mA range, in series with pin 15 (or the backpack's VCC). Compare to the datasheet figure.
Hint
Break the connection at pin 15 → put the multimeter in series → power up. The display behaviour shouldn't change. Reading: usually 20–40 mA. If your number is way off, your multimeter probes are in the wrong jacks (10A vs mA).
Goal: For the bare LCD: trace one of the data lines (e.g. D4 / LCD pin 11) on the back of the module and find which pin of the HD44780 chip it goes to. This requires removing the LCD from the breadboard and inspecting the back. (Skip if your module has the chip hidden under a black blob.)
Hint
The HD44780 is the rectangular chip with ~40 pins. D4–D7 of the module are pins 11–14 on the chip-side header. Inside, they connect (often via PCB traces) to the chip's pins of similar names. The point of the exercise is to remind you the "LCD" you're using is really "HD44780 + glass + backlight + a few resistors and capacitors".
Mini-Challenge · Build the comparison sheet 10 min
Make a one-page side-by-side comparison of bare vs I²C LCD for your project notebook. The card should include:
- Number of jumper wires (bare ≈ 12, I²C = 4).
- Number of Arduino pins used (bare ≈ 6, I²C = 2 — and the I²C pins are shared with other I²C devices).
- Cost difference (typically RM 4 backpack adds, so I²C version is ~RM 14 vs bare ~RM 10).
- Library required (bare:
LiquidCrystal, built-in; I²C:LiquidCrystal_I2C, install from Library Manager). - One reason you might pick bare (learning, no other I²C devices, fewer dependencies).
- One reason you might pick I²C (less breadboard clutter, freeing pins for sensors, easy to swap LCDs).
Tape this sheet inside the cover of your project notebook. Future you in L02-32 (digital thermometer) and L02-43 (Weather Station v2) will refer back to it.
Recap 5 min
The HD44780 is the 1987-vintage chip behind every classic 16×2 character LCD. You can wire it two ways: bare (12 wires, 6 Arduino pins, ultimate learning experience) or via an I²C backpack (4 wires, 2 shared pins, much tidier). Either way, the first sanity-check is to power up the LCD, turn the contrast pot, and watch for the dark-rectangle test pattern — proving the hardware is healthy before you blame the software. Tomorrow we install the appropriate library and print our first "Hello, world!" on the screen.
- HD44780
- The Hitachi LCD controller chip behind virtually all hobby character LCDs. Same protocol since 1987 — everything you learn today applies to any HD44780-compatible display.
- Character LCD
- A display whose pixels are pre-organised into fixed-size character cells (here 5×8 pixels per cell, in a 16×2 grid). Easier than graphic LCDs but limited to text + custom 5×8 icons.
- 4-bit mode
- Sending each byte as two 4-bit nibbles, saving 4 Arduino pins. The default mode the
LiquidCrystallibrary uses. - Contrast voltage (V0)
- The pin that sets how dark the segments appear. Always wired to a 10 kΩ pot's wiper; the pot ends go to +5 V and GND. Wrong setting = blank or solid-black screen.
- Backlight
- The LED panel behind the LCD that lights it up. Independent of the data pins — must be powered separately on most bare modules.
- I²C backpack
- A tiny PCB with a PCF8574 chip that converts I²C signals into the 16 parallel signals the HD44780 needs. Reduces wiring from 12 jumpers to 4.
- PCF8574
- The 8-bit I²C I/O expander on the backpack. We'll meet it again in L3 as a standalone chip for adding extra pins.
- SDA / SCL
- The two I²C bus lines (data and clock). On UNO: A4 and A5. We'll dive into I²C properly in L3.
- Test pattern
- The row(s) of dark rectangles a powered-but-uninitialised LCD displays. Confirms the panel and the backlight work.
- Character set A00 / A02
- HD44780 ROM variants. A00 includes Japanese katakana; A02 includes European accented characters. Doesn't affect basic ASCII.
Homework 5 min
Wire-and-photograph homework. If you didn't finish in class, wire your LCD at home to the dark-rectangle state. Take a clear photo. Note which path (bare or I²C) you took, and any issues you ran into.
Then, on paper, design a 16×2 layout for one of these display screens:
- Weather station readout: temperature and humidity on one line, light percentage on the other.
- Personal thermometer (L02-12): status label on the top line, °C value on the bottom.
- Distance display (L02-23): cm value on the top line, zone name on the bottom.
Draw the layout as a 16-wide × 2-tall grid, one character per cell. Note: 16 characters per row is fewer than "Temperature: 28.3 °C" (which is 19 characters). You'll have to abbreviate. That's the whole game with character LCDs — designing compact UI in a tiny canvas.
Bring back next class:
- Your photograph of the wired-up LCD.
- Your 16×2 layout sketch for one of the three projects above.
- Any troubleshooting notes — if it didn't work first time, what did you try?