{"id":18467,"date":"2018-03-11T18:00:09","date_gmt":"2018-03-11T17:00:09","guid":{"rendered":"http:\/\/www.recantha.co.uk\/blog\/?p=18467"},"modified":"2018-03-11T06:40:34","modified_gmt":"2018-03-11T05:40:34","slug":"getting-an-hd44780-16x2-lcd-working-on-the-raspberry-pi-a-tutorial","status":"publish","type":"post","link":"https:\/\/www.recantha.co.uk\/blog\/?p=18467","title":{"rendered":"Getting an HD44780 16&#215;2 LCD working on the Raspberry Pi &#8211; a tutorial"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18473\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=560%2C274&#038;ssl=1\" alt=\"\" width=\"560\" height=\"274\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?w=1800&amp;ssl=1 1800w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=768%2C376&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=1024%2C501&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=560%2C274&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=260%2C127&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?resize=160%2C78&amp;ssl=1 160w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?w=1120&amp;ssl=1 1120w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?w=1680&amp;ssl=1 1680w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>This post is all about\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Hitachi_HD44780_LCD_controller\" target=\"_blank\" rel=\"noopener\">HD44780 LCD<\/a> screens and how to use them in your projects.<\/p>\n<p>I&#8217;ve recently been thinking about what my next project will be. I&#8217;ve previously experimented with handheld enclosures such as these ones:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18475\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?resize=560%2C201&#038;ssl=1\" alt=\"\" width=\"560\" height=\"201\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?w=640&amp;ssl=1 640w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?resize=300%2C108&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?resize=560%2C201&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?resize=260%2C93&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/soft-side-enclosures.jpg?resize=160%2C58&amp;ssl=1 160w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>and I wanted to do another handheld device. So, I took a look around and found <a href=\"https:\/\/www.rapidonline.com\/catalogue\/search?Query=sloped%20enclosure&amp;Tier=Hand-Held%20Enclosures\" target=\"_blank\" rel=\"noopener\">these ones on the Rapid Electronics website<\/a>:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18476\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?resize=560%2C399&#038;ssl=1\" alt=\"\" width=\"560\" height=\"399\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?resize=300%2C214&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?resize=560%2C399&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?resize=260%2C185&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/sloped_handheld.jpg?resize=160%2C114&amp;ssl=1 160w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>I thought to myself: that gap in the sloped part looks about the right size for a 16&#215;2 LCD display. These LCDs are quite inexpensive, so I had a look on eBay and found <a href=\"https:\/\/www.ebay.co.uk\/itm\/262983388221\" target=\"_blank\" rel=\"noopener\">these ones<\/a>\u00a0for about \u00a35 which are HD44780-type. In particular, they offer an option with an I2C backpack\u00a0driven by a\u00a0PCF8574 chip. I like <a href=\"https:\/\/en.wikipedia.org\/wiki\/I%C2%B2C\" target=\"_blank\" rel=\"noopener\">I2C<\/a>\u00a0&#8211; it allows you to use many devices on a single &#8216;bus&#8217; which, in I2C&#8217;s case, amounts to 4 wires &#8211; one for power, one for ground and two for SDA and SCL, which of course the Raspberry Pi has as you can <a href=\"https:\/\/pinout.xyz\/pinout\/i2c\" target=\"_blank\" rel=\"noopener\">see in this diagram on pinout.xyz<\/a>. Here&#8217;s a picture of the reverse of the LCD with the I2C backpack showing:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18472\" src=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=560%2C223&#038;ssl=1\" alt=\"\" width=\"560\" height=\"223\" srcset=\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?w=1800&amp;ssl=1 1800w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=300%2C120&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=768%2C306&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=1024%2C408&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=560%2C223&amp;ssl=1 560w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=260%2C104&amp;ssl=1 260w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?resize=160%2C64&amp;ssl=1 160w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?w=1120&amp;ssl=1 1120w, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_back_sm.jpg?w=1680&amp;ssl=1 1680w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><\/p>\n<p>I attached the LCD to the Pi using jumper cables, making sure to get SDA and SCL connected the correct way round (SDA to SDA, SCL to SCL). To start with, I connected the power line to 3v3 but this had the effect of making text come out in black on a blue background. Fortunately, I realised and swapped it over to the 5V line which resulted in the text displaying nice and bright in white (see the picture at the top of the screen).<\/p>\n<p>I then looked around for the software to drive the LCD. I knew that previously I&#8217;d used an Adafruit library (and before that, I used the smbus library, which is even more complicated). Fortunately, I came across\u00a0a library written by <a href=\"https:\/\/blog.dbrgn.ch\/about\/\" target=\"_blank\" rel=\"noopener\">Danilo Bargen<\/a>\u00a0called <a href=\"https:\/\/pypi.python.org\/pypi\/RPLCD\/\" target=\"_blank\" rel=\"noopener\">RPLCD<\/a>.<\/p>\n<p>Using this library is very easy. You can see the library source code on the\u00a0<a href=\"https:\/\/github.com\/dbrgn\/RPLCD\" target=\"_blank\" rel=\"noopener\">GitHub repository<\/a> and read all about how to use it at\u00a0<a href=\"http:\/\/rplcd.readthedocs.io\/\" target=\"_blank\" rel=\"noopener\">ReadTheDocs<\/a>.<\/p>\n<p>To install it, do the following to get RPLCD and also install the I2C base library. You will also need to go into Preferences-&gt;Raspberry Pi Configuration and make sure I2C is turned on (and reboot).<\/p>\n<pre>sudo pip3 install RPLCD\r\nsudo apt-get install python-smbus<\/pre>\n<p>Next, run the following command to find out the\u00a0I2C address of the LCD (mine was 0x3F, which comes in useful later).<\/p>\n<pre>i2cdetect -y 1<\/pre>\n<p>For me, the pip install placed a test file in the home folder. However, if it doesn&#8217;t do this, run the following command:<\/p>\n<pre>wget\u00a0https:\/\/raw.githubusercontent.com\/dbrgn\/RPLCD\/master\/lcdtest.py &gt; \/home\/pi\/lcdtest.py<\/pre>\n<p>Then run the test script by specifying all the required options. These may be different for you, depending on which I2C or other controller you have working for you.<\/p>\n<pre>cd ~\r\npython3 lcdtest.py i2c testsuite expander=PCF8574 cols=16 rows=2 addr=0x3f<\/pre>\n<p>For a test script with all the parameters set in the Python file itself, and with the LCD initialised, clone <a href=\"https:\/\/github.com\/recantha\/HD44780_with_I2C_RPLCD\" target=\"_blank\" rel=\"noopener\">my repository<\/a>:<\/p>\n<pre><span style=\"letter-spacing: 0.05em;\">git clone\u00a0https:\/\/github.com\/recantha\/HD44780_with_I2C_RPLCD<\/span><\/pre>\n<p>and run the test.py script:<\/p>\n<pre>python3 test.py<\/pre>\n<p>This test script does a few things:<\/p>\n<ol>\n<li>Import the necessary libraries.<\/li>\n<li>Initialise the LCD.<\/li>\n<li>Print Hello World to the screen.<\/li>\n<li>Wait 5 seconds.<\/li>\n<li>Clear the screen and power off the backlight.<\/li>\n<\/ol>\n<p>These are great, cheap screens if all you want to do is display some data or text to the user. I used it on my <a href=\"https:\/\/www.recantha.co.uk\/blog\/?p=2663\" target=\"_blank\" rel=\"noopener\">Picorder<\/a>\u00a0way back when and, in my new project (which, yes, is probably going to be another Picorder, but new-and-improved) it will be displaying data from sensors once again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is all about\u00a0HD44780 LCD screens and how to use them in your projects. I&#8217;ve recently been thinking about what my next project will be. I&#8217;ve previously experimented with handheld enclosures such as these ones: and I wanted to&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":18473,"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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[54,50,51],"tags":[668,667],"class_list":["post-18467","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-accessories","category-making","category-tutorials","tag-hd44780","tag-lcd"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod\" \/>\n<meta property=\"og:description\" content=\"This post is all about\u00a0HD44780 LCD screens and how to use them in your projects. I&#8217;ve recently been thinking about what my next project will be. I&#8217;ve previously experimented with handheld enclosures such as these ones: and I wanted to&hellip;Read more &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\" \/>\n<meta property=\"og:site_name\" content=\"Raspberry Pi Pod\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/recantha\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-11T17:00:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i2.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"881\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Horne\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@recantha\" \/>\n<meta name=\"twitter:site\" content=\"@recantha\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Horne\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\"},\"author\":{\"name\":\"Michael Horne\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\"},\"headline\":\"Getting an HD44780 16&#215;2 LCD working on the Raspberry Pi &#8211; a tutorial\",\"datePublished\":\"2018-03-11T17:00:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\"},\"wordCount\":591,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1\",\"keywords\":[\"HD44780\",\"lcd\"],\"articleSection\":[\"Accessories\",\"Making\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\",\"name\":\"Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod\",\"isPartOf\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1\",\"datePublished\":\"2018-03-11T17:00:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.recantha.co.uk\/blog\/?p=18467\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1\",\"width\":1800,\"height\":881},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/?p=18467#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.recantha.co.uk\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting an HD44780 16&#215;2 LCD working on the Raspberry Pi &#8211; a tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#website\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"name\":\"Raspberry Pi Pod\",\"description\":\"Experiences with the Raspberry Pi micro computer and microcontroller\",\"publisher\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#organization\",\"name\":\"Raspberry Pi Pod\",\"url\":\"https:\/\/www.recantha.co.uk\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1\",\"width\":800,\"height\":337,\"caption\":\"Raspberry Pi Pod\"},\"image\":{\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/recantha\/\",\"https:\/\/x.com\/recantha\",\"https:\/\/www.linkedin.com\/in\/recantha\/\",\"https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263\",\"name\":\"Michael Horne\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g\",\"caption\":\"Michael Horne\"},\"url\":\"https:\/\/www.recantha.co.uk\/blog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod","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:\/\/www.recantha.co.uk\/blog\/?p=18467","og_locale":"en_US","og_type":"article","og_title":"Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod","og_description":"This post is all about\u00a0HD44780 LCD screens and how to use them in your projects. I&#8217;ve recently been thinking about what my next project will be. I&#8217;ve previously experimented with handheld enclosures such as these ones: and I wanted to&hellip;Read more &rarr;","og_url":"https:\/\/www.recantha.co.uk\/blog\/?p=18467","og_site_name":"Raspberry Pi Pod","article_publisher":"https:\/\/www.facebook.com\/recantha\/","article_published_time":"2018-03-11T17:00:09+00:00","og_image":[{"width":1800,"height":881,"url":"https:\/\/i2.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","type":"image\/jpeg"}],"author":"Michael Horne","twitter_card":"summary_large_image","twitter_creator":"@recantha","twitter_site":"@recantha","twitter_misc":{"Written by":"Michael Horne","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#article","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467"},"author":{"name":"Michael Horne","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263"},"headline":"Getting an HD44780 16&#215;2 LCD working on the Raspberry Pi &#8211; a tutorial","datePublished":"2018-03-11T17:00:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467"},"wordCount":591,"commentCount":7,"publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","keywords":["HD44780","lcd"],"articleSection":["Accessories","Making","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.recantha.co.uk\/blog\/?p=18467#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467","url":"https:\/\/www.recantha.co.uk\/blog\/?p=18467","name":"Getting an HD44780 16x2 LCD working on the Raspberry Pi - a tutorial - Raspberry Pi Pod","isPartOf":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","datePublished":"2018-03-11T17:00:09+00:00","breadcrumb":{"@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.recantha.co.uk\/blog\/?p=18467"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#primaryimage","url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","width":1800,"height":881},{"@type":"BreadcrumbList","@id":"https:\/\/www.recantha.co.uk\/blog\/?p=18467#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.recantha.co.uk\/blog"},{"@type":"ListItem","position":2,"name":"Getting an HD44780 16&#215;2 LCD working on the Raspberry Pi &#8211; a tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.recantha.co.uk\/blog\/#website","url":"https:\/\/www.recantha.co.uk\/blog\/","name":"Raspberry Pi Pod","description":"Experiences with the Raspberry Pi micro computer and microcontroller","publisher":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.recantha.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.recantha.co.uk\/blog\/#organization","name":"Raspberry Pi Pod","url":"https:\/\/www.recantha.co.uk\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2016\/03\/cropped-PiPod-Logo-v3.png?fit=800%2C337&ssl=1","width":800,"height":337,"caption":"Raspberry Pi Pod"},"image":{"@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/recantha\/","https:\/\/x.com\/recantha","https:\/\/www.linkedin.com\/in\/recantha\/","https:\/\/www.youtube.com\/channel\/UCK4F9blabxzmk8Inzhs8tpg"]},{"@type":"Person","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/c27c4ef2ee1c18b130f1fcd5dcdbb263","name":"Michael Horne","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.recantha.co.uk\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/479778b0677caadde0ceb54c4129804ef674914607e3ed0998808148357d10d8?s=96&d=mm&r=g","caption":"Michael Horne"},"url":"https:\/\/www.recantha.co.uk\/blog\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/16x2_front_sm.jpg?fit=1800%2C881&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2RsaV-4NR","jetpack-related-posts":[{"id":10829,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=10829","url_meta":{"origin":18467,"position":0},"title":"New LCD board Kickstarter for the Raspberry Pi","author":"Michael Horne","date":"22 August 2014","format":false,"excerpt":"Paul Brown, who invented the MyPiFi board a few months ago and successfully funded it through Kickstarter, has come out with his second board. This time, it's for using LCD screens. You can see the board in action below: It's a very quick, easy and cheap way to get started\u2026","rel":"","context":"In &quot;Crowdfunding&quot;","block_context":{"text":"Crowdfunding","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=13"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/lh4.googleusercontent.com\/-selaItMaqPQ\/U_XYzPDqXsI\/AAAAAAAABhI\/Fq9RRZIuSNQ\/s640\/blogger-image-1248424349.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":13373,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=13373","url_meta":{"origin":18467,"position":1},"title":"New Kickstarter enables LCD displays to stand up and be counted on a Raspberry Pi","author":"Michael Horne","date":"13 September 2015","format":false,"excerpt":"David Saul, who previously had success with his PiMuxClock Kickstarter has launched a new crowdfunding campaign. This one enables you to mount a little LCD screen vertically on your Pi's GPIO pins. It works with\u00a0HD44780-compatible LCDs, including the newer RGB-backlight ones. It's an interesting concept - the vertical mounting certainly\u2026","rel":"","context":"In &quot;Crowdfunding&quot;","block_context":{"text":"Crowdfunding","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=13"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/ksr-ugc.imgix.net\/projects\/2042748\/photo-original.JPG?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/ksr-ugc.imgix.net\/projects\/2042748\/photo-original.JPG?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/ksr-ugc.imgix.net\/projects\/2042748\/photo-original.JPG?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/ksr-ugc.imgix.net\/projects\/2042748\/photo-original.JPG?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":13523,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=13523","url_meta":{"origin":18467,"position":2},"title":"When&#8217;s the next bus? with a Raspberry Pi","author":"Michael Horne","date":"9 October 2015","format":false,"excerpt":"Ismail Uddin has published a nice little tutorial on Science Exposure. In it, he uses a 16x2 HD44780 LCD screen and some Python to produce a next-bus tracking system. He's uploaded the Python script to GitHub for easy download. Nice little project requiring quite a lot of wiring! Read it\u2026","rel":"","context":"In &quot;Internet of things&quot;","block_context":{"text":"Internet of things","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=26"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.scienceexposure.com\/wp-content\/uploads\/2015\/10\/ftrd-img-1024x570.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.scienceexposure.com\/wp-content\/uploads\/2015\/10\/ftrd-img-1024x570.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.scienceexposure.com\/wp-content\/uploads\/2015\/10\/ftrd-img-1024x570.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.scienceexposure.com\/wp-content\/uploads\/2015\/10\/ftrd-img-1024x570.jpg?resize=700%2C400 2x"},"classes":[]},{"id":2663,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=2663","url_meta":{"origin":18467,"position":3},"title":"The RaspberryPi Tricorder &#8211; the Picorder","author":"Michael Horne","date":"6 March 2013","format":false,"excerpt":"This project has been in progress since I first received my Raspberry Pi last July. Until now, I just haven't had the time to record video. The Picorder is a Pi\/Arduino combination taking readings from 2 temperature sensors, a hall-effect magnetism sensor and an ultrasonic distance sensor which it then\u2026","rel":"","context":"In &quot;Arduino&quot;","block_context":{"text":"Arduino","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=55"},"img":{"alt_text":"SAMSUNG","src":"\/blog\/wp-content\/uploads\/2013\/03\/060320131-300x225.jpg","width":350,"height":200},"classes":[]},{"id":18646,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=18646","url_meta":{"origin":18467,"position":4},"title":"palmPi &#8211; (yet another) handheld Raspberry Pi device","author":"Michael Horne","date":"26 March 2018","format":false,"excerpt":"I recently posted a tutorial on using an HD44780 LCD (with I2C backpack) with the Raspberry Pi. I mentioned at the time that I had also been looking at small enclosures for the Pi in the hope of making something. Well, in a few hours of spare time I had\u2026","rel":"","context":"In &quot;Accessories&quot;","block_context":{"text":"Accessories","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=54"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/palmPi-whole.jpg?fit=1024%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/palmPi-whole.jpg?fit=1024%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/palmPi-whole.jpg?fit=1024%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/palmPi-whole.jpg?fit=1024%2C1200&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":18463,"url":"https:\/\/www.recantha.co.uk\/blog\/?p=18463","url_meta":{"origin":18467,"position":5},"title":"Working with an SSD1306 0.96&#8243; OLED display on the Raspberry Pi","author":"Michael Horne","date":"12 March 2018","format":false,"excerpt":"I'm always on the lookout for cheap electronics on eBay and AliExpress. Following on from my previous tutorial on HD44780 screens, this time, I found a small OLED display. I bought one of these\u00a0from eBay for less than \u00a35 plus postage. It is a 0.96\", 128x64 pixel OLED display. These\u2026","rel":"","context":"In &quot;Accessories&quot;","block_context":{"text":"Accessories","link":"https:\/\/www.recantha.co.uk\/blog\/?cat=54"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/oled_demo_sm.jpg?fit=1200%2C809&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/oled_demo_sm.jpg?fit=1200%2C809&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/oled_demo_sm.jpg?fit=1200%2C809&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/oled_demo_sm.jpg?fit=1200%2C809&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.recantha.co.uk\/blog\/wp-content\/uploads\/2018\/03\/oled_demo_sm.jpg?fit=1200%2C809&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/18467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18467"}],"version-history":[{"count":4,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/18467\/revisions"}],"predecessor-version":[{"id":18477,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/18467\/revisions\/18477"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/media\/18473"}],"wp:attachment":[{"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.recantha.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}