84 48 lcd module arduino free sample

In the previous tutorial I showed how to build a weather station using DHT11 and BMP180 with an Arduino. However, the project has a downside which is the power consumption of the 16X2 LCD. If we were building a battery powered project with the desire to last for several weeks and probably several months, like a weather station for instance, then we’ll have to replace the LCD keypad shield from the previous tutorials and go for something like the low powered Nokia 5110 84×84 LCD display. In this tutorial I will be showing you how to drive this display with the Arduino and thus build projects with longer battery life.

Since we are just going to drive the display we won’t be needing sensors for this tutorial, however we will need the components listed below which include the Nokia 5110 itself and we will show how to drive the display using an Arduino board.

The Nokia 5110 display is basically a graphic LCD display useful for a lot of applications. It was intended originally to be used as a screen for cell phones and was used in lots of mobile phones during the 90’s. This display uses a low powered CMOS LCD controller/driver PCD8544, which drives the graphic display of size 84×48. It is very cheap and costs about 3$. You can get one here.

The Nokia 5110 LCD can display text, graphics as well as bitmaps. When this display is fully lit, it draws about 10mA but with the backlight off, it draws as low as 0.4mA. The power consumed by this display is very low compared to that of the keypad LCD shield used in the previous tutorial. I will be using the Arduino Mega for this tutorial as usual and you can buy one here. You can also buy jumpers, breadboards and power bank which you will be needing for this tutorial.

Before we start writing the code for this project, first we need to download the 5110 LCD graph library that was made by rinky-dink electronics. The library does most of the heavy lifting and makes it easy for us o use the LCD. Click here to visit the download page and then download the LCD5110_graph zip file. When done, unzip the file to your preferred location and then rename the unzipped folder to something simple like “LCD5110”. Copy and paste this folder in your arduino library folder, then run your arduino IDE.

Click on the file, then on examples and then click on LCD5110. Since we are using the Arduino Mega, under the LCD5110 drop down click on Arduino (AVR) and the open up the LCD graph demo file.

In the code we only have to change a few things. we can see from the comment section above that the RST pin of the display was connected to pin 11 but in our case we connected this pin to pin 12 of the Arduino Mega. We also have to change the CS from pin 12 to 11.

The first line after the comment section, the LCD5110 library was included and after that a myGLCD object was created with the numbers being the pins to which the LCD is connected. The last two values in the myGLCD object is the RST and CS values which has been changed as explained initially.

with this done, we move to the setup function. In the setup function, the InitLCD method is used to initialize the display and this method takes in a parameter for the display contrast. The contrast value is between 0-127 and since we didn’t pass in any value the default value which is 70 will be used. Next, the setFont method is called which sets smallFont as the display font style is called and lastly, the randomSeed function which is used to initialize the random number generator using analogRead on an unconnected pin as a random input.

In the loop function, on the first line the screen buffer is cleared using the clrScr method. The drawBitmap method was used to draw the arduino logo and this logo is placed in the screen buffer when the method is called. The update method is used to copy the screen buffer to the screen then we give it a delay of 2 seconds before clearing the screen buffer again.

Most of the functions used in the project have names that are self-explanatory like myGLCD.drawLine needs no explanation for instance as its clear the function draws a line.

Here is the full code for this project. Its an example from the Library named LCD5110_Graph_Demo and how to get to it has been described at the beginning of this section.

84 48 lcd module arduino free sample

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

Below is a snippet of the example LCD control code. This small novella of a sketch shows off an array of graphics driver functions, character drawing tools, and other useful functions to help you get started using the LCD. You will need to include the LCD_Functions.h header in the same directory as the sketch folder from the download. Otherwise, your code will not compile when uploading to Arduino.

Heads up! If the display is not showing pixels even with the correct logic levels and example code, it may just have slight variances in the way that they were manufactured. You can see the pixels faintly on the screen at an angle or pushing down on the LCD. You will need to try and set the contrast where it says setContrast(40) on line 87 to a value of 60. There is probably some variances in the LCD’s contrast which might explain why certain LCDs have issues displaying defined pixels on the screen.

Once uploaded to your Arduino, the sketch will begin by running the demo -- a set of basic animations and graphics functions. To begin, we"ll draw some random pixels on the screen ("It"s full of stars..."). Then we"ll move on to examples of drawing lines, rectangles, and circles. Throughout there are examples of drawing characters and strings. Finally the demo closes out with an homage to a monochrome comic which seems a perfect fit for this little monochrome LCD.

