How to Use Nokia 5110 LCD With Arduino?

8,793

53

5

Introduction: How to Use Nokia 5110 LCD With Arduino?

About: My name is Bay Yolal, hello everybody!

Today, I am going to show you how to use Nokia 5110's display with Arduino boards with these easy steps.

The need list:

1. Arduino UNO (With USB cable)

2. Nokia 5110 LCD (With tiny cables)

Step 1: The Connections

Follow the connections as shown in the picture. You may use tiny cables to make connections are working.

Step 2: The Codes

There are some files below.

text.txt file has got whole codes for Arduino IDE

nokia_5110.fzz file is for Fritzing project Nokia 5110 LCD's library

Graphics.c file is working with test.ino file

test.ino file is including the codes. Don't forget to keep near Graphics.c file together at the same folder.

test.rar has got both test.ino and Graphics.c files together in one file.

Also here is the codes:

// LCD5110_Graph_Demo
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved // web: http://www.RinkyDinkElectronics.com/ // // This program is a demo of most of the functions // in the library. // // This program requires a Nokia 5110 LCD module. // // It is assumed that the LCD module is connected to // the following pins using a levelshifter to get the // correct voltage to the module. // SCK - Pin 8 // MOSI - Pin 9 // DC - Pin 10 // RST - Pin 11 // CS - Pin 12 // #include

LCD5110 myGLCD(8,9,10,11,12);

extern uint8_t SmallFont[]; extern uint8_t arduino_logo[]; extern unsigned char TinyFont[]; extern uint8_t The_End[]; extern uint8_t pacman1[]; extern uint8_t pacman2[]; extern uint8_t pacman3[]; extern uint8_t pill[];

float y; uint8_t* bm; int pacy;

void setup() { myGLCD.InitLCD(); myGLCD.setFont(SmallFont); randomSeed(analogRead(7)); }

void loop() { myGLCD.clrScr(); myGLCD.drawBitmap(0, 0, arduino_logo, 84, 48); myGLCD.update();

delay(2000); myGLCD.clrScr(); myGLCD.print("LCD5110_Graph", CENTER, 0); myGLCD.print("DEMO", CENTER, 20); myGLCD.drawRect(28, 18, 56, 28); for (int i=0; i<6; i++) { myGLCD.drawLine(57, 18+(i*2), 83-(i*3), 18+(i*2)); myGLCD.drawLine((i*3), 28-(i*2), 28, 28-(i*2)); } myGLCD.setFont(TinyFont); myGLCD.print("(C)2015 by", CENTER, 36); myGLCD.print("Henning Karlsen", CENTER, 42); myGLCD.update(); delay(5000); myGLCD.clrScr(); for (int i=0; i<48; i+=2) { myGLCD.drawLine(0, i, 83, 47-i); myGLCD.update(); } for (int i=83; i>=0; i-=2) { myGLCD.drawLine(i, 0, 83-i, 47); myGLCD.update(); }

delay(2000); myGLCD.clrScr(); myGLCD.drawRect(0, 0, 83, 47); for (int i=0; i<48; i+=4) { myGLCD.drawLine(0, i, i*1.75, 47); myGLCD.update(); } for (int i=0; i<48; i+=4) { myGLCD.drawLine(83, 47-i, 83-(i*1.75), 0); myGLCD.update(); }

delay(2000); myGLCD.clrScr(); for (int i=0; i<8; i++) { myGLCD.drawRoundRect(i*3, i*3, 83-(i*3), 47-(i*3)); myGLCD.update(); }

delay(2000); myGLCD.clrScr(); for (int i=0; i<17; i++) { myGLCD.drawCircle(41, 23, i*3); myGLCD.update(); }

delay(2000); myGLCD.clrScr(); myGLCD.drawRect(0, 0, 83, 47); myGLCD.drawLine(0, 23, 84, 23); myGLCD.drawLine(41, 0, 41, 47); for (int c=0; c<4; c++) { for (int i=0; i<84; i++) { y=i*0.017453292519943295769236907684886; myGLCD.invPixel(i, (sin(y*6)*20)+23); myGLCD.update(); delay(20); } }

delay(2000);

for (int pc=0; pc<3; pc++) { pacy=random(0, 28); for (int i=-20; i<84; i++) { myGLCD.clrScr(); for (int p=4; p>((i+20)/20); p--) myGLCD.drawBitmap(p*20-8, pacy+7, pill, 5, 5); switch(((i+20)/3) % 4) { case 0: bm=pacman1; break; case 1: bm=pacman2; break; case 2: bm=pacman3; break; case 3: bm=pacman2; break; } myGLCD.drawBitmap(i, pacy, bm, 20, 20); myGLCD.update(); delay(25); } }

for (int i=0; i<25; i++) { myGLCD.clrScr(); myGLCD.drawBitmap(0, i-24, The_End, 84, 24); myGLCD.update(); delay(100); } myGLCD.setFont(SmallFont); myGLCD.print("Runtime (ms):", CENTER, 32); myGLCD.printNumI(millis(), CENTER, 40); myGLCD.update(); for (int i=0; i<5; i++) { myGLCD.invert(true); delay(1000); myGLCD.invert(false); delay(1000); } }

Step 3: The Video

That's all!

Hack Your Day Contest

Participated in the
Hack Your Day Contest

Digital Life 101 Challenge

Participated in the
Digital Life 101 Challenge

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    5 Discussions

    0
    parisa2000
    parisa2000

    1 year ago

    hi, can you launched sensor fluxgate flc100 magnetometr with ardunio and conected to pc wiht bleuthos? thack you very much, please reply on my gmail, thanks

    0
    tecibram
    tecibram

    4 years ago

    Güzel bir uygulama olmuş, teşekkürler.

    0
    Bay Yolal
    Bay Yolal

    Reply 4 years ago

    Rica ederiz :)

    0
    MugiR
    MugiR

    4 years ago

    im already try, but found this

    Arduino: 1.6.0 (Windows 7), Board: "Arduino Uno"

    Build options changed, rebuilding all

    LCD5110\Graphics.c.o:(.progmem.data.pill+0x0): multiple definition of `pill'
    Graphics.c.o:(.progmem.data.pill+0x0): first defined here
    LCD5110\Graphics.c.o:(.progmem.data.pacman3+0x0): multiple definition of `pacman3'
    Graphics.c.o:(.progmem.data.pacman3+0x0): first defined here
    LCD5110\Graphics.c.o:(.progmem.data.pacman2+0x0): multiple definition of `pacman2'
    Graphics.c.o:(.progmem.data.pacman2+0x0): first defined here
    LCD5110\Graphics.c.o:(.progmem.data.pacman1+0x0): multiple definition of `pacman1'
    Graphics.c.o:(.progmem.data.pacman1+0x0): first defined here
    LCD5110\Graphics.c.o:(.progmem.data.The_End+0x0): multiple definition of `The_End'
    Graphics.c.o:(.progmem.data.The_End+0x0): first defined here
    LCD5110\Graphics.c.o:(.progmem.data.arduino_logo+0x0): multiple definition of `arduino_logo'
    Graphics.c.o:(.progmem.data.arduino_logo+0x0): first defined here
    collect2: error: ld returned 1 exit status
    Error compiling.

    This report would have more information with
    "Show verbose output during compilation"
    enabled in File > Preferences.

    0
    Bay Yolal
    Bay Yolal

    Reply 4 years ago

    You may download the rar file from this page not copy the codes directly. When you download extract every file to a folder than move this folder near arduino library folder. Open Arduino ide, watch the video to do settings. If you got error still, I will help you over Team Wiever. But first, try again.