Complete Guide for Nokia 5110 LCD with Arduino

This post aims to be a complete guide for Nokia 5110 LCD with Arduino. I’ll explain what it does, show its specs and share an Arduino project example that you can take and apply to your own projects.

I have more complete guides for other popular sensors and Arduino modules, check them below:

Description

The Nokia 5110 LCD is very popular among the Arduino tinkerers. These modules are used on wide variety of applications that require some sort of interface or display data to the user.

These modules are very cheap and you can use them with any microcontroller (MCU).

Specifications Nokia 5110 LCD

  • 84*48 dot matrix LCD (shows 4 lines of characters)
  • Price: $2/$3
  • Voltage: 3.3V
  • Module size: 45.2mm x 43.1mm
  • Model: Nokia 5510
  • Controller: PCD8544

Where to buy?

You can purchase these modules from eBay for just a few dollars. Click here to see Nokia 5110 LCD for Arduino on eBay.

Nokia 5110 LCD

Arduino with Nokia 5110 LCD

You need the following components to make this example:

  • 1x Arduino (eBay)
  • 1x Nokia 5110 LCD (eBay)
  • 1x Potenciometer
  • 4x 10K Ohm Resistors
  • 1x 1k Ohm Resistor
  • 1x 330 Ohm Resistor
  • Breadboard (eBay)

Library download

Here’s the library you need for this project:

  1. Download the PCD8544 library
  2. Open your Arduino IDE
  3. Go to Sketch > Include Library > Add .ZIP Library

PinoutNokia 5110 LCD pinout

1) RST – Reset
2) CE – Chip Enable
3) D/C – Data/Command Selection
4) DIN – Serial Input
5) CLK – Clock Input
6) VCC – 3.3V
7) LIGHT – Backlight Control
8) GND – Ground

Schematics

The Nokia 5110 LCD operates at 3.3V. So you can’t connect the Arduino Uno digital pins directly. Read this blog post to learn how you can level shift the signals from 5V to 3.3V.

I’ll be adding some resistors in series with the data signals to protect the 3.3V lines.

Using Logic Level Converters to switch from 5V to 3.3V is the best option to interact with this LCD.

Nokia 5110 arduino

Uploading Sketch

After installing the PCD8544 library in your Arduino IDE, you can find the sketch below in File > Examples > PCD8544 > HelloWorld.

/*
 * PCD8544 - Interface with Philips PCD8544 (or compatible) LCDs.
 *
 * Copyright (c) 2010 Carlos Rodrigues <[email protected]>
 *
 * To use this sketch, connect the eight pins from your LCD like this:
 *
 * Pin 1 -> +3.3V (rightmost, when facing the display head-on)
 * Pin 2 -> Arduino digital pin 3
 * Pin 3 -> Arduino digital pin 4
 * Pin 4 -> Arduino digital pin 5
 * Pin 5 -> Arduino digital pin 7
 * Pin 6 -> Ground
 * Pin 7 -> 10uF capacitor -> Ground
 * Pin 8 -> Arduino digital pin 6
 *
 * Since these LCDs are +3.3V devices, you have to add extra components to
 * connect it to the digital pins of the Arduino (not necessary if you are
 * using a 3.3V variant of the Arduino, such as Sparkfun's Arduino Pro).
 */

#include <PCD8544.h>

// A custom glyph (a smiley)...
static const byte glyph[] = { B00010000, B00110100, B00110000, B00110100, B00010000 };

static PCD8544 lcd;

void setup() {
  // PCD8544-compatible displays may have a different resolution...
  lcd.begin(84, 48);

  // Add the smiley to position "0" of the ASCII table...
  lcd.createChar(0, glyph);
}


void loop() {
  // Just to show the program is alive...
  static int counter = 0;

  // Write a piece of text on the first line...
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");

  // Write the counter on the second line...
  lcd.setCursor(0, 1);
  lcd.print(counter, DEC);
  lcd.write(' ');
  lcd.write(0);  // write the smiley

  // Use a potentiometer to set the LCD contrast...
  // short level = map(analogRead(A0), 0, 1023, 0, 127);
  // lcd.setContrast(level);

  delay(200);
  counter++;
}

View raw code

Demonstration

After you upload the sketch your LCD should print the words: “Hello, World!”.

I hope you found this guide useful.

Share this post with a friend that also likes electronics!

You can contact me by leaving a comment. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Thanks for reading,

-Rui Santos



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

