Interfacing LCD With Arduino Using Only 3 Pins

16,850

79

14

Introduction: Interfacing LCD With Arduino Using Only 3 Pins

About: iam a B.E Electronics and Communication Engineer. I have great interest on electronics.

To interface LCD we need six digital pins from Arduino. To save your Arduino pins and easy interfacing

IC 74HC595N Shift Register is used.Using this shift register we can interface LCD using 3 pins.

Step 1: Components Required

  • LCD 16x2
  • Arduino Uno
  • IC 74HC595N
  • 1K Potentiometer

Step 2: Operation of IC74HC595N

IC 74HC595N shift Register accepts serial input data and converts into parallel output.This shift Register contains 3 input pins and 8 output pins.By updating LiquidCrystal libraries the arduino generates serial data in single pin and give it to input data pin of IC74HC595N and the shift Register converts these serial data into parallel output and these parallel data is given to LCD.

IC 74HC595N contains 3 input pins

  • Data pin: Data is sent in serial mode.
  • Clock Pin: A clock runs on this pin
  • Latch Pin: This pin is used to toggle so that shift register shows 8 bit data on output.

Step 3: Updating Libraries

To interface LCD using 3 pins you need to Update the ARDUINOLiquidCrystal libraries.Which is located at the following location

Local Disk(C)-->Program Files-->Arduino-->libraries-->LiquidCrystal.

Open the LiquidCrystal folder and there are some files inside that folder.Cut and paste these files Some where on your pc. Because you need to use these files when you interface LCD using 6 pins.

Now Download and Extract the following libraries.Which is an updated Liquid Crystal libraries to use LCD with 3 pins.Copy the extracted files and paste it in the following Location

Local Disk(C)-->Program Files-->Arduino-->libraries-->LiquidCrystal.

Note: open the folder of Liquid Crystal and paste it.
Now you have updated your Arduino Liquid Crystal libraries

Step 4: Schematic Diagram

I have also attached Schematic in RaR format.

Step 5: Program Code

#include <Wire.h>

#include <LiquidCrystal_SR.h>

// Defining LCD and Pins for interfacing.

LiquidCrystal_SR lcd(6, 5, 9); // Pin 6 - Data Enable/ SER, Pin 5 - Clock/SCL, Pin 9 -SCK

void setup()

{

lcd.begin(16,2); // Initializing LCD

lcd.home (); // Setting Cursor at Home i.e. 0,0

}

void loop()

{

lcd.print("3 Pin LCD"); // Print Something on LCD

delay(2000); // Waiting for a while

lcd.clear(); // Clearing LCD

lcd.print("INSTRUCTABLES");

delay(2000);

lcd.clear();

}

Note

I have attached the Wire library.Add the library before compilation of the code otherwise you will get error.

Attachments

Step 6: Download Program Code

I have attached program in RaR format

Download and extract it and open it in Arduino IDE

Step 7: Video

Epilog Contest 8

Participated in the
Epilog Contest 8

Make it Glow Contest 2016

Participated in the
Make it Glow Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Be the First to Share

    Recommendations

    • Toys & Games Contest

      Toys & Games Contest
    • Big vs Small Challenge

      Big vs Small Challenge
    • Fix It Challenge

      Fix It Challenge

    14 Comments

    0
    aghyool
    aghyool

    1 year ago

    Thank you for sharing your knowledge.
    I Prefer to use 5K Pot.

    0
    Spencer4
    Spencer4

    2 years ago

    Flawless, but I personally couldn't see the display without the backlight: so I grounded the last pin on the LCD and put 5V through a 220 ohm resistor to the second to last pin on the LCD. The video does show the light being on, but I definitely didn't see it in the schematic. No biggy though.

    0
    ChanaS1
    ChanaS1

    3 years ago

    Thank good job

    0
    Mohamed SamyH
    Mohamed SamyH

    4 years ago

    please help me for god sake with this error occured during verifiying:

    Arduino: 1.6.9 (Windows 10), Board: "Arduino/Genuino Uno"

    E:\Arduino\arduino sa3d we 3abd el ra7man\arduino-1.6.9\libraries\LiquidCrystal\I2CIO.cpp:35:26: fatal error: ../Wire/Wire.h: No such file or directory

    #include <../Wire/Wire.h>

    ^

    compilation terminated.

    exit status 1

    Error compiling for board Arduino/Genuino Uno.

    This report would have more information with

    "Show verbose output during compilation"

    option enabled in File -> Preferences.

    0
    Rajkumar2506
    Rajkumar2506

    Reply 3 years ago

    You need to install old IDE version of arduino software.That is
    1.0.6.Don't go to latest version of IDE.The wire.h command is available
    only in older versions like 1.0.6.Install the older version and try
    uploading the code.You will get that right.

    0
    JarlG
    JarlG

    Reply 3 years ago

    Maybe not a solution, I just updated the I2CIO file and removed "../Wire/" and voila!

    0
    Kunal Gehlot
    Kunal Gehlot

    3 years ago

    I made it!, thanks for your support.

    0
    ArifSae
    ArifSae

    4 years ago

    I have tried it in past project, it works great, Latest development is you can get I2C board cheaply with LCD that takes care of hassle (just sharing info)

    0
    Rajkumar2506
    Rajkumar2506

    Reply 4 years ago

    I2C is costly when compare to 74HC595N.You can get the IC 74HC595N cheaper in cost

    0
    ArifSae
    ArifSae

    Reply 4 years ago

    no doubt about that, 595 costs around 8/Pkr while I2C 64/Pkr.

    0
    The creator sid
    The creator sid

    4 years ago

    I think 10k pot should also work flawlessly.

    0
    The creator sid
    The creator sid

    Reply 4 years ago

    10K potentiometer is more common, than 1K. I have also made this project;)

    0
    Rajkumar2506
    Rajkumar2506

    Reply 4 years ago

    Yes you can also use 10K pot to have wide range of contrast levels

    0
    prabakaranp
    prabakaranp

    4 years ago

    Very helpful to me