SlideShare a Scribd company logo
Interfacing to LCD 16x2

By hendri@eepis-its.edu
You are free:
to Share — to copy, distribute and transmit the work
Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author
or licensor (but not in any way that suggests that they endorse you or your use
of the work).
Noncommercial — You may not use this work for commercial purposes.
No Derivative Works — You may not alter, transform, or build upon this work.
Block Diagram
Pin Connection
Timing Diagram
Timing Diagram
LCD Command
LCD Command
Initialize Procedure
Arduino way

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, EN, D4, D5, D6, D7);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("H");
}

void loop() {
}
Arduino From Scratch
int RS   = 8;                                          delay(5); //delay 4.1ms
int En   = 9;
int D4   = 4;                                          //function set 1
int D5   = 5;                                          digitalWrite(RS,LOW);
int D6   =6;                                           digitalWrite(D7,LOW);
int D7   =7 ;                                          digitalWrite(D6,LOW);
                                                       digitalWrite(D5,HIGH);
void enable()                                          digitalWrite(D4,HIGH);
{                                                      enable();
  digitalWrite(En,LOW);
  delay(1);                                            delayMicroseconds(100);
  digitalWrite(En,HIGH);
  delay(1);                                            //function set 1
  digitalWrite(En,LOW);                                digitalWrite(RS,LOW);
}                                                      digitalWrite(D7,LOW);
// the setup routine runs once when you press reset:   digitalWrite(D6,LOW);
void setup() {                                         digitalWrite(D5,HIGH);
  // initialize the digital pin as an output.          digitalWrite(D4,HIGH);
  pinMode(RS, OUTPUT);                                 enable();
  pinMode(En, OUTPUT);
  pinMode(D4, OUTPUT);                                 //bf can be check after following instruction
  pinMode(D5, OUTPUT);                                 digitalWrite(RS,LOW);
  pinMode(D6, OUTPUT);                                 digitalWrite(D7,LOW);
  pinMode(D7, OUTPUT);                                 digitalWrite(D6,LOW);
                                                       digitalWrite(D5,HIGH);
 delay(15);                                            digitalWrite(D4,LOW);
                                                       enable();
 //function set 1
 digitalWrite(RS,LOW);
 digitalWrite(D7,LOW);
 digitalWrite(D6,LOW);
 digitalWrite(D5,HIGH);
 digitalWrite(D4,HIGH);
 enable();
Arduino From Cont


//function set 4 bit               //display clear
 digitalWrite(RS,LOW);               digitalWrite(RS,LOW);
 digitalWrite(D7,LOW);               digitalWrite(D7,LOW);
 digitalWrite(D6,LOW);               digitalWrite(D6,LOW);
 digitalWrite(D5,HIGH);              digitalWrite(D5,LOW);
 digitalWrite(D4,LOW);               digitalWrite(D4,LOW);
 enable();                           enable();
 digitalWrite(RS,LOW);               digitalWrite(RS,LOW);
 digitalWrite(D7,HIGH);              digitalWrite(D7,LOW);
 enable();                           digitalWrite(D6,LOW);
                                     digitalWrite(D5,LOW);
//display off                        digitalWrite(D4,HIGH);
digitalWrite(RS,LOW);                enable();
digitalWrite(D7,LOW);
digitalWrite(D6,LOW);               //entry mode set
digitalWrite(D5,LOW);               digitalWrite(RS,LOW);
digitalWrite(D4,LOW);               digitalWrite(D7,LOW);
enable();                           digitalWrite(D6,LOW);
digitalWrite(RS,LOW);               digitalWrite(D5,LOW);
digitalWrite(D7,HIGH);              digitalWrite(D4,LOW);
digitalWrite(D6,LOW);               enable();
digitalWrite(D5,LOW);               digitalWrite(RS,LOW);
digitalWrite(D4,LOW);               digitalWrite(D7,LOW);
enable();                           digitalWrite(D6,LOW);
                                    digitalWrite(D5,HIGH);
                                    digitalWrite(D4,HIGH);
                                    enable();
                                    // init done
Arduino From Cont

// display on                         // the loop routine runs over and over again forever:
 digitalWrite(RS,LOW);                void loop() {
 digitalWrite(D7,LOW);                 }
 digitalWrite(D6,LOW);
 digitalWrite(D5,LOW);
 digitalWrite(D4,LOW);
 enable();
 digitalWrite(RS,LOW);
 digitalWrite(D7,HIGH);
 digitalWrite(D6,HIGH);
 digitalWrite(D5,HIGH);
 digitalWrite(D4,LOW);
 enable();

     // display 'H'
    digitalWrite(RS,HIGH);
    digitalWrite(D7,LOW);
    digitalWrite(D6,HIGH);
    digitalWrite(D5,LOW);
    digitalWrite(D4,LOW);
    enable();
    digitalWrite(RS,HIGH);
    digitalWrite(D7,HIGH);
    digitalWrite(D6,LOW);
    digitalWrite(D5,LOW);
    digitalWrite(D4,LOW);
    enable();
}