28 thoughts on “Complete Guide for Nokia 5110 LCD with Arduino”

  1. Hello Rui

    Many thanks for your tireless engagement in order to inform us about complete applications like schematics and sktech code.
    Daniel from Switzerland

    Reply
  2. Great job on the tutorial on the Nokia 5110 LCD with Arduino. I have been working with the 5110 for the past year and your tutorial was exactly what was needed for those new to the Nokia 5110 LCD with Arduino set up. I would like to make a Nokia 5110 LCD wrist watch, using a Pro-Mini as the micro controller. That would proudly announce to all the world that ‘YES’ I’m a Random Nerd!

    Reply
  3. Dear Rui,
    I enjoyed reading your Arduino eBook with 18+ Projects. The presentations and explanations are truly praise worthy. I am tempted and in a hurry to buy your other couple of books: Home Automation Using ESP8266 and Password Protected Web Server Accessible from Anywhere using ESP8266 and Arduino IDE.

    I would be pleased to know about any possibility to provide an additional reduction on buying both the books together?

    Thanking you.

    Reply
  4. Dear Mr,

    You have great tutorial, buit here there are some mistakes.
    The pinout is not correct.
    Please, send me / us the correct links between Arduino and 5110.

    A good day,

    Reply
  5. i am getting error

    TFTDisplayText.cpp.o: In function `loop’:
    /usr/share/arduino/TFTDisplayText.ino:22: undefined reference to `PCD8544::begin(unsigned char, unsigned char, unsigned char)’
    /usr/share/arduino/TFTDisplayText.ino:26: undefined reference to `PCD8544::createChar(unsigned char, unsigned char const*)’
    /usr/share/arduino/TFTDisplayText.ino:23: undefined reference to `PCD8544::PCD8544(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)’
    /usr/share/arduino/TFTDisplayText.ino:22: undefined reference to `PCD8544::setCursor(unsigned char, unsigned char)’
    /usr/share/arduino/TFTDisplayText.ino:26: undefined reference to `PCD8544::setCursor(unsigned char, unsigned char)’
    /usr/share/arduino/TFTDisplayText.ino:28: undefined reference to `PCD8544::write(unsigned char)’
    /usr/share/arduino/TFTDisplayText.ino:29: undefined reference to `PCD8544::write(unsigned char)’
    collect2: error: ld returned 1 exit status

    Reply
  6. * Pin 1 -> +3.3V (rightmost, when facing the display head-on)
    * Pin 2 -> Arduino digital pin 3
    * Pin 3 -> Arduino digital pin 4
    * Pin 4 -> Arduino digital pin 5
    * Pin 5 -> Arduino digital pin 7
    * Pin 6 -> Ground
    * Pin 7 -> 10uF capacitor -> Ground
    * Pin 8 -> Arduino digital pin 6
    sorry ı am too old I did not get it
    you should give the names of pins instead of pin numbers on the lcd side

    Reply
  7. Is the pinout correct?

    Compare pinout in description:
    1) RST – Reset
    2) CE – Chip Enable
    3) D/C – Data/Command Selection
    4) DIN – Serial Input
    5) CLK – Clock Input
    6) VCC – 3.3V
    7) LIGHT – Backlight Control
    8) GND – Ground

    with pinout in sketch:
    * Pin 1 -> +3.3V (rightmost, when facing the display head-on)
    * Pin 2 -> Arduino digital pin 3
    * Pin 3 -> Arduino digital pin 4
    * Pin 4 -> Arduino digital pin 5
    * Pin 5 -> Arduino digital pin 7
    * Pin 6 -> Ground
    * Pin 7 -> 10uF capacitor -> Ground
    * Pin 8 -> Arduino digital pin 6

    For example: connect VCC with Ground (pin 6)???

    Reply
  8. There are two variants of the 5110 LCD. One uses the pins you describe under Pinout above. The other uses the pin configurations in your Hello World demo. They are different. The code makes no provision for the back light (Pin 7 above). And… line 58 sets the glypy, but the compiler shows a type incompatibility. Bottom line, I could not get this to work or show any activity on the screen.

    Reply
  9. Works great!
    look in header:

    // All the pins can be changed from the default values…
    PCD8544(uint8_t sclk = 3, /* clock (display pin 2) */
    uint8_t sdin = 4, /* data-in (display pin 3) */
    uint8_t dc = 5, /* data select (display pin 4) */
    uint8_t reset = 6, /* reset (display pin 8) */
    uint8_t sce = 7); /* enable (display pin 5) */

    Reply
  10. I have instead an Olimex MOD-LCD3310 with UEXT connector and my development board is ESP32-PoE-ISO. I understand that some of the UEXT pins are shared like GPIO4 and U1TXD; GPIO16 and I2C-SCL and so on. Is there anything I need to set in the code so that these shared pins in UEXT function as intended for the LCD-3310?
    Thank you in advance.

    PS.
    I am enrolled in some of your courses (6). I am currently on “Build Web Servers on ESP32 and ESP8266” but I just whizzed through the pdf guide and so progress is not tracked. I am a dot net developer C# and have good electronics background but new to this “Arduino” thing as a hobby, and just starting my personal IOT projects.

    Reply
    • Hi Joel.
      I never tried this display with the ESP32. I also haven’t experimented with that ESP32 board.
      The display uses SPI communication. So, I guess that you should set manually in the code the SPI pins you want to use.
      I’m not sure if the library in this tutorial is compatible with the ESP32.
      This tutorial is very old. It may be outdated.

      Since you are one of our customers, you can post your questions related to our courses or other subjects on the RNTLAB forum: https://rntlab.com/forum/
      Regards,
      Sara

      Reply
      • Hi Sara,
        Thanks for your reply. Even i found the library for the LCD3310 last update to be 6 years ago.
        Anyway, I will try to explore how I could make it work.
        Thank you very much.

        Cheers!
        Joel

        Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.