{"id":12476,"date":"2015-09-29T08:48:07","date_gmt":"2015-09-29T08:48:07","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=12476"},"modified":"2019-04-02T10:23:34","modified_gmt":"2019-04-02T10:23:34","slug":"complete-guide-for-nokia-5110-lcd-with-arduino","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/complete-guide-for-nokia-5110-lcd-with-arduino\/","title":{"rendered":"Complete Guide for Nokia 5110 LCD with Arduino"},"content":{"rendered":"<p>This post aims to be a complete guide for Nokia 5110 LCD with Arduino.\u00a0I\u2019ll explain what it does, show its specs\u00a0and share an Arduino project example that you can take and apply to your own projects.<!--more--><\/p>\n<p>I have more\u00a0complete guides for other popular sensors and Arduino modules, check them below:<\/p>\n<ul>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/complete-guide-for-ultrasonic-sensor-hc-sr04\/\">Complete Guide for Ultrasonic Sensor HC-SR04<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/nrf24l01-2-4ghz-rf-transceiver-module-with-arduino\/\">Complete Guide for nRF24L01 \u2013 2.4GHz RF Transceiver Module With Arduino<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/complete-guide-for-dht11dht22-humidity-and-temperature-sensor-with-arduino\/\">Complete Guide for DHT11\/DHT22 Humidity and Temperature Sensor<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/rf-433mhz-transmitter-receiver-module-with-arduino\/\">Complete Guide for RF 433MHz Transmitter\/Receiver Module<\/a><\/li>\n<li><a href=\"https:\/\/randomnerdtutorials.com\/arduino-with-pir-motion-sensor\/\">Arduino with PIR Motion Sensor<\/a><\/li>\n<\/ul>\n<h2>Description<\/h2>\n<p>The Nokia 5110 LCD is very\u00a0popular among the Arduino tinkerers. These modules are used on wide variety of applications that\u00a0require some sort of interface or display data to the user.<\/p>\n<p>These modules are very cheap and you can use them with\u00a0any microcontroller (MCU).<\/p>\n<p><strong>Specifications Nokia 5110 LCD<\/strong><\/p>\n<ul>\n<li>84*48 dot matrix LCD (shows 4 lines of characters)<\/li>\n<li>Price: $2\/$3<\/li>\n<li>Voltage:\u00a03.3V<\/li>\n<li>Module size: 45.2mm x 43.1mm<\/li>\n<li>Model: Nokia 5510<\/li>\n<li>Controller:\u00a0PCD8544<\/li>\n<\/ul>\n<h3>Where to buy?<\/h3>\n<p>You can purchase these modules from eBay for just a few dollars.\u00a0<a href=\"http:\/\/ebay.to\/1PEQ9Yx\" target=\"_blank\" rel=\"noopener noreferrer\">Click here to\u00a0see Nokia 5110 LCD for Arduino\u00a0on eBay<\/a>.<\/p>\n<div class=\"code-block code-block-2\"><a href=\"http:\/\/ebay.to\/1PEQ9Yx\" target=\"_blank\" rel=\"noopener noreferrer\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-12478\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-LCD.jpg?resize=300%2C265&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Nokia 5110 LCD\" width=\"300\" height=\"265\" \/><\/a><\/div>\n<h3>Arduino with Nokia 5110 LCD<\/h3>\n<p>You need the following components to make this example:<\/p>\n<ul>\n<li>1x Arduino (<a href=\"http:\/\/ebay.to\/1EJbhZE\" target=\"_blank\" rel=\"noopener noreferrer\">eBay<\/a>)<\/li>\n<li>1x Nokia 5110 LCD (<a href=\"http:\/\/ebay.to\/1PEQ9Yx\" target=\"_blank\" rel=\"noopener noreferrer\">eBay<\/a>)<\/li>\n<li>1x Potenciometer<\/li>\n<li>4x 10K Ohm Resistors<\/li>\n<li>1x 1k Ohm Resistor<\/li>\n<li>1x 330 Ohm Resistor<\/li>\n<li>Breadboard\u00a0(<a href=\"http:\/\/ebay.to\/1I2mPti\" target=\"_blank\" rel=\"noopener noreferrer\">eBay<\/a>)<\/li>\n<\/ul>\n<h3>Library download<\/h3>\n<p>Here\u2019s the library\u00a0you need for this project:<\/p>\n<ol>\n<li>Download the<strong>\u00a0<a href=\"https:\/\/github.com\/carlosefr\/pcd8544\/archive\/master.zip\" target=\"_blank\" rel=\"noopener noreferrer\">PCD8544 library<\/a><\/strong><\/li>\n<li>Open your Arduino IDE<\/li>\n<li>Go to Sketch &gt; Include Library &gt; Add .ZIP Library<\/li>\n<\/ol>\n<h2>Pinout<img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter size-full wp-image-12496\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-LCD-pinout.png?resize=300%2C166&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Nokia 5110 LCD pinout\" width=\"300\" height=\"166\" \/><\/h2>\n<p>1) RST &#8211; Reset<br \/>\n2) CE\u00a0&#8211; Chip\u00a0Enable<br \/>\n3) D\/C &#8211; Data\/Command\u00a0Selection<br \/>\n4) DIN\u00a0&#8211;\u00a0Serial Input<br \/>\n5) CLK &#8211; Clock Input<br \/>\n6) VCC &#8211; 3.3V<br \/>\n7) LIGHT\u00a0&#8211; Backlight Control<br \/>\n8) GND\u00a0&#8211; Ground<\/p>\n<h2>Schematics<\/h2>\n<p>The Nokia 5110 LCD operates at 3.3V. So you can&#8217;t connect the Arduino Uno digital pins directly. Read this <a href=\"https:\/\/randomnerdtutorials.com\/how-to-level-shift-5v-to-3-3v\/\">blog post<\/a> to learn how you can level shift the signals from 5V to 3.3V.<\/p>\n<p>I&#8217;ll be adding some resistors in series with the data signals to protect the\u00a03.3V lines.<\/p>\n<p>Using Logic Level Converters to switch from 5V to 3.3V is the best option to interact with this LCD.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-arduino.jpg?quality=100&#038;strip=all&#038;ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"aligncenter size-full wp-image-12501\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-arduino.jpg?resize=900%2C719&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Nokia 5110 arduino\" width=\"900\" height=\"719\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-arduino.jpg?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-arduino.jpg?resize=300%2C240&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/a><\/p>\n<h2>Uploading\u00a0Sketch<\/h2>\n<p>After installing the PCD8544 library in your Arduino IDE, you can find the sketch below in File &gt; Examples &gt;\u00a0PCD8544 &gt; HelloWorld.<\/p>\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\n * PCD8544 - Interface with Philips PCD8544 (or compatible) LCDs.\n *\n * Copyright (c) 2010 Carlos Rodrigues &lt;cefrodrigues@gmail.com&gt;\n *\n * To use this sketch, connect the eight pins from your LCD like this:\n *\n * Pin 1 -&gt; +3.3V (rightmost, when facing the display head-on)\n * Pin 2 -&gt; Arduino digital pin 3\n * Pin 3 -&gt; Arduino digital pin 4\n * Pin 4 -&gt; Arduino digital pin 5\n * Pin 5 -&gt; Arduino digital pin 7\n * Pin 6 -&gt; Ground\n * Pin 7 -&gt; 10uF capacitor -&gt; Ground\n * Pin 8 -&gt; Arduino digital pin 6\n *\n * Since these LCDs are +3.3V devices, you have to add extra components to\n * connect it to the digital pins of the Arduino (not necessary if you are\n * using a 3.3V variant of the Arduino, such as Sparkfun's Arduino Pro).\n *\/\n\n#include &lt;PCD8544.h&gt;\n\n\/\/ A custom glyph (a smiley)...\nstatic const byte glyph[] = { B00010000, B00110100, B00110000, B00110100, B00010000 };\n\nstatic PCD8544 lcd;\n\nvoid setup() {\n  \/\/ PCD8544-compatible displays may have a different resolution...\n  lcd.begin(84, 48);\n\n  \/\/ Add the smiley to position &quot;0&quot; of the ASCII table...\n  lcd.createChar(0, glyph);\n}\n\n\nvoid loop() {\n  \/\/ Just to show the program is alive...\n  static int counter = 0;\n\n  \/\/ Write a piece of text on the first line...\n  lcd.setCursor(0, 0);\n  lcd.print(&quot;Hello, World!&quot;);\n\n  \/\/ Write the counter on the second line...\n  lcd.setCursor(0, 1);\n  lcd.print(counter, DEC);\n  lcd.write(' ');\n  lcd.write(0);  \/\/ write the smiley\n\n  \/\/ Use a potentiometer to set the LCD contrast...\n  \/\/ short level = map(analogRead(A0), 0, 1023, 0, 127);\n  \/\/ lcd.setContrast(level);\n\n  delay(200);\n  counter++;\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/HelloWorldPCD8544.ino\" target=\"_blank\">View raw code<\/a><\/p>\n<p><strong>Demonstration<\/strong><\/p>\n<p>After you upload the\u00a0sketch your LCD should print the words: &#8220;Hello, World!&#8221;.<\/p>\n<p>I hope you found this guide useful.<\/p>\n<p><strong>Share this post<\/strong> with a friend that also likes electronics!<\/p>\n<p>You can contact me by leaving a comment. If you like this post probably you might like my next ones, so please support me by <a href=\"https:\/\/randomnerdtutorials.com\/download\">subscribing my blog<\/a> and my Facebook Page.<\/p>\n<p>Thanks for reading,<\/p>\n<p>-Rui Santos<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post aims to be a complete guide for Nokia 5110 LCD with Arduino.\u00a0I\u2019ll explain what it does, show its specs\u00a0and share an Arduino project example that you can take &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Complete Guide for Nokia 5110 LCD with Arduino\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/complete-guide-for-nokia-5110-lcd-with-arduino\/#more-12476\" aria-label=\"Read more about Complete Guide for Nokia 5110 LCD with Arduino\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":12501,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,302,230,269,248,264,10],"tags":[],"class_list":["post-12476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-0-guide","category-guide","category-guide-project","category-lcd","category-project","category-a-tutorials"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2015\/09\/Nokia-5110-arduino.jpg?fit=900%2C719&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/12476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=12476"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/12476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/12501"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=12476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=12476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=12476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}