Menu Close

3 Pin LCD interfacing with Arduino

This tutorial explains how to use Robo India’s Product 3 Pin LCD for Arduino.

1.Introduction

This tutorial explains how to use Robo India’s Product 3 Pin LCD for Arudino. It is well known fact that LCD interfacing requires various pins. This is extremely useful when you want to save Arduino Pins.

It has got 5 Pins out of 2 are for power supply and 3 for interfacing with Arduino. The BL is jumper for BackLight. Put jumper on BL if you want the back light to be ON. The contrast potentionmeter is there to control contrast of LCD.

Step by step tutorial-

2. Software required-

2.1. Arduino IDE – Click here to download

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

2.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.

2.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.

2.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.)

2.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.3-PIN LCD For Arduino ( With 16X2 LCD)1
3.Male to Female Jumpers 5

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 and you are done.

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: info@roboindia.com

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

Leave a Reply