More Related Content

What's hot (20)

PDF
Shadow alarm
Siddharth Jadav
 
PPTX
NAND gate
Abhishekvb
 
PPTX
Introduction to Node MCU
Amarjeetsingh Thakur
 
PPTX
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Gaurav Pandey
 
PDF
IR proximity sensor report file.
Aman singh
 
PDF
Clap switch
swiss2020
 
PDF
Architecture of 8051 Microcontroller.pdf
HezalLopes1
 
DOCX
4 bit uni shift reg
E ER Yash nagaria
 
PPTX
Microprocessor and microcontrollers
Hiran Gabriel
 
PPTX
Triac and Diac
Rahul Sahu
 
PDF
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
DOCX
Object counter
suresh shindhe
 
PDF
Phase Controlled Rectifiers
maneesh001
 
PPTX
Power amplifier ppt
Krishna Ece
 
PPTX
OBSTACLE AVOIDING CAR
Shubham Thakur
 
PDF
1. Introduction to Embedded Systems & IoT
IEEE MIU SB
 
PPTX
8051 Microcontroller ppt
Rahul Kumar
 
PPTX
MULTIPLEXER
Siddhi Shrivas
 
PPTX
Microcontroller 8051 and its interfacing
Ankur Mahajan
 
Shadow alarm
Siddharth Jadav
 
NAND gate
Abhishekvb
 
Introduction to Node MCU
Amarjeetsingh Thakur
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Gaurav Pandey
 
IR proximity sensor report file.
Aman singh
 
Clap switch
swiss2020
 
Architecture of 8051 Microcontroller.pdf
HezalLopes1
 
4 bit uni shift reg
E ER Yash nagaria
 
Microprocessor and microcontrollers
Hiran Gabriel
 
Triac and Diac
Rahul Sahu
 
arduinocourse-180308074529 (1).pdf
ssusere5db05
 
Object counter
suresh shindhe
 
Phase Controlled Rectifiers
maneesh001
 
Power amplifier ppt
Krishna Ece
 
OBSTACLE AVOIDING CAR
Shubham Thakur
 
1. Introduction to Embedded Systems & IoT
IEEE MIU SB
 
8051 Microcontroller ppt
Rahul Kumar
 
MULTIPLEXER
Siddhi Shrivas
 
Microcontroller 8051 and its interfacing
Ankur Mahajan
 

Viewers also liked (17)

PPTX
Lcd with arduino uno
Robomart India
 
PPTX
Arduino uno lcd display 16x2
Robomart India
 
PPTX
Interfacing with Arduino
Omer Kilic
 
PPTX
LCD Theory and Working Principles
Robo India
 
ODP
FPGA Tutorial - LCD Interface
Politeknik Elektronika Negeri Surabaya
 
PPTX
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
PPT
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
Sri Adhiyani Sunaryo
 
PPTX
Digital Notice Board
Raaki Gadde
 
DOCX
Arduino lcd display
Makers of India
 
PPTX
Smart LED Notice Board
swarnimmaurya
 
DOCX
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Sai Bhaskar Reddy Nakka
 
PDF
Project report on gsm based digital notice board
manish katara
 
