How to make an Arduino project with a 5110 display

Using the terrific 5110 LCD display with an Arduino

The 5110 display was original made for use in mobile phones (e.g. the Nokia 5110) and so it’s sometimes called a Nokia 5110 Display. The display is low cost and low power, and relatively low resolution (84 x 48 dots). And although their resolution is lower than say a 128×64 OLED (display size of 0.96″), it is actually physically much bigger (with a display of about 1.5″) which is a  benefit for many projects. Sometimes a 128×64 OLED is just too small for the application.

The 5110’s low cost, ease of use, low power (especially good for battery powered projects) and its dimensions make it a very popular display for Arduino, Raspberry PI and other micro controller projects.

In this article, we will show how to wire it up, how to code it and how to mount it nicely.

A quick note about mounting displays

We’re sorry to say that many displays on home/DIY Arduino can look a little, well, untidy. Project boxes and panels often have poorly cut square holes for their displays which are then mounted with ugly screws. Although hobbyists do their best to achieve a professional-looking finish, it is difficult to get it right. Roughly cut holes and exposed screw heads is just not a great look!!!

We offer BEZELS for many different display types, including for the 5110 LCD, which you can buy from our eBay shop. Made from black acrylic, it is a nice, shiny professional looking bezel that hides the cut-out and screws. We supply the 5110 LCD with it because we want the display and bezel to be compatible.

5110 with and without bezel

How to drive the display

This is a serial display, but instead of using anything like I2C, the display is driven from normal digital pins. Although I like I2C, using normal digital pins is not too much of a faff, and we don’t need to install the I2C (Wire) library . The data is clocked in using data pin and a serial clock pin. Very easy.

Connecting the display

For our project, we are using a Pro Micro (8MHz 3.3v variant). There are 8 pins (which are replicated on both ends of the PCB here) to connect, as follows (although you can connect the signal pins to whatever digital output pin works for you):

  1. RST. To reset the display to Arduino D6
  2. CE. to Select the display to Arduino D2
  3. DC. Data/Command selectorto Arduino D3
  4. DIN. Data into Arduino D4
  5. CLK. Clock into Arduino D5
  6. VCC. The power supply, connected to 3.3V in our case (directly from the Arduino 3.3V VCC pin)
  7. LIGHT. The backlight. You can connect this to VCC, but we think it’s better to connect it via a 1K Ohm variable resistor, so the voltage (i.e. the brightness of the backlight) can be varied.
  8. GND. The 0V supply pin, connected to any of the 3 GND pins on out Arduino.
The Arduino is powered by the USB port and delivers 3.3V with the onboard regulator. For this Arduino, you must correctly set the Processor type and its voltage in the Arduino IDE Here is is ATmega32U4 (3.3v, 8MHz)

Coding the Arduino Sketch

As usual, a library is the best way to proceed with getting the display working. For our demo use, we used this library from github . It is an easy to use library, and it lightweight (so it takes less of the precious Arduino memory). Other libraries may provide a richer set of functions, but we like this one because it’s small and easy to  use.

Here is the code:
// This is a test Arduino sketch for the 5110 dispay.
// You will need to install a suitable library.
// We coded this example using the library from https://github.com/platisd/nokia-5110-lcd-library
// but you should use whatever library works for you.
// ********** IMPORTANT NOTE **********
// The 5110 LCD that we provide should be powered from 3.3V max.
// BUT the logic/signal IO connections are compatible with 3.3V max only (this is usual for any 5110 display)
// Do not use 5V power or 5V logic for the logic/signal IO.
// For testing, we use the 3.3V Arduino Pro Micro, but you might want to use another 3.3V Arduino, or a 5V arduino with logic level conversion

//this is the 5110 LCD library
#include <Nokia_LCD.h>

//this section defines the connections for the LCD 5110.
#define LRST 6
#define LCE 2
#define LDC 3
#define LDIN 4
#define LCLK 5

//this initiates the 5110
Nokia_LCD lcd(LCLK, LDIN, LDC, LCE, LRST);

//this is an image of a sample chart for loading into the LCD
const unsigned char chart [336] PROGMEM = {
0xFF, 0x02, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20,
0x40, 0x40, 0x40, 0x40, 0x80, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04,
0x04, 0x08, 0x08, 0x10, 0x20, 0x20, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20,
0x10, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40,
0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08,
0x04, 0x04, 0x0C, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x01, 0x02, 0x02,
0x04, 0x08, 0x08, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x04, 0x02,
0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x41, 0x81, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x06,
0x08, 0x30, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x04, 0x18, 0x20, 0xC0,
0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80,
0x80, 0x80, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0xFF, 0x80, 0x80, 0x80,
0x81, 0x81, 0x81, 0x82, 0x82, 0x82, 0x84, 0x84, 0x88, 0x88, 0x88, 0x90, 0x90, 0x8C, 0x83, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x8C, 0x90, 0x8C, 0x83, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x8C, 0x90, 0x90, 0x88, 0x88, 0x84, 0x86, 0x82, 0x82, 0x84,
0x84, 0x84, 0x84, 0x88, 0x88, 0x88, 0x88, 0x90, 0x90, 0x90, 0x90, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
0xA0, 0x90, 0x90, 0x90, 0x90, 0x88, 0x88, 0x88, 0x88, 0x84, 0x84, 0x84, 0x82, 0x82, 0x82, 0x82
};

void setup() {
// Initialize the screen
lcd.begin();
// Set the contrast
lcd.setContrast(60); // Good values are usualy between 40 and 60
// Clear the screen by filling it with black pixels, then clearing.
lcd.clear(true);
delay(100);
lcd.clear();
delay(1000);

//driving the display is easy enough. Set the cursor position (column, row) and write what you need.

lcd.setCursor(0, 0); //this is (column, row)
lcd.print(“Our 5110 demo”);

lcd.setCursor(0, 1);
lcd.print(“A sample chart”);

lcd.setCursor(0, 2); //this is (column, row)
lcd.draw(chart,336,true); //draws the bitmap (var-name,size,true=in progmem)

delay(5000);
}

void loop() {

}

This is the output of the code

You can see the result of the code in the picture here.

The sample chart was created in ms paint (saves as a monochrome bitmap) of size 84 dots wide x 32 dots tall. it is then converted using a great little utility called LCD Assistant which is available from http://en.radzio.dxp.pl/bitmap_converter/  It’s a fabulous little utility; others may be available. 

We don’t take responsibility for things you download, and we always virus scan and malware scan anything we download ourselves.

 

In summary

The 5110 LCD is a terrific display. It is easy to use, low power, cheap and is of quite nice dimensions. 

The only drawback to a professional looking project is mounting the display in your project box or panel, and hiding the cut-out and screws.

Bezel to the rescue

We provide a range of custom BEZELS for all kinds of Arduino displays (LCD, OLED, LED, etc). You can buy a great-looking bezel for your project – complete WITH the 5110 – from our eBay shop.

5110 with and without bezel