Arduino Nokia 5110 LCD (PCD8544): Wiring, Code and Simulator
To build this Arduino Nokia 5110 LCD (PCD8544) project you need an Arduino Uno and a Nokia 5110 LCD. Adafruit_PCD8544 on hardware SPI draws text, a box and a counter on the 84×48 Nokia LCD. Make the 8 connections in the wiring table, upload the Arduino C++ code, and change setContrast(55) to 30 or 90 and see the glass go faint or grey. Disconnect BL to turn the backlight off.
Open this circuit in the free Arduino Uno simulator
Parts list
| Qty | Part | What it does |
|---|---|---|
| 1 | Arduino Uno | the microcontroller board |
| 1 | Nokia 5110 LCD | 84×48 monochrome LCD on SPI: RST, CE, DC to any pins, DIN to MOSI (11), CLK to SCK (13), VCC 3.3 V, GND, BL HIGH for the backlight. Adafruit_PCD8544 with software or hardware SPI; set the contrast if the screen looks blank or black. |
Wiring
| # | From | To |
|---|---|---|
| 1 | Arduino Uno 3.3V | Nokia 5110 LCD VCC |
| 2 | Arduino Uno 3.3V | Nokia 5110 LCD BL |
| 3 | Arduino Uno GND | Nokia 5110 LCD GND |
| 4 | Arduino Uno pin 5 | Nokia 5110 LCD DC |
| 5 | Arduino Uno pin 4 | Nokia 5110 LCD CE |
| 6 | Arduino Uno pin 3 | Nokia 5110 LCD RST |
| 7 | Arduino Uno pin 13 | Nokia 5110 LCD CLK |
| 8 | Arduino Uno pin 11 | Nokia 5110 LCD DIN |
Step by step
- Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
- Add the parts. Add a Nokia 5110 LCD from the parts palette.
- Wire 1. Connect Arduino Uno 3.3V to Nokia 5110 LCD VCC.
- Wire 2. Connect Arduino Uno 3.3V to Nokia 5110 LCD BL.
- Wire 3. Connect Arduino Uno GND to Nokia 5110 LCD GND.
- Wire 4. Connect Arduino Uno pin 5 to Nokia 5110 LCD DC.
- Wire 5. Connect Arduino Uno pin 4 to Nokia 5110 LCD CE.
- Wire 6. Connect Arduino Uno pin 3 to Nokia 5110 LCD RST.
- Wire 7. Connect Arduino Uno pin 13 to Nokia 5110 LCD CLK.
- Wire 8. Connect Arduino Uno pin 11 to Nokia 5110 LCD DIN.
- Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
- Run it. Press Run. Change setContrast(55) to 30 or 90 and see the glass go faint or grey. Disconnect BL to turn the backlight off.
Arduino C++ code
// Nokia 5110 LCD (PCD8544) with Adafruit_PCD8544 on hardware SPI.
// DIN -> 11, CLK -> 13, DC -> 5, CE -> 4, RST -> 3, VCC 3.3V, BL -> 3.3V, GND.
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
Adafruit_PCD8544 display(5, 4, 3); // DC, CE (chip select), RST
void setup() {
Serial.begin(9600);
display.begin();
display.setContrast(55);
display.clearDisplay();
display.setTextColor(BLACK);
display.setTextSize(1);
display.setCursor(0, 0);
display.println("BitForBytes");
display.println("Nokia 5110");
display.drawRect(0, 20, 84, 28, BLACK);
display.display();
Serial.println("LCD ready");
}
void loop() {
static int n = 0;
// Redraw the box: a counter and a bar that grows.
display.fillRect(1, 21, 82, 26, WHITE);
display.setCursor(4, 24);
display.setTextSize(2);
display.print(n);
display.setTextSize(1);
display.fillRect(4, 41, (n % 20) * 4, 4, BLACK);
display.display();
Serial.print("Count ");
Serial.println(n);
n++;
delay(500);
}
What to try
Change setContrast(55) to 30 or 90 and see the glass go faint or grey. Disconnect BL to turn the backlight off.
Frequently asked questions
How do I wire the Nokia 5110 LCD (PCD8544) project on an Arduino Uno?
Make 8 connections: Arduino Uno 3.3V to Nokia 5110 LCD VCC; Arduino Uno 3.3V to Nokia 5110 LCD BL; Arduino Uno GND to Nokia 5110 LCD GND; Arduino Uno pin 5 to Nokia 5110 LCD DC; Arduino Uno pin 4 to Nokia 5110 LCD CE; Arduino Uno pin 3 to Nokia 5110 LCD RST; Arduino Uno pin 13 to Nokia 5110 LCD CLK; Arduino Uno pin 11 to Nokia 5110 LCD DIN.
What parts do I need for this Arduino project?
An Arduino Uno and a Nokia 5110 LCD.
Can I simulate this Arduino project online for free?
Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.
What does the code do?
Adafruit_PCD8544 on hardware SPI draws text, a box and a counter on the 84×48 Nokia LCD.
Why is my Nokia 5110 screen blank or completely black?
The contrast (Vop) is wrong for your module: too low and nothing shows, too high and the whole glass goes dark. Try setContrast() between 40 and 60.
Is the Nokia 5110 3.3 V or 5 V?
The PCD8544 is a 3.3 V chip: power it from 3.3 V, and on a 5 V Arduino use resistors or a level shifter on the signal lines.
More Arduino Uno projects
- Arduino LED Blink: Wiring, Code and Simulator
- Arduino LDR Light Sensor: Wiring, Code and Simulator
- Arduino NTC Thermistor Thermometer: Wiring, Code and Simulator
- Arduino PWM to Analog RC Filter: Wiring, Code and Simulator
- Arduino Capacitance Meter: Wiring, Code and Simulator
- Arduino DC Motor PWM Speed Control with MOSFET: Wiring, Code and Simulator