Menu Close

Arduino – LCD | 3 Pin Interfacing.

This tutorial explains to use 16X2 Character LCD with 3 Pins interface with Arduino. It is a general problem that LCD occupies several pins, with the help of 74HC595 (Shift Register IC) LCD can be interfaced with Arduino by 3 Pins only.

Arduino LCD with I2C – 3 Pin Interface\

This tutorial explains to use 16X2 Character LCD with 3 Pins interface with Arduino. It is a general problem that LCD occupies several pins, with the help of 74HC595 (Shift Register IC) LCD can be interfaced with Arduino by 3 Pins only.

Step by step tutorial-

1. Software required-

1.1. Arduino IDE – Download

 If you don’t have Arduino IDE, You may download it from the above link. Once the download is completed install the same.

1.2. Serial LCD library – LiquidCrystal

  Download the library and extract. You will need to install this library to your Arduino. Following are the steps to install this library.

1.2.1. Go the following location –

C:\Program Files (x86)\Arduino\libraries

                               or

C:\Program Files\Arduino\libraries

or

The installation folder of Arduino. You may get it by- Right click on Arduino icon->properties->location

or

for Linux and Mac users find the same from install folder of Arduino.

1.2.2. Find “LiquidCrystal” folder Cut this folder and Paste at some other place (by doing this you will create backup of Arduino’s original LiquidCrystal library.)

1.2.3. Copy and paste the extracted folder at step 1.2. i.e. “LiquidCrystal” at Arduino Library Folder. In other words it can be understood that you are to replace Arduino’s LiquidCrystal library by the downloaded one from here.

2. Hardware Required: 

Following hardware will be required – 

S.No.ItemQuantity
1.R-Board with FTDI or Arduino Board1
2.Bread Board1
3.Male to male Jumpers 24
4.16×2 LCD1
5.SN74HC595N Shift Register1
6.1K Potentiometer1

2.1. Installation of Arduino Board / USB to serial can be learned from here.

2.2 Once you have arranged these hardware and software. Make the following circuit.



 or

3. Programming of Arduino

3.1. Open Arduino IDE. Select Development board as shown in the picture (Click on the picture to enlarge).

3.2 Select the port – As shown in the picture (Click on picture to enlarge). After selection of Board and Ports you will see “Arduino UNO on Com__” the comport no. you have selected. Here in this picture comort is COM37.

3.3 Copy and paste the following code to your Arduino.

You may download this code(sketch) from here.

// Robo India Tutorial on using 16X2 LCD with 3 Pin interface. 
// www.roboindia.com


#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("ROBO INDIA");     
  lcd.setCursor(0, 1);          // Setting cursor to column first and second row.
  lcd.print("roboindia.com");
  delay(2000);
  lcd.clear();                  

  
}


3.4. Upload the code.

3.5. As the upload completes the output is here-

Note: You may restore your original LiquidCrystal library by following Step 1.2.3 for the original library you have copied for backup. The Library you are using here is obtained from DOXYGEN.

if you have any query please write us at: support@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
http://roboindia.com


Leave a Reply