{"id":228,"date":"2019-10-29T09:23:56","date_gmt":"2019-10-29T09:23:56","guid":{"rendered":"https:\/\/starthardware.org\/en\/?p=228"},"modified":"2019-10-29T09:30:26","modified_gmt":"2019-10-29T09:30:26","slug":"arduino-lcd-display-this-is-how-to-make-it-work","status":"publish","type":"post","link":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/","title":{"rendered":"Arduino LCD Display \u2013 This is how to make it work"},"content":{"rendered":"\n<p>An LCD display, or liquid crystal display, is based on so-called liquid crystals, which change their polarization direction when an electrical voltage is applied. They become opaque.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Of course, the D in LCD stands for display, but people still call it LCD display and I do the same here. I hope it does not bother too much.<\/p><\/blockquote>\n\n\n\n<iframe class=\"amazon-banner-portrait-right\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/ws-na.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&#038;OneJS=1&#038;Operation=GetAdHtml&#038;MarketPlace=US&#038;source=ss&#038;ref=as_ss_li_til&#038;ad_type=product_link&#038;tracking_id=starthardware-20&#038;language=en_US&#038;marketplace=amazon&#038;region=US&#038;placement=B00HJ6AFW6&#038;asins=B00HJ6AFW6&#038;linkId=c00a9d62af65338691321a82dafee1ff&#038;show_border=true&#038;link_opens_in_new_window=true\"><\/iframe>\n\n\n\n<p>In the LCD display these liquid crystals are arranged in segments and can independently change the transparency. You can find it applied in digital wristwatches, printer displays, thermometers or in cars.<\/p>\n\n\n\n<p>There are LCD displays in different shapes and with all sorts of different segment arrangements, eg. as a pixel grid, as a seven-segment-display or as an alpha-numeric display.<\/p>\n\n\n\n<p>In the Arduino area multi-line alphanumeric LCD displays with 16 pin connector are popular. They are often based on the HD44780 chip from Hitachi and are addressed with the Arduino library <em>LiquidCrystal<\/em>. They are relatively easy to connect and easy to program.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/amzn.to\/2NkggKR\">HiLetgo 2pcs HD44780 1602 LCD Display Module<\/a>*<\/li><li><a href=\"https:\/\/amzn.to\/32VVcRt\">RioRand LCD Module for Arduino 20 x 4<\/a>*<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Arduino LCD Display Circuit<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"345\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd.jpg\" alt=\"Arduino LCD circuit\" class=\"wp-image-229\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd.jpg 728w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-300x142.jpg 300w\" sizes=\"auto, (max-width: 728px) 100vw, 728px\" \/><figcaption>Arduino Liquid Crystal Display (LCD) &#8211; circuit made with Fritzing<\/figcaption><\/figure>\n\n\n\n<p>Such an LCD display can be addressed in 4 or 8 bit mode. In 4-bit mode you need 4, in 8-bit mode 8 data cables from just as many digital pins of the Arduino board. It is connected as shown in the diagram.<\/p>\n\n\n\n<p>Depending on the type of display, there is a backlight connector and a potentiometer to control the display contrast.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LCD display program code<\/h2>\n\n\n\n<p>In the program, the library, which incidentally comes with the Arduino software, is included:<\/p>\n\n\n\n<p><code>#include &lt;LiquidCrystal.h> <\/code><\/p>\n\n\n\n<p>Now the LiquidCrystal object with the name lcd is created. The digital output pins that were used are given as parameters:<\/p>\n\n\n\n<p><code>const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;<\/code><br><code>Liquid Crystal lcd (rs, en, d4, d5, d6, d7);<\/code><\/p>\n\n\n\n<p>The display configuration is transferred in the setup. The two parameters represent the number of characters in a line and the number of lines. In this example, 16 characters and 2 lines:<\/p>\n\n\n\n<p><code>lcd.begin (16, 2);<\/code><\/p>\n\n\n\n<p>With print you can write messages on the display.<\/p>\n\n\n\n<p><code>lcd.print (\"hello, world!\");<\/code><\/p>\n\n\n\n<p>If you want to write something to a certain position, you have to move the cursor first. Here on the first character of the second line (it is counted from 0). The example outputs the current milliseconds \/ 1000. So there are seconds since turning on:<\/p>\n\n\n\n<p><code>lcd.setCursor (0, 1);<\/code><br><code>lcd.print (millis () \/ 1000);<\/code><\/p>\n\n\n\n<p>The entire code of the Arduino example (by D. Mellis and T. Igoe) found under <em>File> Samples> LiquidCrystal> HelloWorld<\/em> looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;LiquidCrystal.h>\n\nconst int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;\nLiquidCrystal lcd(rs, en, d4, d5, d6, d7);\n\nvoid setup() {\n  lcd.begin(16, 2);\n  lcd.print(\"hello, world!\");\n}\n\nvoid loop() {\n  lcd.setCursor(0, 1);\n  lcd.print(millis() \/ 1000);\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">LCD display with I2C control<\/h2>\n\n\n\n<iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/ws-na.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&#038;OneJS=1&#038;Operation=GetAdHtml&#038;MarketPlace=US&#038;source=ss&#038;ref=as_ss_li_til&#038;ad_type=product_link&#038;tracking_id=starthardware-20&#038;language=en_US&#038;marketplace=amazon&#038;region=US&#038;placement=B01DKETWO2&#038;asins=B01DKETWO2&#038;linkId=413aa1b86e29939d540dd527747ce062&#038;show_border=true&#038;link_opens_in_new_window=true\"><\/iframe>\n\n\n\n<p>There is another option to run an LCD display with even fewer pins. They have an additional controller and can be easily controlled via the I2C interface from the Arduino. (I2C is a data connection that provides control signals between various electronic components.) A look is definitely worth it.<\/p>\n\n\n\n<p><a href=\"https:\/\/amzn.to\/2plYIWP\">Link to the product with I2C interface<\/a>*<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An LCD display, or liquid crystal display, is based on so-called liquid crystals, which change their polarization direction when an electrical voltage is applied. They become opaque. Of course, the D in LCD stands for display, but people still call it LCD display and I do the same here. I hope it does not bother&hellip;&nbsp;<a href=\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Arduino LCD Display \u2013 This is how to make it work<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":230,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Arduino LCD Display \u2013 This is how to make it work<\/title>\n<meta name=\"description\" content=\"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let&#039;s go!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino LCD Display \u2013 This is how to make it work\" \/>\n<meta property=\"og:description\" content=\"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let&#039;s go!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/\" \/>\n<meta property=\"og:site_name\" content=\"StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-29T09:23:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-29T09:30:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stefan Hermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/starthardware.org\/en\/#website\",\"url\":\"https:\/\/starthardware.org\/en\/\",\"name\":\"StartHardware - Tutorials for Arduino\",\"description\":\"Arduino, Electronics, Fun\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/starthardware.org\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg\",\"contentUrl\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Arduino LCD Display\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#webpage\",\"url\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/\",\"name\":\"Arduino LCD Display \u2013 This is how to make it work\",\"isPartOf\":{\"@id\":\"https:\/\/starthardware.org\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#primaryimage\"},\"datePublished\":\"2019-10-29T09:23:56+00:00\",\"dateModified\":\"2019-10-29T09:30:26+00:00\",\"author\":{\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\"},\"description\":\"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let's go!\",\"breadcrumb\":{\"@id\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/starthardware.org\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino LCD Display \u2013 This is how to make it work\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\",\"name\":\"Stefan Hermann\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"caption\":\"Stefan Hermann\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino LCD Display \u2013 This is how to make it work","description":"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let's go!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/","og_locale":"en_US","og_type":"article","og_title":"Arduino LCD Display \u2013 This is how to make it work","og_description":"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let's go!","og_url":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/","og_site_name":"StartHardware - Tutorials for Arduino","article_published_time":"2019-10-29T09:23:56+00:00","article_modified_time":"2019-10-29T09:30:26+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stefan Hermann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/starthardware.org\/en\/#website","url":"https:\/\/starthardware.org\/en\/","name":"StartHardware - Tutorials for Arduino","description":"Arduino, Electronics, Fun","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/starthardware.org\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#primaryimage","inLanguage":"en-US","url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg","contentUrl":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2019\/10\/arduino-lcd-display.jpg","width":1200,"height":675,"caption":"Arduino LCD Display"},{"@type":"WebPage","@id":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#webpage","url":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/","name":"Arduino LCD Display \u2013 This is how to make it work","isPartOf":{"@id":"https:\/\/starthardware.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#primaryimage"},"datePublished":"2019-10-29T09:23:56+00:00","dateModified":"2019-10-29T09:30:26+00:00","author":{"@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59"},"description":"An LCD display can be easily connected to the Arduino board. Here you will find the circuit diagram and the program code. Let's go!","breadcrumb":{"@id":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/starthardware.org\/en\/arduino-lcd-display-this-is-how-to-make-it-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/starthardware.org\/en\/"},{"@type":"ListItem","position":2,"name":"Arduino LCD Display \u2013 This is how to make it work"}]},{"@type":"Person","@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59","name":"Stefan Hermann","image":{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","caption":"Stefan Hermann"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":6,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":237,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/228\/revisions\/237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media\/230"}],"wp:attachment":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}