After the demo runs its course, the sketch will enter into a serial echo mode. Open the serial monitor (set the baud rate to 9600 bps), and type stuff over to the Arduino. It should start printing everything you send it onto the LCD.

If you"re intrigued by the possibilities of drawing bitmaps on the screen, check out the next page! We"ll show you how to import your own 84x48 bitmap and draw it on the screen.

84 48 lcd module arduino free sample

This post aims to be a complete guide for Nokia 5110 LCD with Arduino. I’ll explain what it does, show its specs and share an Arduino project example that you can take and apply to your own projects.

The Nokia 5110 LCD is very popular among the Arduino tinkerers. These modules are used on wide variety of applications that require some sort of interface or display data to the user.

The Nokia 5110 LCD operates at 3.3V. So you can’t connect the Arduino Uno digital pins directly. Read this blog post to learn how you can level shift the signals from 5V to 3.3V.

84 48 lcd module arduino free sample

10.5US $ |Arduino 5110 Free Shipping Smart Electronics LCD Module Display 84X48 84x84 LCD Module Red backlight adapter PCB for Nokia 5110|pcb adapter|pcb for arduinopcb module - AliExpress

84 48 lcd module arduino free sample

84×48 pixel graphic LCD (Nokia 5110) for Arduino, Raspberry and Co., incl. header. A very easy-to-use LCD screen, with 84 x 48 pixel resolution. These displays debuted in the Nokia 5110 cell phone, well known for their high contrast and bright backlight. These small screens are incredibly popular again, because of their easy programming and low price.

84 48 lcd module arduino free sample

In this project, I will show you how to interface a 128X64 Graphical LCD with Arduino UNO. This particular LCD Module is based ST7920 LCD Controller. So, we will first see a little bit about the Graphical LCD Module and its LCD Controller ST7920.

In the previous Arduino project, I have interfaced a Nokia 5110 LCD Module with Arduino. It is also a graphical LCD which can display some basic bitmap images and graphics. But the issue with Nokia 5110 LCD Module is its resolution.

At 84 x 48 pixels, the Nokia 5110 LCD can be used for implementing a menu-based user interface. Due to its small size, the resulting menu will be limited to 3 or 4 items per page.

If we want a bigger display with more real estate to work with, then the obvious choice is to go for the bigger and better 128×64 Graphical LCD Module.

As a demonstration, after making all the hardware connections, I will display a bitmap image on the Graphical LCD Module. If you are interested in implementing a simple 16×2 Alpha-Numeric LCD with Arduino, then check out this tutorial.

At first glance, the 128×64 Graphical LCD Module seems like a bigger brother to the famous 16×2 LCD or 20×4 LCD Modules, with their similar construction and almost similar pin layout.

But there is a significant difference between those two. 16×2 or 20×4 LCDs are essentially character displays. They can only display alpha-numeric characters and some simple custom characters that are confined to a 5×8 matrix.

By using different combinations of pixels, we can basically display characters of various sizes. But the magic doesn’t end there. You can display images and graphics (small animations) as well. In a 128×64 LCD Module, there are 64 rows and 128 columns.

There are several versions of the Graphical LCD in the market. Even though the usage, application and implementations are almost identical, the main difference lies in the internal LCD Controller used to drive the dot matrix display.

Some of the commonly used LCD Controllers are KS0108, SSD1306, ST7920, SH1106, SSD1322, etc. The pin out of the final LCD Module might vary depending on the LCD Controller used. So, please verify the LCD Controller as well as the pin out before making a purchase.

The Graphical LCD Module I purchased consists of ST7920 Controller. It is manufactured by Sitronix and supports three types of bus interfaces i.e., 8-bit mode, 4-bit mode and Serial interface.

If you have used 16×2 LCD Display earlier, then you might be familiar with both 4-bit as well as 8-bit parallel interfaces. The serial interface is something new and we will explore this option in this project.

As I already mentioned, double-check with the manufacturer about the pinout of the Graphical LCD Module. The following table describes the pinout of the 128×64 LCD Module that I have.

