loading

In this instructable I will show you how I connected a serial LCD 16X2 to an Arduino UNO.

There are lots of instructables and tutorials showing you how to connect a regular LCD to an Arduino but not many showing a serial LCD and on my Arduino the PINS to attach the UART pins are hidden. With this instructable I will shed some light on this issue :)

One of the reasons why you would be using a serial LCD is the fact that it uses only 4 PINS instead of 16.

The UART or serial module that is attached to the back of the LCD is responsible for sending and receiving serial communications between the Arduino and the LCD and it has a onboard potentiometer to adjust the brightness of the screen.

What you need for this project is:

  1. An Arduino UNO
  2. Serial LCD a 16X2
  3. and 4 jumper wires male to female.

Step 1: Connect the Electronics

I will use 4 colored jumper wires to make it easy.

There are 4 pins on the UART labeled GND, VCC, SDA and SCL.

Use the red wire to connect the VCC from the UART to the VCC on the Arduino

Use the black wire to connect the GND from the UART to the GND on the Arduino

Use the green Wire to connect the SDA from the UART to the SDA on the Arduino

And finally use the yellow wire to connect the SCL from the UART to the SCL on the Arduino

NOTE:

The SDA and SCL PINS on the Arduino are labeled on the back of the board, use the pictures as guidelines

This is it for wiring, it is easy. Then load the Arduino IDE and upload the sketch to the Arduino.

Step 2: The Sketch

Step one is to download the Liquid Crystal library if you haven't done so already.

I will add a zip file with the library for Windows or you can go the site https://bitbucket.org/fmalpartida/new-liquidcrysta... and download it yourself.

Once you have the library, extract the contents in the Arduino library folder on your computer. On my computer the default location was C:\programfiles\Arduino\library.

I attached a copy of the sketch I used in this instructable,

Here is the breakdown:

First you need to load the libraries, we will load wire.h, LCD.h and LiquidCrystal_I2C.h

//load libraries
#include wire.h

#include LCD.h

#include LiquidCrystal_I2C.h


Then we need to define variables... in this section just copy it as is because it tells the IDE where to find the PCF8574A and how to interact with the LCD to turn on the backlight, the read pin, the write pin and data pins etc...

//Define variables

#define I2C_ADDR 0x27 //Define I2C Address where the PCF8574A is

#define BACKLIGHT_PIN 3

#define En_pin 2

#define Rw_pin 1

#define Rs_pin 0

#define D4_pin 4

#define D5_pin 5

#define D6_pin 6

#define D7_pin 7

Another line is needed to initialize the LCD, this is done through an array which includes the variables that we defined earlier.

//Initialise the LCD
LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

In the void set up, we start by telling the IDE that we are dealing with a 16X2 LCD

lcd.begin (16,2);

Then I turn on the back light (always good to have a lit LCD), notice it is the same variable from above...

lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);

Then I tell it to go to the first line at left most position lcd.setCursor(0,0);

and print lcd.print("I just made an");

then move the cursor to the second line and the left most position lcd.setCursor(0,1);

and print: lcd.print("Instructable :)");

There is void loop because the program need a loop to compile but it should remain empty.

And that's it.... very simple, if you follow these instructions the LCD will output anything you type in this code.

There is a detailed video in the next step.

Step 3: Step by Step Video

Step 4: End Result

If you follow the steps in the instructable The LCD should print out "I made and an Instructable :)"

Happy making

