Connecting Nokia 5110 LCD (Philips PCD8544) to Arduino Nano

> Coding, hacking, computer graphics, game dev, and such...
User avatar
fips
Site Admin
Posts: 170
Joined: Wed Nov 12, 2008 9:49 pm
Location: Prague
Contact:

Connecting Nokia 5110 LCD (Philips PCD8544) to Arduino Nano

Post by fips »

I've spent a couple of days figuring out how to connect the legendary Nokia 5110 LCD (84 x 48) to my Ardurino Nano. Although I've encountered a bunch of tutorials covering this topic around the internet, none of them seemed as straightforward as I would expect, so I decided to create my own one to capture the journey.

First, I got the Nokia 5110 LCD here, pretty cheaply, for a couple of bucks. Then I learnt that the LCD uses a Philips PCD8544 display controller, which operates at 3.3 V, so I would need to convert Arduino Nano output logic levels from 5 V to 3.3 V to prevent any damage on the LCD. The easiest way to address this was to use a 4050 level shifter, which is nicely covered in this tutorial.

Image

After wiring things together, I started to look for a software library that I could use to communicate with the LCD. I wasn't very successful until I'd encountered u8glib, which is a universal graphics library for 8-bit embedded systems. This looked quite promising, but I was still a bit confused about the pin naming so I created a little table to help me see the relations:

Code: Select all

LCD            wire         note                            Arduino
------------------------------------------------------------------
1-VCC ........ (red) ...... +3.3 V ........................ 3V3
2-GND ........ (black) .... ground ........................ GND
3-SCE ........ (yellow) ... chip select (CS) .............. D10
4-RST ........ (orange) ... reset ......................... D8
5-D/C ........ (green) .... data/command selector (A0) .... D9
6-DN<MOSI> ... (blue) ..... serial data in (MOSI, SDIN) ... D11
7-SCLK ....... (white) .... clock (SCK, CLK) .............. D13
8-LED ........ (red) ...... backlight, +3.3 V ............. 3V3
Here is the schematics:
Image

And here is the demo code:

Code: Select all

/*
(c) 2013 +++ Filip Stoklas, aka FipS, http://www.4FipS.com +++
THIS CODE IS FREE - LICENSED UNDER THE MIT LICENSE
ARTICLE URL: http://forums.4fips.com/viewtopic.php?f=3&t=1086
*/

#include "U8glib.h"

U8GLIB_PCD8544 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8

void draw()
{
    u8g.setFont(u8g_font_unifont);
    u8g.drawStr(5, 22, "4FipS.com");
    u8g.drawStr(24, 35, "2013");
}

void setup()
{
    u8g.setColorIndex(1); // pixel on
}

void loop()
{
    u8g.firstPage();

    do
    {
        draw();
    }
    while(u8g.nextPage());

    delay(500);
}
KingBeetle66
Posts: 1
Joined: Sat May 16, 2015 6:30 am

Re: Connecting Nokia 5110 LCD (Philips PCD8544) to Arduino N

Post by KingBeetle66 »

Great post! Like you, I struggled to find a simple description that would allow me to get the display connected and working with my Arduino. The biggest issue I had was that the labels for the pins in the U8gLib library didn't correspond to the labels on my display. Your post made it easy.

Thanks!
Post Reply