📠 Display Module Nokia5110 Connection to Arduino

Many articles have been written about the text display, but in some cases, it may not be enough. In this article, we will look at connecting the simplest graphic black and white display module Nokia 5110 to the Arduino and analyze the library from Adafruit.
nokia_5110_mod

Many articles have been written about the text display, but in some cases, it may not be enough. In this article, we will look at connecting the simplest graphic black and white display module Nokia 5110 to the Arduino and analyze the library from Adafruit.

Components:

  • Arduino (Uno, Mega, Nano, …)
  • LCD nokia5110
  • Breadboard
  • Wires

 

In wide distribution, you can find two versions of the modules: on the blue and red board. Both modules have eight pins.

Purpose:
RST – Output for resetting the display controller.
CE – The status of this pin allows or denies input to the display controller.
DC – Output selection of data entry mode – Data / Commands
DIN – SPI serial data input
CLK – Clocking pin for SPI serial interface
VCC – Display Controller Power 2.7 – 3.3V
BL (LIGHT) – Backlight
GND – GND

Inside the display is a PCD8544 controller. Its power supply must be within 2.7-3.3V (maximum 3.3V, when 5Volt is applied to the VCC pin, the display may fail).

The signal pins are tolerant to 5V and are connected to any digital Arduino pins. In order for our sketch to work, connect it according to the following scheme:

Nokia 5110  Arduino
 RST  D7
 CE  D6
 DC  D5
 Din  D4
 CLK  D3
 VCC  3.3В
 GND  GND

When using the blue module, the backlight of the “BL” is activated by giving 3.3 or 5V

When using the red module, the backlight of the “LIGHT” display is activated by giving a minus (GND)

Library required for working with Adafruit_GFX_Library module

It needs to be unpacked and added to the “libraries” folder in the folder with the Arduino IDE. Do not forget to restart the environment if at the time of adding the IDE card was opened.

When compiling a sketch, a conflict with the RobotControl library may occur, so it is desirable to move it to another location.

#include 
#include 

// pin 3 - Serial clock out (SCLK)
// pin 4 - Serial data out (DIN)
// pin 5 - Data/Command select (D/C)
// pin 6 - LCD chip select (CS)
// pin 7 - LCD reset (RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(3, 4, 5, 6, 7);

const static unsigned char PROGMEM logoBmp[] =
{
  B11111111, B11111111, B10000000,
  B11111111, B11111111, B10000000,
  B11111111, B11111111, B10000000,
  B11111100, B00000011, B10000000,
  B11111000, B00000001, B10000000,
  B11111100, B00000011, B10000000,
  B11111111, B11000011, B10000000,
  B11111111, B10000111, B10000000,
  B11111111, B10001111, B10000000,
  B11111111, B00001111, B10000000,
  B11111110, B00011111, B10000000,
  B11111110, B00011111, B10000000,
  B11111100, B00111111, B10000000,
  B11111100, B01111111, B10000000,
  B11111000, B00000011, B10000000,
  B11111000, B00000001, B10000000
};


void setup() {
  Serial.begin(9600);
  display.begin();            
  display.setContrast(60);      
  display.setTextColor(BLACK);  
  display.setTextSize(1);       
  display.clearDisplay();     
  display.display();
  delay(1000); 
}

void loop() {
  display.drawBitmap(LCDWIDTH/2-8, LCDHEIGHT/2-8, logoBmp, 24, 16, BLACK); // x, y, logo, w, h, color 
  display.display();
  delay(2000);
  
  display.clearDisplay();
  display.display();
  delay(1000);
  
  display.drawPixel(0, 0, BLACK);  
  display.drawPixel(1, 1, BLACK);  
  display.drawPixel(2, 2, WHITE);  
  display.drawPixel(3, 3, BLACK);  
  display.drawPixel(4, 4, BLACK);  
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawLine(0, LCDHEIGHT-1, LCDWIDTH, 0, BLACK); // x0, y0, x1, y1, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawFastVLine(LCDWIDTH/2, 0, LCDHEIGHT, BLACK); // x, y, h, color
  display.drawFastHLine(0, LCDHEIGHT/2, LCDWIDTH, BLACK); //x, y, w, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawRect(LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, LCDHEIGHT/2, BLACK); // x, y, w, h, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.fillRect(LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, LCDHEIGHT/2, BLACK); // x, y, w, h, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.fillScreen(BLACK);
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawCircle(LCDWIDTH/2, LCDHEIGHT/2, LCDHEIGHT/2, BLACK); // x, y, r, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.fillCircle(LCDWIDTH/2, LCDHEIGHT/2, LCDHEIGHT/2, BLACK); // x, y, r, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawTriangle(LCDWIDTH/4, LCDHEIGHT/4, 3*LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, 3*LCDHEIGHT/4, BLACK); // x0, y0, x1, y1, x2, y2, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.fillTriangle(LCDWIDTH/4, LCDHEIGHT/4, 3*LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, 3*LCDHEIGHT/4, BLACK); // x0, y0, x1, y1, x2, y2, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.drawRoundRect(LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, LCDHEIGHT/2, 10, BLACK); // x, y, w, h, r, color
  display.display();
  delay(2000);

  display.clearDisplay();
  display.display();
  delay(1000);

  display.fillRoundRect(LCDWIDTH/4, LCDHEIGHT/4, LCDWIDTH/2, LCDHEIGHT/2, 10, BLACK); // x, y, w, h, r, colordisplay.display();   display.display();   delay(2000);   display.clearDisplay();   display.display();   delay(1000);   display.drawBitmap(LCDWIDTH/2-8, LCDHEIGHT/2-8, logoBmp, 24, 16, BLACK); // x, y, logo, w, h, color   display.display();   delay(2000);   display.clearDisplay();   display.display();   delay(1000);   display.print("Zelectro");   delay(3000);   display.clearDisplay();   display.display();   delay(5000); }

 

Share on facebook
Facebook
Share on google
Google+
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on pinterest
Pinterest