<p>I made it.</p><p>First It was eror, in including &lt;wire.h&gt;. After I do browsing for a while, the problem lies on the library. Your library from the bitbucket wasn't compatible anymore with new IDE. I was using Arduino 1.8.</p><p>The solution is to use another library from: <a href="https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library/tree/e3701fb3f2398a6d18bfd94a4a7f36e065d57d77" rel="nofollow">https://github.com/fdebrabander/Arduino-LiquidCrys...</a></p><p>And it works perfectly.</p><p>Thanks for the instructables.</p>
<p>Arduino: 1.6.5 (Windows 8.1), Board: &quot;Arduino Uno&quot;</p><p>lcd_test.ino:3:17: fatal error: LCD.h: No such file or directory<br>compilation terminated.<br>Error compiling.</p><p> This is the error I get when I try this. Please help. I have not yet been able to get my lcd to work on any tutorial I have tried.</p>
<p>in the top bar, go to [ Sketch &gt; Include Libraries &gt; Manage Libraries &gt; Filter ]</p><p>and type in the library that you need to download find what you need, get the latest version and click install. then go to </p><p>[ Sketch &gt; Include Libraries &gt; (...Library Name...) and click on it. then in the script bar it should pop up with </p><p>#include &lt;...Library Name...&gt;</p><p>Hope this helps </p><p>~Scratchndent</p>
Where are you unzipping the library ?
<p>Do hou have lcd.h Librarie installed?</p>
<p>have you tried the tutorial on how to find your serial code because that was a big problem for me!!!</p>
<p>LiquidCrystal_I2C.h does not exist and neither does LCD.h</p><p>also not compatible with any other lcd librarys or script.</p>
<p>it almost works, it uploads fine but i got no text on my lcd, any tips</p><p>is it different with a mac book?</p>
<p>Ok I got mine figured out. Here's where I got the answer, and this is a great, packed-with-info video:<br><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/Wj_BBSsfNRg" width="500"></iframe><br>At one point he mentions that there are three jumpers on the back of the I2C backpack (mine are labeled A0, A1, and A2) which are unsoldered. This instructable assumes what is in the video above - that the baseline serial address for the backpack is 0x27.<br><br>Well I read on the Amazon reviews where I got my serial LCD that I'm supposed to be using 0x3F as the address. The backpack does NOT have anything soldered in the jumpers area so basically whoever made the backpack I have is not following the convention at all. The 0x27 address shows up over and over in tutorials, but is apparently not always the case.<br><br>I didn't have to do this, but if you don't know the serial address, you can use this link to write code to find it for you.<br>http://playground.arduino.cc/Main/I2cScanner</p>
<p>I'm having the same problem... everything connected up and uploading, no compile errors, and a blank screen. :(</p>
<p>Hi</p><p>I want to change old 16x1 LCD with a new backlight display. (1601A)<br>and an serial adaptor modul. 1602 (4 pin input ) GND,VCC, SDA,SDC</p><p>Old LCD driver is (40pin HCLP0538AP). pin 1 = VCC, pin 5 =GND, Pin 2 = Data, Pin 3 = CLK.</p><p>is pin 2 (SDA) iqual to pin 2 (Data,40pin HCLP0538AP) ?<br>is pin 3 (SDC) iqual to pin 3 (CLK,40pin HCLP0538AP) ?</p><p>tried to connect the LCD incl Serial adaptor but no data on the display.</p><p>how do I solve this issue. ?</p><p>kind regards. </p>
<p>Great tutorial:) Thanks for sharing.</p>
<p>what's the device behind the LCD that allows connection with the SDA and SLC pins on the arduino?</p>
<p>Hi, I believe they are called I2C interface.</p><p><a href="http://www.gearbest.com/development-boards/pp_51009.html?currency=CAD&gclid=CJvvqMfDm8oCFccXHwodpxwHZQ">http://www.gearbest.com/development-boards/pp_5100...</a></p><p>Check the link, they sometimes sell them separate from the LCD.</p>
<p>it is really hard. got any tips?</p>
<p>Follow the video and it should work.</p>
<p>I have mad this and tis is the only one that has worked for me out of 45 I have tried. I am so happy because before this I had spent about 50 hours on trying to get it to work. </p><p>Thanks a lot to who wrote this.</p>
<p>Very nice and rich blog</p><p>I have tried to gather all my collection of websites and youtube channels and videos in one place. There are many things also to introduce to you in an elegant way so I established this site : www.speakelectronics.com and I hope you like it.</p><p>Regards,</p><p>-----------------------</p><p>www.speakelectronics.com</p>
Hmm looks like a normal lcd with a addon board cool i wonder if you can buy the board separte
<p>you can buy them seperately, but usually on Aliexpress an LCD with I2C board is only slightly more expensive than the I2C board itself</p>
You can buy them separately. Search eBay for &quot;1602 serial&quot; <br>Good luck :-)
<p>I made it! It took a little tweaking to get the wiring sorted because I had a slightly different LCD display. Good instructable. It was very clear and easy to follow.</p>
excellent thank you for sharing it
<p>Hello, it's not first time that i try to control a LCD panel with I2c protocol, and I alway found troubles (also in this example)</p><p>In 1st place, It's used the library &quot;LCD.h&quot; and with the libraries I dowloaded here and there, its always named LiquidCrystal, otherwise, my IDE doesn't not compile it.</p><p>Also, when i try to initialise the LCD</p><p>&gt;&gt;&gt;&gt;&gt;LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);&lt;&lt;&lt;&lt;&lt;&lt; in the sketch, It causes an error that says that im giving 8 argments where 3 should be placed.</p><p>Its to be known also, that my Arduino IDE (I don't know why) doesn't compile the last library of LiquidCrystal_I2C from malapartida, and im using the 1.7Version cause It doesn't recognise the last one.</p><p>Does anyone know why these things happends, or how do I manage to solve it?</p><p>Thanks in advance </p>
I don't know if I understood you correctly, but look at the video there is a step by step instructions I how to rename the existing liquid _ crystal that already exist and replacing it with is one. also you can send me your sketch to test it on my end. <br>cheers
<p>Pretty neat. It builds here. I just do not have one of these displays spare at the moment. I should pick one up.</p>
<p>Thanks for the Instructable and also the you tube video. Very well demonstrated. You are a very good teacher.</p>
<p>I forgot to say that other stuff that uses to happend, it's that in the sketchs they always use a sentence called POSITIVE, and mi IDE says &quot;POSITIVE was not declared in this scope&quot;</p>
back part of LCD display I hav no such pins how to connect it?....
<p>The back pack is not a UART(Universal Asynchronous Receiver Transmitter) it is an i2c back pack. I2C is not asynchronous. I think asynchronous may not be spelled correctly. sorry.</p>
<p>Thanks, i look a long time for this</p><p>It works fine</p>
Well....It is I2c(iic) rather than serial

About This Instructable

34,506views

294favorites

License:

More by eliesalame:Game of Thrones Music Box One Pot 5 Vegetables Veal Shank Soup  Arduino 101 Fundamentals 
Add instructable to: