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

QtyPartWhat it does
1Arduino Unothe microcontroller board
1Nokia 5110 LCD84×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

#FromTo
1Arduino Uno 3.3VNokia 5110 LCD VCC
2Arduino Uno 3.3VNokia 5110 LCD BL
3Arduino Uno GNDNokia 5110 LCD GND
4Arduino Uno pin 5Nokia 5110 LCD DC
5Arduino Uno pin 4Nokia 5110 LCD CE
6Arduino Uno pin 3Nokia 5110 LCD RST
7Arduino Uno pin 13Nokia 5110 LCD CLK
8Arduino Uno pin 11Nokia 5110 LCD DIN

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add a Nokia 5110 LCD from the parts palette.
  3. Wire 1. Connect Arduino Uno 3.3V to Nokia 5110 LCD VCC.
  4. Wire 2. Connect Arduino Uno 3.3V to Nokia 5110 LCD BL.
  5. Wire 3. Connect Arduino Uno GND to Nokia 5110 LCD GND.
  6. Wire 4. Connect Arduino Uno pin 5 to Nokia 5110 LCD DC.
  7. Wire 5. Connect Arduino Uno pin 4 to Nokia 5110 LCD CE.
  8. Wire 6. Connect Arduino Uno pin 3 to Nokia 5110 LCD RST.
  9. Wire 7. Connect Arduino Uno pin 13 to Nokia 5110 LCD CLK.
  10. Wire 8. Connect Arduino Uno pin 11 to Nokia 5110 LCD DIN.
  11. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  12. 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