LCD Interfacing With Arduino
LCD stands for Liquid Crystal Display. There are different types of displays (like TFT, OLED, Dot Matrix) available in the market for Arduino interfacing. The display we are going to interface with is a 16×2 display. This display has two rows and sixteen columns, Which means a maximum 32 characters can display at a time. Every character has 8×5 pixels.
Components Required:
- One Arduino UNO
- Computer with Arduino IDE
- USB to Arduino connecting Cable
- Jumper Wires
- 16×2 LCD Display
- 10k Potentiometer (To control Brightness)
16×2 LCD PINS:
LCD Pins With Function:
PIN NO | NAME | Function |
---|---|---|
1 | VSS | GND |
2 | VCC | Supply Voltage For Logic |
3 | VEE | Supply Voltage For LCD Contrast |
4; | RS | Register Select |
5 | R/W | Read Or Write Data |
6 | E | Enable Chip |
7 | D0 | Data Bit 0 |
8 | D1 | Data Bit 1 |
9 | D2 | Data Bit 2 |
10 | D3 | Data Bit 3 |
11 | D4 | Data Bit 4 |
12 | D5 | Data Bit 5 |
13 | D6 | Data Bit 66 |
14 | D7 | Data Bit 7 |
15 | A(Led+) | Anode For Led Back Light |
16 | K(Led-) | Cathode For Led Back Light |
Circuit Diagram:
Steps To Follow::
- Establish the given circuit
- Open Arduino IDE.
- Click on File.
- Go to New. – A new File will open
- Remove the Pre-Written code..
- Paste the code given in the “CODE Section”
- Check whether your UNO has been detected by the ID by going to Tools.
- Click on Port – Select the COM-Port on which Arduino UNO is detected.
- Verify the Sketch by Clicking on the TICK icon.
- Once, the sketch is verified, Upload the sketch using the ARROW icon.
Code:
#include <LiquidCrystal.h> // Initialize LCD with following connections LiquidCrystal lcd(10, 9, 8, 7, 6, 5); void setup() { // Setup LCD Size : Columns, Rows lcd.begin(16, 2); // Display a message on the LCD. lcd.print("hello, world!"); } void loop() { // Set position of the cursor to column 0, line 1 // Note : Counting starts from 0 lcd.setCursor(0, 1); // Displays the number of seconds since reset lcd.print(millis()/1000); }