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:
- Complete Guide for Ultrasonic Sensor HC-SR04
- Complete Guide for nRF24L01 – 2.4GHz RF Transceiver Module With Arduino
- Complete Guide for DHT11/DHT22 Humidity and Temperature Sensor
- Complete Guide for RF 433MHz Transmitter/Receiver Module
- Arduino with PIR Motion Sensor
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.
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:
- Download the PCD8544 library
- Open your Arduino IDE
- Go to Sketch > Include Library > Add .ZIP Library
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.
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++;
}
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
Hi
Thanks for the Nokia guide.
I would be glad if you also could make a guide for the Skylab SKM53 GPS module.
Thanks for submitting a post idea! Right now I need to finish other projects first…
Hello Rui
Many thanks for your tireless engagement in order to inform us about complete applications like schematics and sktech code.
Daniel from Switzerland
You’re welcome.
Thanks for reading my tutorials Daniel!
I’ve found that the 5110s from eBay are quite a mixed bag.
Many of them do operate on 3.3 volts, but not all of them.
Some of them require as much as 5v.
I wasn’t aware of that problem, thanks for sharing your experience with these LCD modules Mendel
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!
Hey! Thanks for your feedback David!
I appreciate your continuous support!
I had a lot of trouble with this module until I realised one of the pins I was using on my esp32 (pin 34, I think) was an input only pin.
Hi.
Make sure you always check the pinout of the ESP32 board before starting any project: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Regards,
Sara
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.
Hi Kunal,
Thank you for your interest in my project! Can you please email me here: https://randomnerdtutorials.com/support.
So we can discuss this?
Thanks for your support,
Rui
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,
Hi Mircea,
This pinout is correct and it works for this module, but there are modules with different pinouts.
What’s yours LCD pinout?
Thanks for sharing bro…
You’re welcome,
Rui
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
Sounds like the library is not installed properly…
* 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
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)???
I would double check your LCD pinout from the store that you bought
As Rui points out, there is, unfortunately, no standardized pinout for various 5110 modules being sold on eBay and elsewhere. Mostly the modules do have the pins labeled, though.
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.
Parabéns Rui pelas explicações.
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) */
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.
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
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