We will start with introduction to LCD then will see interfacing of Arduino Uno with LCD.
LCD(Liquid Crystal Display)
A liquid crystal display or LCD draws its definition from its name itself. It is a combination of two states of matter, the solid and the liquid. LCD uses a liquid crystal to produce a visible image. Liquid crystal displays are super-thin technology display screens that are generally used in laptop computer screens, TVs, cell phones and portable video games. LCD’s technologies allow displays to be much thinner when compared to a cathode ray tube (CRT) technology.
Interfacing LCD with Arduino
![Interfacing LCD with Arduino](https://static.wixstatic.com/media/625d69_e8fb97ec054a4e358f0ed55bc632efe8~mv2.png/v1/fill/w_980,h_541,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/625d69_e8fb97ec054a4e358f0ed55bc632efe8~mv2.png)
Components Required:
Arduino Uno with usb cable
16*2 LCD display
1k potentiometer
Jumper wires (Male to Male (15))
Breadboard
220 resistor
Arduino connections explained in steps
Insert the LCD into the breadboard
Connect the +ve rail with the +5v and –ve with the gnd of Arduino
Connect the 1st pin which is Vss of LCD to –ve rail
Connect the 2nd pin which is Vdd of LCD to +ve rail
Connect the middle pin of the potentiometer to the 3rd pin of the LCD which is VE(contrast)
Connect the other pins of potentiometer to the +ve and –ve rail of the breadboard
Connect the 4th pin RS to digital pin 12 of Arduino
Connect the 5th pin READ/WRITE to the –ve rail
Connect the 6th pin E to the digital pin 11 of Arduino
Leave the pins from D0 – D3 on LCD
Connect the D4 of LCD to the digital pin 5 of Arduino
Connect the D5 of LCD to the digital pin 4 of Arduino
Connect the D6 of LCD to the digital pin 3 of Arduino
Connect the D7 of LCD to the digital pin 2 of Arduino
Connect the 15th pin of LCD to +ve rail through 220 Ohm resistor
Connect the 16th pin of LCD to –ve rail
Pre-coding explained in steps
Define the Pin Mode in the void Setup
Define the logic in the void Loop
Library used is <LiquidCrystal.h>
Functions used in this example:
pinMode(Pin_Number, IN/OUT); to set the mode i.e. input or output for example pinMode(3,OUTPUT);
digitalWrite(Pin_Number,LOW/HIGH); to set the pin as High or low for example digitalWrite(3,LOW);
delay(microseconds) to put a time delay between two instructions. For example delay(1000) i.e. 1 sec delay
lcd.begin(16, 2); to initialise the LCD
lcd.setCursor(0, 1); to set the cursor point
lcd.print("hello, world!"); to print on the LCD
Comentarios