PPTX
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Abhishekvb
 
PPTX
Soil Moisture Sensor and Arduino
Parvesh Taneja
 
PDF
Arduino uno
Muhammad Khan
 
PPTX
Introduction to arduino
Ahmed Sakr
 
PPT
Android ppt
blogger at indiandswad
 
Lcd with arduino uno
Robomart India
 
Arduino uno lcd display 16x2
Robomart India
 
Interfacing with Arduino
Omer Kilic
 
LCD Theory and Working Principles
Robo India
 
FPGA Tutorial - LCD Interface
Politeknik Elektronika Negeri Surabaya
 
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
Sri Adhiyani Sunaryo
 
Digital Notice Board
Raaki Gadde
 
Arduino lcd display
Makers of India
 
Smart LED Notice Board
swarnimmaurya
 
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Sai Bhaskar Reddy Nakka
 
Project report on gsm based digital notice board
manish katara
 
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Abhishekvb
 
Soil Moisture Sensor and Arduino
Parvesh Taneja
 
Arduino uno
Muhammad Khan
 
Introduction to arduino
Ahmed Sakr
 
Ad

Similar to Interfacing to lcd with arduino (20)

DOCX
Direct analog
srikanthsailu
 
PDF
Arduino: Intro and Digital I/O
June-Hao Hou
 
TXT
PIC and LCD
hairilfaiz86
 
PPTX
R tist
Atul Uttam
 
DOCX
7segment scetch
Bang Igo
 
PPT
Intro2 Robotic With Pic18
Moayadhn
 
PPTX
Temperature sensor with a led matrix display (arduino controlled)
TechLeap
 
PPTX
Magnetic door lock using arduino
Sravanthi Sinha
 
DOCX
REPORT
Taimoor Tahir
 
PDF
Introduction to Arduino and Circuits
Jason Griffey
 
PDF
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
PDF
硕士答辩Keynote
pemi hua
 
PPTX
Basic of Firmware & Embedded Software Programming in C
Kapil Thakar
 
PPTX
LED Cube Presentation Slides
Projects EC
 
PDF
Programming arduino makeymakey
Industrial Design Center
 
PDF
Arduino Workshop 2011.05.31
Shigeru Kobayashi
 
PPTX
texto.pptx
ssuser3d82bc
 
PPTX
Vechicle accident prevention using eye bilnk sensor ppt
satish 486
 
PDF
From Arduino to LinnStrument
Geert Bevin
 
DOCX
Lampiran 1.programdocx
Lugik kristiyanto
 
Direct analog
srikanthsailu
 
Arduino: Intro and Digital I/O
June-Hao Hou
 
PIC and LCD
hairilfaiz86
 
R tist
Atul Uttam
 
7segment scetch
Bang Igo
 
Intro2 Robotic With Pic18
Moayadhn
 
Temperature sensor with a led matrix display (arduino controlled)
TechLeap
 
Magnetic door lock using arduino
Sravanthi Sinha
 
Introduction to Arduino and Circuits
Jason Griffey
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
硕士答辩Keynote
pemi hua
 
Basic of Firmware & Embedded Software Programming in C
Kapil Thakar
 
LED Cube Presentation Slides
Projects EC
 
Programming arduino makeymakey
Industrial Design Center
 
Arduino Workshop 2011.05.31
Shigeru Kobayashi
 
texto.pptx
ssuser3d82bc
 
Vechicle accident prevention using eye bilnk sensor ppt
satish 486
 
From Arduino to LinnStrument
Geert Bevin
 
Lampiran 1.programdocx
Lugik kristiyanto
 
Ad

More from Politeknik Elektronika Negeri Surabaya (7)

ODP
Fpga creating counter with internal clock
Politeknik Elektronika Negeri Surabaya
 
ODP
Fpga creating counter with external clock
Politeknik Elektronika Negeri Surabaya
 

