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.

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,

[eBook] Build Web Servers with ESP32 and ESP8266 (2nd Edition)

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server communication protocols 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…

Guide for TCA9548A I2C Multiplexer ESP32 ESP8266 Arduino

Guide for TCA9548A I2C Multiplexer: ESP32, ESP8266, Arduino

ESP32 MQTT Publish DS18B20 Temperature Readings Arduino IDE

ESP32 MQTT – Publish DS18B20 Temperature Readings (Arduino IDE)

ESP32 Save Data Permanently using the Preferences Library

ESP32 Save Data Permanently using Preferences Library

Enjoyed this project? Stay updated by subscribing our newsletter!

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

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…

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?

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

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.

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.


Источник: randomnerdtutorials.com