When it comes to debugging and giving user interface to your lovely embedded projects, it’s not easy to interface a display with satisfactory result. Most of the available LCDs in the market either costly (costing 5$ – 100 $) or bearing a low refresh rate or bulky or not user-friendly or doesn’t have the proper DPI to show the convenient picture to operate your project and desired device. So, In this tutorial, we will give our projects a premiere look with NOKIA’s tiny and premiere looking 5100 LCD. So, tighten your seatbelt and let’s jump into it.

The Nokia LCD costs around 3$-6$ and can be easily found in your online store. And the motion quality, refresh rate, good dpi and awesome animating capability worth it. So gather the necessary components and start interfacing.

Necessary components: –

  1. NOKIA 5100 LCD – https://techshopbd.com/product-categories/lcd/3042/lcd-84×48-nokia-5110-techshop-bangladesh
  2. Arduino Uno – https://techshopbd.com/product-categories/boards/1253/arduino-uno-r3-china-techshop-bangladesh
  3. Breadboard – https://techshopbd.com/product-categories/project-board/231/breadboard-techshop-bangladesh
  4. Male to Male Jumper Wire – https://techshopbd.com/product-categories/cable/1083/male-to-male-jumper-wire-single-techshop-bangladesh
  5. 330 Ohms Resistor – https://techshopbd.com/product-categories/resistor/333/330-ohm-1-4w-resistor-pack-of-20-techshop-bangladesh
  6. 1K Ohms Resistor – https://techshopbd.com/product-categories/resistor/338/1k-ohm-1-4w-resistor-pack-of-20-techshop-bangladesh
  7. 10K Ohms Resistors 4 pieces – https://techshopbd.com/product-categories/resistor/352/10k-ohm-1-4w-resistor-pack-of-20-techshop-bangladesh

!!! Warning: Nokia LCD runs on 3.3v. So, don’t apply 5v, else you may fry the LCD.

!!!Although every Arduino provides a 5v clean output, they are poor at providing 3.3v clean and regulated output. Arduino Uno and mega is better for supplying 3.3v to LCD. So we are using Arduino Uno for this task. Still, it is safer to use resistors in between them else you have to use a bi-directional logic level converter module for proper translation between 3.3v and 5v. !!!

SCHEMATIC: INTERFACING NOKIA 5100 LCD with Arduino

It is easy to interface when you follow the details of the table given below.-

LCD Pin Pin Description Status Uno Pin Notes Resistors
1 – RST RESET Active Low 8 Can be any digital pin 10KΩ resistor in between the pins.
2 – CE Chip select Active Low 9 Can be any digital pin 1KΩ resistor in between the pins.
3 – D/C Mode select Select between command mode (low) and data mode (high) 10 Can be any digital pin 10KΩ resistor in between the pins.
4 – DN(MOSI) Serial Data In   11 Can’t be moved 10KΩ resistor in between the pins.
5 – CLK Serial Clock   13 Can’t be moved 10KΩ resistor in between the pins.
6 – VCC Voltage Source Supply range is between 2.7V and 3.3V 3.3v(VCC) 3.3V only (not 5V!)    
7 – LIGHT Backlight of LCD Maximum voltage supply is 3.3V 6 Can be any PWM pin. 330Ω resistor in between the pins.
8 – GND Ground   GND Any ground pin  

We have now enough information to interface the LCD, so let’s start –

  1. Setup the circuit on your breadboard according to the above diagram and table. Once it is set, we are ready for the next exciting part – coding.
  2. To start playing with our LCD, we have to install some libraries.
  3. Download PCD8544 Library from the link below:-https://github.com/ShaonMajumder/pcd8544
  4. This is a good working library, but unfortunately, there is no way to explicitly define the LCD pins when initializing the library(pcd8544 object). So, we have to change the configuration manually.     After downloading the library from github.com, go to pcd8544.h file and change the pin configuration values as below and save the file.
  5. Then copy the whole library folder to your Arduino’s libraries folder.[C:\Program Files (x86)\Arduino\libraries]
  6.  

Now we are ready to run our code. Open your Arduino IDE and open the HelloWorld Sketch from Examples>PCD8544>HelloWorld and Hit upload button.

For your convenience, the code looks like this:

#include <PCD8544.h>


// A custom glyph (a smiley)...
static const byte glyph[] = { B00010000, B00110100, B00110000, B00110100, B00010000 };


static PCD8544 lcd;


void setup() {
  // PCD8544-compatible displays may have a different resolution...
  lcd.begin(84, 48);

  // Add the smiley to position "0" of the ASCII table...
  lcd.createChar(0, glyph);
}


void loop() {
  // Just to show the program is alive...
  static int counter = 0;

  // Write a piece of text on the first line...
  lcd.setCursor(0, 0);
  lcd.print("Hello, World!");

  // Write the counter on the second line...
  lcd.setCursor(0, 1);
  lcd.print(counter, DEC);
  lcd.write(' ');
  lcd.write(0);  // write the smiley

  // Use a potentiometer to set the LCD contrast...
  // short level = map(analogRead(A0), 0, 1023, 0, 127);
  // lcd.setContrast(level);

  delay(200);
  counter++;
}


/* EOF - HelloWorld.ino */

>>>>

Bingo !!! If everything is set up correctly, you will see the result like below:-

But where you are going, we are not finished yet. This will be a series of tutorial, where we will be continuing on LCD with exciting features like displaying image, animation etc. So, don’t go anywhere, in the meantime, make your own working LCD interface, upload it anywhere on the internet. Then post your project link and valuable opinion in the comment box. Check out our other tutorials. I am going to write to you very soon. See you next time.

Previous ArticleNext Article

This post has 2 Comments

2

Leave a Reply

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