Now that we have seen a little bit about the Graphical LCD and its controller ST7920, let us now proceed with interfacing the 128×64 Graphical LCD with Arduino. I will implement a simple circuit to demonstrate how easy it is to interface the LCD and Arduino using very few external components.

So, connect the RS, RW and E of the LCD to Digital IO pins 10, 11 and 13 of Arduino UNO. Also, in order to select the Serial Interface Mode, the PCB pin must be connected to GND.

The remaining connections are similar to a traditional 16×2 LCD. VCC and GND are connected to 5V and ground of the power supply. VO is connected to the wiper of a 10KΩ POT while the other two terminals of the POT are connected to 5V and GND respectively.

I have used the above “The Office” logo. Remember that the resolution of the 128×64 LCD is, well 128×64 pixels. So, the maximum image size should be 128×64. So, using Microsoft Paint, I have brought down the resolution of the above image to 128×64 pixels and also saved it as Monochrome Bitmap Image.

Before writing the code, you need to download a special library called “U8g2”. In the Arduino IDE, go to Tools -> Manage Libraries… Search for “u8g2” and install the latest version. It is a complex library and its github page consists of all the necessary documentation.

A simple project for interfacing the 128×64 Graphical LCD with Arduino is implemented here. Instead of displaying plain characters, I have displayed a bitmap image on the LCD to show its capability.

84 48 lcd module arduino free sample

It uses the PCD8544 controller, which is the same used in the Nokia 3310 LCD. The PCD8544 is a low power CMOS LCD controller/driver, designed to drive a graphic display of 48 rows and 84 columns. All necessary functions for the display are provided in a single chip, including on-chip generation of LCD supply and bias voltages, resulting in a minimum of external components and low power consumption. The PCD8544 interfaces to microcontrollers through a serial bus interface.

84 48 lcd module arduino free sample

This tutorial on "How to use a NOKIA 5110 LCD screen" is different from the all the tutorial that are available online because I"m not going to use any library in this tutorial(No worries!! it"s pretty easy,which i figured out after trying without libraries). I"m not using any libraries just because it makes it easy to understand how the LCD screen works. I mean what block of code(or a command, u"ll know in the upcoming steps) does. It makes it easy to control the graphics on the LCD screen. I"m going to write another tutorial after this tutorial on how to play "SNAKE GAME" using this NOKIA 5110 LCD screen.

The NOKIA 5110 LCD screen has a resolution of 84x48(or 48x84, however you read it) i.e. the screen has pixels arranged in 84 rows and 48 columns making a total of 4032 pixels (84*48=4032). So, since a NOKIA 5110 LCD screen is called a "Graphical LCD screen", one has access to all the pixels, i mean, access to control each and every pixel individually(you know what I mean) unlike some of the LCD screens which are named as "Alphanumeric LCD Displays" where one can access a block of pixels, generally 7x5 and place only a single alphabet or a number in that block of 7x5. If you have already worked with some alphanumeric LCD screens earlier(without any libraries), you are half-way done. In case, you haven"t worked with one earlier, no probs. I"ll let you know every possible detail I know.

So, as said earlier, the above image shows the arrangement of pixels in 48 rows and 84 columns( or vice-versa). Just like how each block in a alphanumeric LCD screens is addressed by a unique 8-bit code, every 8 pixels in the NOKIA 5110 LCD screen are assigned with a unique 8-bit address. So, let me explain about this 8 pixels grouping in the NOKIA 5110 LCD screen. Every 8 pixels vertically is grouped, as shown above and let"s call it a block(different from the alphanumeric LCD screen"s block). So, each block has a unique address to access it.

Some NOKIA 5110 LCD screens operate at 3.3V as Vcc while some can work with both 5V and 3.3V. Mine is a 5V version which works even when plugged to 3.3V.

NOKIA 5110 LCD screen uses SPI protocol as one can find a DIN pin which can also be call as MOSI(Master-Out Slave-In). So, all we gonna do is just pass commands with a couple of 8-bit data through the DIN pin while using the other pins(like DC, CE and CLK pins) simultaneously and appropriately.

This is the total code which displays two rectangular boxes on the LCD screen as shown below. If you are having trouble getting the output, feel free to ping me or comment down below.

This line means that when ever i type "LCD_CE" anywhere in my code, it gets replace with "7", which is the pin of arduino to which I"ve connected the CE pin of LCD screen. And similarly, all the other pins. I"ve also declared LCD_C and LCD_D which I"ll explain in the upcoming steps.

