+88013 1284 4142

ARDUINO NOKIA 5110 LCD DISPLAY PROJECT TUTORIAL IN ENGLISH |DOIT PROJECTS

Today,
I’m going to show how you can print a black and white image on arduino on nokia 5110 LCD display.
Let’s get started…
Materials need for our project-
1. Arduino UNO,
2. A breadboard,
3. A nokia display,
4. Some jumper wires
I have placed the display on a breadboard like this. Sorry for that my nokia display is of poor quality. After connected the jump wires it looks like this.
Now I explain the wiring system. You can see its looks like a complex wiring. The first pin of the display which is reset goes to digital pin 12 of the arduino board.
The second pin goes to digital pin 11.
The third pin goes to digital 10.
The fourth pin to digital pin 9 and the fifth pin to 8.
The next pin is cc. We connected cc to the positive rail on the breadboard to the 3.3V output of the Arduino.
This black wire for ground. We connected this wire to the negative rail of the bread board to the arduino ground. This blue wire we connected in negative rail of the breadboard to the Analogue pin A3 of Arduino UNO.
And this black wire for backlight of display. This wire we connected in backlight to the pin 7 of the breadboard. If we unplugged it, you can see the backlight of display is off.
So, that’s all our wiring system.
For this project we have to complete some steps. Our first step is selecting a black and WHITE IMAGE. You can select your own black and white image or logo as your wish. You can download them from Google. I want to select a black and white minions Image. I select this one.
So, I download it.
But it is not in a proper shape for our display. Now open it in paint. Go to the resize bar. Select it in pixel. Our pixel size is 84 by 48 because it is our LCD pixel size. Now save it.
After that we convert this Image in bitmap converter. Now choose the image which we recently edit. Then examine it. You can see we get a code for our Image. Now open it and past in any notepad. And save it.
Now go to the arduino software. There is our whole code. You can find arduino software download link in my description box. So we modified this section. Go to the saved notepad, copy the code and past there. The other print out code will be unchanged.
Now we verify our code. Ok, there no error you can see. Before upload the program go to the tools bar. And select the board which you use. I use there Arduino UNO. You can see there lots of board like Arduino NANO, Arduino ADK etc. And also make sure that you select the port which you use.
Now we upload the code. After uploading the code your image should be shown in display like this.

PROGRAM/ CODE
// Define digital pins

#define PIN_RESET 12
#define PIN_SCE 11
#define PIN_DC 10
#define PIN_SDIN 9
#define PIN_SCLK 8

#define LCD_C LOW
#define LCD_D HIGH

// Bounds of the display

#define LCD_X 84
#define LCD_Y 48

// Bitmap definition

char bmp1[] = {
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, 0xe0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x1f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe0, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x08, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x07, 0xff, 0x03, 0x00, 0x00, 0x08, 0x1d, 0x0f, 0x0f, 0x1f, 0x1f, 0x0f, 0x0f, 0x04, 0x00, 0x00, 0x00, 0x3e, 0xfe, 0x8f, 0x07, 0x0f, 0x1f, 0x0f, 0x1f, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x68, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x00, 0x20, 0x30, 0x30, 0x70, 0x3b, 0xf8, 0xf0, 0x80, 0x80, 0x80, 0x00, 0x70, 0xe0, 0xe8, 0xf8, 0xf0, 0x07, 0xdf, 0xbb, 0x3f, 0x03, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x02, 0x02, 0x22, 0x22, 0x62, 0x22, 0x32, 0x3e, 0x1f, 0x5f, 0xef, 0xf2, 0xf1, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0x00, 0x81, 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, 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, 0x00, 0x00, 0x21, 0x67, 0xce, 0x1e, 0x1c, 0x38, 0x78, 0x78, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0x3f, 0x7f, 0xdf, 0x2f, 0x87, 0xc3, 0xf1, 0xf8, 0xfc, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

// LCD Procedures

 

void LcdClear(void)

{

for (int index = 0; index < LCD_X * LCD_Y / 8; index++)

{

LcdWrite(LCD_D, 0x00);

}

}

 

void LcdInitialise(void)

{

pinMode(PIN_SCE, OUTPUT);

pinMode(PIN_RESET, OUTPUT);

pinMode(PIN_DC, OUTPUT);

pinMode(PIN_SDIN, OUTPUT);

pinMode(PIN_SCLK, OUTPUT);

digitalWrite(PIN_RESET, LOW);

digitalWrite(PIN_RESET, HIGH);

LcdWrite(LCD_C, 0x21 );  // LCD Extended Commands.

LcdWrite(LCD_C, 0xB1 );  // Set LCD Vop (Contrast).

LcdWrite(LCD_C, 0x04 );  // Set Temp coefficent. //0x04

LcdWrite(LCD_C, 0x14 );  // LCD bias mode 1:48. //0x13

LcdWrite(LCD_C, 0x0C );  // LCD in normal mode.

LcdWrite(LCD_C, 0x20 );

LcdWrite(LCD_C, 0x0C );

}

 

void gotoXY(int x, int y)

{

LcdWrite( 0, 0x80 | x);  // Column.

LcdWrite( 0, 0x40 | y);  // Row.

 

}

void LcdWrite(byte dc, byte data)

{

digitalWrite(PIN_DC, dc);

digitalWrite(PIN_SCE, LOW);

shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);

digitalWrite(PIN_SCE, HIGH);

}

 

void LcdBitmap(char my_array[]){

for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++)

LcdWrite(LCD_D, my_array[index]);

}

 

void setup(void)

{

LcdInitialise();

LcdClear();

gotoXY(0,0);

}

 

void loop(void)

{

LcdBitmap(bmp1);

while (bmp1)

{

}

}

Leave a Reply

Your email address will not be published. Required fields are marked *