Thursday 26 January 2017

Interfacing 20*4 LCD with arduino

Hello Friends,

In this tutorial, we are going to interface 20*4 lcd with arduino uno. As the name suggests it has 4 rows and twenty columns. In total, we can show 80 characters. It has blue backlight. It has 16 pins just like 16*2. The pin configuration of 20*4 lcd is similar to that of 16*2 lcd.

Circuit Diagram:
Connection on proteus



List of components:

  • Arduino Uno
  • LCD 20*4
  • 10k pot
  • jumper wires
  • Arduino IDE


Programming is quite simple. Let's start programming.


From Files > Examples > Liquid Crystal > Hello World

Make the following changes in the code:


Code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(20, 4);   // for 20*4 lcd
//  lcd.print("hello, world!");   // this string will display on line 1
}

void loop() {
  lcd.setCursor(0, 0);
  lcd.print("     Welcome To     ");
  lcd.setCursor(0, 1);
  lcd.print("      Fun With      ");
  lcd.setCursor(0, 2);
  lcd.print("     Electronics    ");
  lcd.setCursor(0, 3);
  lcd.print("        v 1.0       ");
}

Check out the result:






No comments:

Post a Comment