How to Connect I2C Lcd Display to Arduino Uno

58,045

48

13

About: HI! I am Junez Riyaz, currently doing Bachelor of Technology in the field of Electronics and Communication Engineering. I am much interested in inventing something new yet from my childhood. In my leisure ti...

Hello Guys , In this Instructable you are going to see how to connect i2c lcd display to arduino and how to print on lcd display .

Before going to start this tutorial you must know a brief about i2c communication .

Each I2C bus consists of two signals: SCL and SDA. SCL is the clock signal, and SDA is the data signal. The clock signal is always generated by the current bus master; some slave devices may force the clock low at times to delay the master sending more data (or to require more time to prepare data before the master attempts to clock it out). This is called “clock stretching” and is described on the protocol page.

For more information visit Electronics Projects Hub

Now lets start this Instructable ..

Step 1: Components Required

Arduino Uno : https://goo.gl/TlOucU

I2C LCD Display : https://goo.gl/Fh6su4

Male to female jumpers - 4 : https://goo.gl/nsAkuw

Step 2: Circuiting

I2C Board of LCD Arduino

GND <---> GND

VCC <---> 5V

SDA <---> A4

SCL <---> A5

Step 3: Code

We must require to include two libraries ,in order to work the code attached .

Download the libraries from the attachment LCD library .

Basic functions we use in code

lcd.begin(16,2); //Defining 16 columns and 2 rows of lcd display

lcd.backlight(); //To Power ON /OFF the back light

lcd.setCursor(0,0); //Defining positon to write from first row,first column .

lcd.setCursor(0,1); //Defining positon to write from second row,first column .

lcd.print(" write here to print"); //You can write 16 Characters per line within quotations.

lcd.clear(); //Clean the screen

Step 4: Output

The outputs attached are done according to code attached above .

Step 5: Complete Video Tutorial

Don't forget subscribe my YouTube Channel

Check out my website Electronics Projects Hub

Share

    Recommendations

    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest
    • Build a Tool Contest

      Build a Tool Contest
    • Paper Contest

      Paper Contest

    13 Discussions

    0
    None
    Barrett winn

    6 weeks ago on Step 3

    i cant seem to be able to add the library. it keeps saying that it isn't a valid library

    0
    None
    SongOfSickness

    6 weeks ago

    Hey guys. My LCD works fine using the above instructions (when replacing the existing LCD library in the Arduino directory) but I can't get the backlight to ever switch off. Suggestions?

    0
    None
    AYAN129

    Question 2 months ago on Introduction

    I have written this code.But after compiling,it is showing the below written error message:
    Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"
    I2C_LCD_TUTORIAL:6: error: 'POSITIVE' was not declared in this scope
    LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
    ^
    exit status 1
    'POSITIVE' was not declared in this scope
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    2 answers
    0
    None
    SamirD28AYAN129

    Answer 2 months ago

    Ho friend, My suggestion, use LiquidCrystal_I2C lcd(0x27,16,2);
    Where 16,2 is LCD display 16x2, you need to change the same as per your LCD.
    0x27 is the i2c address..
    Hope this helps.

    1
    None
    BroekglAYAN129

    Answer 2 months ago

    I had the same problem. I deleted all libraries with i2c lcd in the arduino IDE. Then imported the one linked in the files here.
    Worked like a charm

    0
    None
    plaahemantha

    10 months ago

    Hi, Friends,

    I tried to do this project few times using various method. But I can not succeed. Black boxes are displayed instead of text. I adjusted contrast, Address etc. But my LCD panel and Arduino are working. Black light can control. Please help.


    Hemantha.

    0
    None
    nichosninos72

    10 months ago

    how come they tell me that "POSITIVE was not declared"?? I need help on this

    1 reply
    0
    None
    MSCruznichosninos72

    Reply 10 months ago

    Hi, I had the same problem. You can solve this in two ways:

    1) Add the line: #include <LCD.h>

    2) Add the line:

    typedef enum { POSITIVE, NEGATIVE } t_backlighPol;

    Cheers!

    0
    None
    Irkisclag

    11 months ago

    Thank you i have been banging my head against the wall trying to get my LCD display to work and then I found your post and it finally worked. THANK YOU!!!

    0
    None
    rajudev

    1 year ago

    I have done it for my team robot. Gr8 tutorial

    1 reply