Description
Description:
The Nokia 5110 is a basic graphic LCD screen for lots of applications. It was originally intended for as a cell phone screen. This one is mounted on an easy to solder PCB.
It uses the PCD8544 controller, which is the same used in the Nokia 3310 LCD. The PCD8544 is a low power CMOS LCD controller/driver, designed to drive a graphic display of 48 rows and 84 columns. All necessary functions for the display are provided in a single chip, including on-chip generation of LCD supply and bias voltages, resulting in a minimum of external components and low power consumption. The PCD8544 interfaces to microcontrollers through a serial bus interface.
Module Features.
*Resolution: 48 x 84 dot matrix panel.
*Power supply: 3.3V.
*Interface: SPI.
*Driver IC: PCD8544
Applications:
*This display is made of 84×48 individual pixels, so you can use it for graphics, text or bitmaps
How to get started using Nokia 5110 LCD display
These 84 by 48 pixel black and white LCDs are what you might be found in an old Nokia 3310. They’re not flash, and they don’t have a lot of display real-estate. But they are easy to control. If you’re looking to step up your project’s with user interface (UI) game from simple displays or LEDs, this graphic LCD is a good place to start.
Required materials:
before we display our first image and real time sensor values on this LCD, let look at the pinout for this LCD, To interface with Arduino and power the graphic LCD, there are two, parallel 8-pin headers above and below it, flipping the board over, you will find the labels for each of the pins.
- RST: Reset pin
- CE : Chip Select
- DC: Mode Select
- VCC: Positive power supply
- CLK: Serial clock
- DN: Serial data in
- LIGHT:LED backlight supply
- GND: Ground
- Power Supply
To supply voltages on the LCD,the most important supply voltage — VCC — which supplies the logic circuits inside the LCD. The datasheet sates this should be between 2.7 and 3.3v. in normal state, the LCD will consume about 6 or 7mA
- Baclklight
3.3V is required for LED back-lights on the board. if you were to remove the LCD from the PCB (not that you should, or need to), you’d see that these are back-lights in their simplest form- four white LEDs spaced around the edges of the board. You may also notice that there aren’t connected to any current limiting resistors.
This means you have to be careful with the voltage supply, either stick a current limiting resistor in series with the LED pin (as we did), or limit the supply to 3.3V max. The LED can pull a lot of current! with nothing to limit them, they’ll pull about 100mA at 3.3V
The control interface
Built into this LCD is a Philips PCD8544 display controller, which converts the massive parallel interface of the raw LCD to a more convenient serial one. The PCD8544 is controlled through a synchronous serial interface similar to SPI. there are clock(CLK) and data(DIN) input lines, and an active-low chip select(SCE) input as well On top of those three serial lines, there another input -DC-which tells the display whether the data it’s receiving is a command or displayable data.
Hardware Assembly and hookup
In this example we’ll be connecting the LCD up to an Arduino UNO like on the below scheme
Pin connection:
ARDUINO UNO | NOKIA SCREEN 5110 |
GND | GND |
GND | LIGHT |
3.3V | VCC |
D7 | CLK |
D6 | DIN |
D5 | DC |
D4 | CE |
D3 | RST |
You can add a potentiometer or connect this pin to any PWM-capable Arduino pin, if you wish to control its brightness.
The following diagram shows you how to wire everything.
Installing Library for Nokia 5110 LCD Module
The PCD8544 LCD controller has flexible yet complex drivers. Vast knowledge on memory addressing is required in order to use the PCD8544 controller. Fortunately, Adafruit’s PCD8544 Nokia 5110 LCD library was written to hide away all the complexities so that we can issue simple commands to control the display.
To install the library navigate to the Sketch > Include Library > Manage Libraries… Wait for Library Manager to download libraries index and update list of installed libraries.
Filter your search by typing ‘nokia’. There should be a couple entries. Look for Adafruit PCD8544 Nokia 5110 LCD library. Click on that entry, and then select Install.
This library is a hardware-specific library which handles lower-level functions. It needs to be paired with Adafruit GFX Library to display graphics primitives like points, lines, circles, rectangles etc. Install this library as well.
Arduino Code – Displaying Text
Now comes the interesting stuff!
The following test sketch will print ‘Hello World!’ message on the display. It also includes
- Displaying Inverted text
- Displaying Numbers
- Displaying Numbers with base (Hex, Dec)
- Displaying ASCII symbols
- Rotating Text
This will give you complete understanding about how to use the Nokia 5110 LCD display and can serve as the basis for more practical experiments and projects. Try the sketch out and then we will dissect it in some detail.
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
// Declare LCD object for software SPI
// Adafruit_PCD8544(CLK,DIN,D/C,CE,RST);
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
int rotatetext = 1;
void setup() {
Serial.begin(9600);
//Initialize Display
display.begin();
// you can change the contrast around to adapt the display for the best viewing!
display.setContrast(57);
// Clear the buffer.
display.clearDisplay();
// Display Text
display.setTextSize(1);
display.setTextColor(BLACK);
display.setCursor(0,0);
display.println(“Hello world!”);
display.display();
delay(2000);
display.clearDisplay();
// Display Inverted Text
display.setTextColor(WHITE, BLACK); // ‘inverted’ text
display.setCursor(0,0);
display.println(“Hello world!”);
display.display();
delay(2000);
display.clearDisplay();
// Scaling Font Size
display.setTextColor(BLACK);
display.setCursor(0,0);
display.setTextSize(2);
display.println(“Hello!”);
display.display();
delay(2000);
display.clearDisplay();
// Display Numbers
display.setTextSize(1);
display.setCursor(0,0);
display.println(123456789);
display.display();
delay(2000);
display.clearDisplay();
// Specifying Base For Numbers
display.setCursor(0,0);
display.print(“0x”); display.print(0xFF, HEX);
display.print(“(HEX) = “);
display.print(0xFF, DEC);
display.println(“(DEC)”);
display.display();
delay(2000);
display.clearDisplay();
// Display ASCII Characters
display.setCursor(0,0);
display.setTextSize(2);
display.write(3);
display.display();
d