LCD interfacing with Arduino UNO R3

LCD interfacing with Arduino UNO R3 ,in this tutorial I have discussed how to interface LCD with Arduino UNO R3 and programming functions required to interface LCD with Arduino UNO R3. Liquid crystal display have many applications in embedded system and digital electronics projects. Engineering students used LCD’s in their projects to display various type of parameters. I have posted many articles on embedded system projects. In all these projects I have used liquid crystal display to display various physical parameters like temperature, analog current, analog voltage, humidity, intensity of light, moisture and solar panel parameters.In all these projects, I have used LCD to display these parameters. You may also read following topics to get idea about applications of LCD.

Cicruit Description :

16 * 2 LCD :

16 * 2 LCD is used in this project which have sixteen columns and two rows. Its mean with 16 * 2 LCD can display sixteen characters in one row and it have two such rows. It have sixteen pins. pin number 7-14 are data pins which are used to send data from Arduino which you want to display on LCD. VSS and VDD are ground and power pins. VEE pin is used to set contrast of LCD. 10K ohm variable resistor is connected with VEE pin to adjust light contrast. Variable resistor one side is connected with 5 volt and other side is connected with ground. Third terminal is connected with VEE pin. If you don’t want to use variable resistor, you can also use 2k ohm resistor instead of variable resistor. Connect one side of 2k ohm resistor with five volt and other side to VEE pin. Pin 6 is enable pin.En pin is controlled with programming. But In Arduino you don’t need to worry about programming. Because Arduino provides rich library resources. You just have to tell to Arduino which pin of LCD is connected with which pin of Arduino. Pin number 5 and 6 are also control pins for direction control of data and instructions.Circuit diagram of LCD interfacing with Arduino UNO R3 is shown below:

Lcd interfacing with Arduino UNO R3 tutorial

LCD interfacing with Arduino UNO R3 tutorial

Programming :

As shown in above circuit diagram, this circuit display “BILAL MALIK” in first row of LCD and “microcontrollers” in second row of LCD. I is also  shown in above diagram, pin number 8-13 of Arduino UNO R3 is connected with LCD. you just have to write these pin numbers in LCD library functions arguments which tell Arduino that which pin of Arduino is connected with which pin of LCD. Code to display above text which is showing on LCD is given below.

// It inculde Liquid crystal display library in your code
#include <LiquidCrystal.h>
// This function tell Arduino microcontroller about connection of LCD with Arduino. Pins should be connected in following manner :
// LiquidCrystal(RS, EN, D4, D5, D6, D7)
LiquidCrystal lcd(12, 13, 8, 9, 10, 11);

void setup()




{
// following function set up the LCD columns and rows:
lcd.begin(16, 2);
}

void loop() {
lcd.setCursor(0,0); // set the cursor position
lcd.print(“BILAL MALIK”); //print the string on cursor position
lcd.setCursor(0,1);
lcd.print(“Microcontrollers”);
lcd.noDisplay(); // No display on LCD for 500ms
delay(500);
lcd.display();
delay(500);
}

Code is self explanatory and I have also write comments along with each line of code. But if you still have any issue, let me know with your comments on this post.

One Response

  1. muhammad bilal April 1, 2015

Add Comment