Interfacing to lcd with arduino

  • 2. You are free: to Share — to copy, distribute and transmit the work Under the following conditions: Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Noncommercial — You may not use this work for commercial purposes. No Derivative Works — You may not alter, transform, or build upon this work.
  • 10. Arduino way #include <LiquidCrystal.h> //LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); LiquidCrystal lcd(8, 9, 4, 5, 6, 7); void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("H"); } void loop() { }
  • 11. Arduino From Scratch int RS = 8; delay(5); //delay 4.1ms int En = 9; int D4 = 4; //function set 1 int D5 = 5; digitalWrite(RS,LOW); int D6 =6; digitalWrite(D7,LOW); int D7 =7 ; digitalWrite(D6,LOW); digitalWrite(D5,HIGH); void enable() digitalWrite(D4,HIGH); { enable(); digitalWrite(En,LOW); delay(1); delayMicroseconds(100); digitalWrite(En,HIGH); delay(1); //function set 1 digitalWrite(En,LOW); digitalWrite(RS,LOW); } digitalWrite(D7,LOW); // the setup routine runs once when you press reset: digitalWrite(D6,LOW); void setup() { digitalWrite(D5,HIGH); // initialize the digital pin as an output. digitalWrite(D4,HIGH); pinMode(RS, OUTPUT); enable(); pinMode(En, OUTPUT); pinMode(D4, OUTPUT); //bf can be check after following instruction pinMode(D5, OUTPUT); digitalWrite(RS,LOW); pinMode(D6, OUTPUT); digitalWrite(D7,LOW); pinMode(D7, OUTPUT); digitalWrite(D6,LOW); digitalWrite(D5,HIGH); delay(15); digitalWrite(D4,LOW); enable(); //function set 1 digitalWrite(RS,LOW); digitalWrite(D7,LOW); digitalWrite(D6,LOW); digitalWrite(D5,HIGH); digitalWrite(D4,HIGH); enable();
  • 12. Arduino From Cont //function set 4 bit //display clear digitalWrite(RS,LOW); digitalWrite(RS,LOW); digitalWrite(D7,LOW); digitalWrite(D7,LOW); digitalWrite(D6,LOW); digitalWrite(D6,LOW); digitalWrite(D5,HIGH); digitalWrite(D5,LOW); digitalWrite(D4,LOW); digitalWrite(D4,LOW); enable(); enable(); digitalWrite(RS,LOW); digitalWrite(RS,LOW); digitalWrite(D7,HIGH); digitalWrite(D7,LOW); enable(); digitalWrite(D6,LOW); digitalWrite(D5,LOW); //display off digitalWrite(D4,HIGH); digitalWrite(RS,LOW); enable(); digitalWrite(D7,LOW); digitalWrite(D6,LOW); //entry mode set digitalWrite(D5,LOW); digitalWrite(RS,LOW); digitalWrite(D4,LOW); digitalWrite(D7,LOW); enable(); digitalWrite(D6,LOW); digitalWrite(RS,LOW); digitalWrite(D5,LOW); digitalWrite(D7,HIGH); digitalWrite(D4,LOW); digitalWrite(D6,LOW); enable(); digitalWrite(D5,LOW); digitalWrite(RS,LOW); digitalWrite(D4,LOW); digitalWrite(D7,LOW); enable(); digitalWrite(D6,LOW); digitalWrite(D5,HIGH); digitalWrite(D4,HIGH); enable(); // init done
  • 13. Arduino From Cont // display on // the loop routine runs over and over again forever: digitalWrite(RS,LOW); void loop() { digitalWrite(D7,LOW); } digitalWrite(D6,LOW); digitalWrite(D5,LOW); digitalWrite(D4,LOW); enable(); digitalWrite(RS,LOW); digitalWrite(D7,HIGH); digitalWrite(D6,HIGH); digitalWrite(D5,HIGH); digitalWrite(D4,LOW); enable(); // display 'H' digitalWrite(RS,HIGH); digitalWrite(D7,LOW); digitalWrite(D6,HIGH); digitalWrite(D5,LOW); digitalWrite(D4,LOW); enable(); digitalWrite(RS,HIGH); digitalWrite(D7,HIGH); digitalWrite(D6,LOW); digitalWrite(D5,LOW); digitalWrite(D4,LOW); enable(); }