The elements in this array are the one which decide the graphics that are displayed on the LCD screen. As I"ve said earlier, every 8 bits on the LCD screen are grouped together, every element in this array are 8-bit(2-digits in hexadecimal). Suppose, let us consider the first element of the element as 0xF0. 0xF0 in hexadecimal is equivalent to 0b11110000 in binary. So, when the 0xF0 is sent to the LCD screen(i"ll discuss about it in the next step), the first four pixels in the first group of 8-vertically grouped pixels(as discussed in STEP-1) are made dark(black) as the first four bits in the input data are "1" and similarly, the remaining 4-bits are not darkened as they are "0".

As I said earlier, the NOKIA 5110 LCD screen can be communicated with SPI or through the MOSI pin i.e. DIN pin on the LCD screen. So, we need to send 8-bit commands or data to work with the display. The commands are so simple. One need not prefer to remember them if you can refer to datasheet of NOKIA 5110 LCD screen when ever needed. I"ve included a page of the data sheet in the next step.

So, as mentioned in the datasheet, before sending the data or command to the LCD screen, we need to make the CE(chip enable) pin low and make it high again after sending the command.(Basically, CE pin is an active low pin. So, make it low to use the LCD screen). also, we need to make the DC(data/command) pin low for command and high for data.

The LCD_Write command takes in two parameters, 1. Data/Command and 2. 8-bit data. Depending on the Data/Command, the DC pin is made low or high for command or data respectively. shiftOut() is a function available in SPI.h but is also included by default and so we need not include the SPI.h library seperately.

First, setting up the CE, RESET, DC, DIN, CLK as outputs, we continue to reset the LCD screen just to make sure all the garbage values in the pixels are cleared. Next we send some commands, which set-up the LCD screen. You can have a look at all the commands in the data sheet.

