Interfacing LCD With Arduino Using Only 3 Pins
by Rajkumar2506 in Circuits > Arduino
22571 Views, 78 Favorites, 0 Comments
Interfacing LCD With Arduino Using Only 3 Pins
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.
Components Required
- LCD 16x2
- Arduino Uno
- IC 74HC595N
- 1K Potentiometer
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.
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
Downloads
Schematic Diagram
I have also attached Schematic in RaR format.
Downloads
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.
Downloads
Download Program Code
I have attached program in RaR format
Download and extract it and open it in Arduino IDE