SlideShare una empresa de Scribd logo
1 de 13
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();
}

Más contenido relacionado

La actualidad más candente

Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduinoMakers of India
 
Vending Machine Controller using VHDL
Vending Machine Controller using VHDLVending Machine Controller using VHDL
Vending Machine Controller using VHDLSudhanshu Srivastava
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)babak danyal
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram descriptionAkhil Singal
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051Sam Patel
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller Gaurav Verma
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description 8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description Vijay Kumar
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051SARITHA REDDY
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086saurav kumar
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Guhan k
 

La actualidad más candente (20)

Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
 
Vending Machine Controller using VHDL
Vending Machine Controller using VHDLVending Machine Controller using VHDL
Vending Machine Controller using VHDL
 
Master synchronous serial port (mssp)
Master synchronous serial port (mssp)Master synchronous serial port (mssp)
Master synchronous serial port (mssp)
 
8086 pin diagram description
8086 pin diagram description8086 pin diagram description
8086 pin diagram description
 
7 segment led interfacing with 8051
7 segment led interfacing with 80517 segment led interfacing with 8051
7 segment led interfacing with 8051
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
Arduino lcd display
Arduino lcd displayArduino lcd display
Arduino lcd display
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description 8085 microprocessor Architecture and Pin description
8085 microprocessor Architecture and Pin description
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
Basic standard calculator
Basic standard calculatorBasic standard calculator
Basic standard calculator
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]Interfacing technique with 8085- ADC[0808]
Interfacing technique with 8085- ADC[0808]
 

Destacado

Arduino uno lcd display 16x2
Arduino uno lcd display 16x2Arduino uno lcd display 16x2
Arduino uno lcd display 16x2Robomart India
 
Interfacing with Arduino
Interfacing with ArduinoInterfacing with Arduino
Interfacing with ArduinoOmer Kilic
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working PrinciplesRobo India
 
Getting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoGetting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoChad Mairn
 
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOWATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOSri Adhiyani Sunaryo
 
Digital Notice Board
Digital Notice BoardDigital Notice Board
Digital Notice BoardRaaki Gadde
 
Smart LED Notice Board
Smart LED Notice BoardSmart LED Notice Board
Smart LED Notice Boardswarnimmaurya
 
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsDesign Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsSai Bhaskar Reddy Nakka
 
Project report on gsm based digital notice board
Project report on gsm based digital notice boardProject report on gsm based digital notice board
Project report on gsm based digital notice boardmanish katara
 
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3Abhishekvb
 
Soil Moisture Sensor and Arduino
Soil Moisture Sensor and Arduino Soil Moisture Sensor and Arduino
Soil Moisture Sensor and Arduino Parvesh Taneja
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduinoAhmed Sakr
 

Destacado (16)

Lcd with arduino uno
Lcd with arduino unoLcd with arduino uno
Lcd with arduino uno
 
Arduino uno lcd display 16x2
Arduino uno lcd display 16x2Arduino uno lcd display 16x2
Arduino uno lcd display 16x2
 
Interfacing with Arduino
Interfacing with ArduinoInterfacing with Arduino
Interfacing with Arduino
 
LCD Theory and Working Principles
LCD Theory and Working PrinciplesLCD Theory and Working Principles
LCD Theory and Working Principles
 
FPGA Tutorial - LCD Interface
FPGA Tutorial - LCD InterfaceFPGA Tutorial - LCD Interface
FPGA Tutorial - LCD Interface
 
Getting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and ArduinoGetting Started with Raspberry Pi and Arduino
Getting Started with Raspberry Pi and Arduino
 
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOWATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
 
Digital Notice Board
Digital Notice BoardDigital Notice Board
Digital Notice Board
 
Smart LED Notice Board
Smart LED Notice BoardSmart LED Notice Board
Smart LED Notice Board
 
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsDesign Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and Sensors
 
Project report on gsm based digital notice board
Project report on gsm based digital notice boardProject report on gsm based digital notice board
Project report on gsm based digital notice board
 
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
Bidirectional Visitor Counter using IR sensors and Arduino Uno R3
 
Soil Moisture Sensor and Arduino
Soil Moisture Sensor and Arduino Soil Moisture Sensor and Arduino
Soil Moisture Sensor and Arduino
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Android ppt
Android ppt Android ppt
Android ppt
 

Similar a Interfacing to lcd with arduino

Arduino: Intro and Digital I/O
Arduino: Intro and Digital I/OArduino: Intro and Digital I/O
Arduino: Intro and Digital I/OJune-Hao Hou
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
Arduino and Robotics
Arduino and RoboticsArduino and Robotics
Arduino and RoboticsMebin P M
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with ArduinoAbdallah Hodieb
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerMujahid Hussain
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you runSunilAcharya37
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconftutorialsruby
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconftutorialsruby
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino Nanda Fauzi P
 

Similar a Interfacing to lcd with arduino (20)

Praktek ARDUINO
Praktek ARDUINOPraktek ARDUINO
Praktek ARDUINO
 
Day1
Day1Day1
Day1
 
Arduino: Intro and Digital I/O
Arduino: Intro and Digital I/OArduino: Intro and Digital I/O
Arduino: Intro and Digital I/O
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
P-Space Arduino/Genuino day 2016
P-Space Arduino/Genuino day 2016P-Space Arduino/Genuino day 2016
P-Space Arduino/Genuino day 2016
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
Arduino and Robotics
Arduino and RoboticsArduino and Robotics
Arduino and Robotics
 
Arduino: Arduino lcd
Arduino: Arduino lcdArduino: Arduino lcd
Arduino: Arduino lcd
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with Arduino
 
05-Debug.pdf
05-Debug.pdf05-Debug.pdf
05-Debug.pdf
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
FINISHED_CODE
FINISHED_CODEFINISHED_CODE
FINISHED_CODE
 
robotics presentation for a club you run
robotics presentation for a club you runrobotics presentation for a club you run
robotics presentation for a club you run
 
Videogiochi in PHP 👾
Videogiochi in PHP 👾Videogiochi in PHP 👾
Videogiochi in PHP 👾
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
building_games_with_ruby_rubyconf
building_games_with_ruby_rubyconfbuilding_games_with_ruby_rubyconf
building_games_with_ruby_rubyconf
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino coding and wiring dht11 and ultrasonic hcsr04 arduino
coding and wiring dht11 and ultrasonic hcsr04 arduino
 
Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0Intro to OpenGL ES 2.0
Intro to OpenGL ES 2.0
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 

Más de Politeknik Elektronika Negeri Surabaya (7)

Memulai AVR WINAVR
Memulai AVR WINAVRMemulai AVR WINAVR
Memulai AVR WINAVR
 
Fpga creating counter with internal clock
Fpga   creating counter with internal clockFpga   creating counter with internal clock
Fpga creating counter with internal clock
 
Fpga creating counter with external clock
Fpga   creating counter with external clockFpga   creating counter with external clock
Fpga creating counter with external clock
 
Modul2 setting xctu
Modul2 setting xctuModul2 setting xctu
Modul2 setting xctu
 
My Linux
My LinuxMy Linux
My Linux
 
Embedded lcd
Embedded lcdEmbedded lcd
Embedded lcd
 
winavr tutorial
winavr tutorial winavr tutorial
winavr tutorial
 

Interfacing to lcd with arduino

  • 1. Interfacing to LCD 16x2 By hendri@eepis-its.edu
  • 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(); }