After initialization, ofcouse, we need to execute this LCD_Initialise() function in the setup() function of the arduino. Also need to setup serial communication using Serial.begin(9600) where 9600 is the baud rate. After that, we are ready to go to display the graphics on LCD screen.void LCD_Initialise(void){

So, we know how to initialize the LCD screen, we know how to communicate with the LCD screen, we know how the LCD screen works, but we don"t know how to display the graphics of our owe choice. To do that, we need to know how to convert any image into bitmap. The image must be in "BLACK AND WHITE", if not conver it into B&W using some software.

Generally, I use GIMP and LCDAssistant(and paint.net) softwares. Again, try getting Google"s help in knowing how to use GIMP to convert a B&W image to Gray scale and I"m going to tell you about LCD Assistant and paint.net.

This software is used to draw any image which you want to display on the LCD screen. Sounds cool, isn"t it?? For example, you can display your name in your handwriting or some cool stuff. Again, go to Google and find a video which can help you with until I post a video.

Now, you are ready to use a NOKIA 5110 LCD screen.Do comment bellow if you have any doubts.Do comment bellow if I"ve gone wrong somewhere.Do comment bellow your experience, if you have done one.

Great article - doing it with an Arduino first helped me a lot to set up the code for a PIC microcontroller using hardware SPI (which can be very nasty!) with 2MHz. For me the key was first to implement the shiftOut-function as you did in your article to make the display work - then I switched over to hardware SPI. One of my mistakes was to choose a wrong value for Vop (which was too small) and the wrong SPI mode (CKE=1 - CKP=0 is correct).0

If you want to run one of these screens with a really low memory footprint, you can store the fonts in the Arduinos internal eeprom. Since the screens are pretty slow, the performance difference is not even noticeable with a minor code change. Saves ~500 bytes of ram:

In file included from c:\users\blind\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\stdlib.h:11:0,

c:\users\blind\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\string.h:55:8: error: previous declaration of "char* index(const char*, int)"

I"m working on the LCD screen. I"m already working on some games that can be played with this LCD screen. Will surely try to do it and put it up here.

84 48 lcd module arduino free sample

Wiring: The Nokia LCD uses a serial interface for displaying images and text. This interface works very well with the SPI interface on the Teensy 2.0. Please be aware that the Teensy 2.0 is by default a 5V system while the Nokia module is 3.3V. You can either modify the Teensy to be 3.3V via the information below or insert a logic level shifting circuit in between the line. In this example we have already modified the Teensy to be 3.3V

After wiring the unit, you can download the C example code below. This code is tested to compile via avr-gcc under Windows and Linux. You may need to install the avr-gcc compiler prior to using these files. A pre-compiled .hex file is included for rapid use. There is a nokia5110.h and nokia5110.c file included in the example. The code initialized SPI on the Teensy 2.0 and displays a string of characters. The Nokia 5510 is a graphics LCD so to display text, the program also includes a bitmap that was used to create the font used to display text to the screen.

84 48 lcd module arduino free sample

The Philips PCD8544 driver chip is connected to a recycled screen from the very popular Nokia 5110 phone. Because the screens are second hand there are often small scratches/blemishes on the glass cover. They are rehoused in a metal box on a PCB with 8 connections. You need to solder on the supplied pins. The screen is a Liquid Crystal Display, LCD.

A more compact and cheaper arrangement is to connect the data lines with 10K Ohm protection resistors as shown below. Make sure that VCC goes to the 3.3V outlet on the Arduino UNO.

The method works but we need to find an easier method of obtaining the bytes for a screen image. I decided to use Paint.net, to create the image, and LCDAssistant to convert a bitmap file to a list of bytes.

I defined a drawing area of 84 pixels wide and 48 pixels high. I disabled Antialiasing, added a star shape and some text to make a test piece. I saved the image as a bitmap with automatic depth.

Now that the contrast has been fixed, we can see that the display has a slight aspect ratio ‘feature’ and circles appear as ellipses. The lower pixel count means that there is less space to write and draw when compared to other LCD displays – especially when compared with the SSD1306 128×64 display. However, the screen size and pixels are larger aiding visibility from a greater distance.

84 48 lcd module arduino free sample

Adding a display to your Arduino can serve many purposes. Since a common use for microcontrollers is reading data from sensors, a display allows you to see this data in real-time without needing to use the serial monitor within the Arduino IDE. It also allows you to give your projects a personal touch with text, images, or even interactivity through a touch screen.

Transparent Organic Light Emitting Diode (TOLED) is a type of LED that, as you can guess, has a transparent screen. It builds on the now common OLED screens found in smartphones and TVs, but with a transparent display, offers up some new possibilities for Arduino screens.

The liquid crystal display (LCD) is the most common display to find in DIY projects and home appliances alike. This is no surprise as they are simple to operate, low-powered, and incredibly cheap.

This type of display can vary in design. Some are larger, with more character spaces and rows; some come with a backlight. Most attach directly to the board through 8 or 12 connections to the Arduino pins, making them incompatible with boards with fewer pins available. In this instance, buy a screen with an I2C adapter, allowing control using only four pins.

The screens are capable of a large variety of preset characters which cover most use cases in a variety of languages. You can control your LCD using the Liquid Crystal Library provided by Arduino. The display() and noDisplay() methods write to the LCD, as shown in the official tutorial on the Arduino website.

These simple boards are made up of 7 LEDs (8 if you include the dot), and work much like normal LEDs with a common Anode or Cathode connection. This allows them to take one connection to V+ (or GND for common cathode) and be controlled from the pins of your Arduino. By combining these pins in code, you can create numbers and several letters, along with more abstract designs—anything you can dream up using the segments available!

These tiny LCD screens are monochrome and have a screen size of 84 x 48 pixels, but don"t let that fool you. Coming in at around $2 on AliExpress, these displays are incredibly cheap and usually come with a backlight as standard.

They connect to your Arduino using I2C, meaning that alongside the V+ and GND pins, only two further pins are required to communicate with the screen. With various sizes and full color options available, these displays are incredibly versatile.

Thin-film-transistor liquid-crystal displays (TFT LCDs) are in many ways another step up in quality when it comes to options for adding a screen to your Arduino. Available with or without touchscreen functionality, they also add the ability to load bitmap files from an on-board microSD card slot.

Arduino have an official guide for setting up their non-touchscreen TFT LCD screen. For a video tutorial teaching you the basics of setting up the touchscreen version, YouTuber educ8s.tv has you covered:

This article has covered most options available for Arduino displays, though there are definitely more weird and wonderful ways to add feedback to your DIY devices.

Now that you have an idea of what is out there, why not incorporate a screen into your DIY smart home setup? If retro gaming is more your thing, why not create some retro games on Arduino?