SlideShare a Scribd company logo
Liquid Crystal Display
(LCD)
1
Liquid Crystal Display
2
LCDs are available to display characters, arbitrary images (as in
a general-purpose computer display) or fixed images which
can be displayed or hidden, such as preset words, digits, and
7-segment displays as in a digital clock. They use the same
basic technology, except that arbitrary images are made up of
a large number of small pixels, while other displays have larger
elements.
Some types of LCDs:
1- Character LCD
2- Graphic LCD
3- Graphic LCD with Touch Panel
Liquid Crystal Display
1- Character LCD
Character LCDs are ideal for displaying text. They can also be
configured to display small icons but the icons must be only
5x7 pixels (very small!).
If you look closely to your LCD you can see little rectangles
where the characters are displayed. Each rectangle is a grid of
pixels.
3
Liquid Crystal Display
2- Graphic LCD
The graphical LCD has one big grid of pixels (in this case
128x64 of them) - It can display text but its best at displaying
images. Graphical LCDs tend to be larger, more expensive,
difficult to use and need many more pins because of the
complexity added.
4
Liquid Crystal Display
3- Graphic LCD with Touch Panel
This type of LCD also has one big grid of pixels and in addition
to that, it can be used as input screen too, so the user can
select some functionality to be done by using the touch
feature of this LCD.
5
Character LCD
6
:Character LCD pin out
The LCDs have a parallel interface, meaning that the microcontroller has to
manipulate several interface pins at once to control the display. The
interface consists of the following pins:
Liquid Crystal Display
• Register Select (RS) pin:
It controls where in the LCD's memory you're writing data to.
You can select either the data register, which holds what goes
on the screen, or an instruction register, which is where the
LCD's controller looks for instructions on what to do next.
• Read/Write (R/W) pin:
It selects reading mode or writing mode.
• Enable (E) pin:
It enables writing to the registers
7
Liquid Crystal Display
• Display Contrast (Vo) pin:
To control the display contrast.
• Power supply (+5V and GND) pins:
To power the LCD.
• LED Backlight (BKlt+ and BKlt-) pins:
To turn on and off the LED backlight.
• 8 Data (D0 -D7) pins:
The states of these pins (high or low) are the bits that you're
writing to a register when you write, or the values you're
reading when you read
8
Liquid Crystal Display
9
The process of controlling the display involves putting the data of
what you want to display into the data registers, then putting
instructions in the instruction register.
The LiquidCrystal Library simplifies this for you so you don't need
to know the low-level instructions.
The Liquid Crystal Library allows you to control LCD displays that
are compatible with the Hitachi HD44780 driver.The Hitachi-
compatible LCDs can be controlled in two modes:
4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the
Arduino, while the 8-bit mode requires 11 pins. For displaying
text on the screen, you can do most everything in 4-bit mode.
Liquid Crystal Display
Example:
The following example shows how to control a 2x16 LCD in 4-bit
mode.
Hardware Requirement
To build such application, you need the following components:
10
• Arduino Uno
• USB cable
• 16×2 Character LCD
• Jumper wires
Liquid Crystal Display
11
LCD to Arduino Uno Connections:
Liquid Crystal Display
12
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd( 12 , 11 , 5 , 4 , 3 , 2 );
int backlightPin = 10;
int ContrastPin = 6;
void setup( )
{
pinMode( backlightPin , OUTPUT );
analogWrite( backlightPin , 100 );
pinMode(ContrastPin,OUTPUT);
analogWrite( ContrastPin , 255 );
Liquid Crystal Display
13
// set up the LCD's number of columns and rows:
lcd.begin( 16, 2 );
// set the cursor to column 0, row 0
lcd.setCursor( 0 , 0 );
// Print a message to the LCD.
lcd.print( "Hi" );
lcd.setCursor( 0 , 1 );
// Print a message to the LCD.
lcd.print( "CS Students... " );
}
void loop( )
{
}
Speaker
14
Speaker
15
A speaker, buzzer, or beeper is an audio signaling device
(making beeps, tones and alerts). Typical uses of this device
include alarm devices, timers, and confirmation of user input
such as a mouse click or keystroke.
To build such application, you need
the following components:
• Arduino Uno
• USB cable
•Breadboard
• Speaker
• Jumper wires
Connect up
16
Inter the Code
17
int speakerPin =6;
int numTones = 10;
int tones[ ] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440};
void setup( )
{
for ( int i = 0; i < numTones; i++ )
{
tone( speakerPin, tones[ i ] );
delay( 500 );
}
noTone( speakerPin );
}
void loop( )
{
}
Speaker
18
To play a note of a particular pitch, you specify the frequency.
The different frequencies for each note are kept in an array.
An array is like a list. So, a scale can be played by playing each
of the notes in the list in turn. The 'for' loop will count from 0
to 9 using the variable 'i'. To get the frequency of the note to
play at each step, we use 'tone[i]'. This means, the value in
the 'tones' array at position 'i'. So, for example, 'tones[0]' is
261, 'tones[1]' is 277 etc.
The Arduino command 'tone' takes two parameters, the first
is the pin to play the tone on and the second is the frequency
of the tone to play.
Speaker
19
When all the notes have been played, the 'noTone' command
stops that pin playing any tone. We could have put the tone
playing code into 'loop' rather than 'setup', but frankly the
same scale being played over and over again gets a bit
tiresome. So in this case, 'loop' is empty. To play the tune
again, just press the reset button.
Sound waves are vibrations in the air pressure. The speed of
the vibrations (cycles per second or Hertz) is what makes the
pitch of the sound. The higher the frequency of the vibration,
the higher the pitch.
Speaker
20
To hear the output, we need to attach something that will
convert the electrical signal into sound waves. This can be done
with a loudspeaker or as we have used here a piezo sounder.
Piezo sounders use a special crystal that expands and contracts
as an electrical signal passes through it. This will generate a tone
that we can hear.

More Related Content

PDF
Setup sd card for ubuntu on pandaboard
PPT
B Intro2 Pc
ODP
Micro presentation.
PPTX
Brain to Brain - Journey of Mouse click
DOCX
Lcd interfacing
PPTX
LCD Interacing with 8051
PPTX
LCD (2).pptx
PDF
Hd44780a00 dtasheet
Setup sd card for ubuntu on pandaboard
B Intro2 Pc
Micro presentation.
Brain to Brain - Journey of Mouse click
Lcd interfacing
LCD Interacing with 8051
LCD (2).pptx
Hd44780a00 dtasheet

Similar to Arduino based applications part 2 (20)

DOCX
Lcd display
PPTX
Electronz_Chapter_11.pptx
PPT
Lcd interface with atmega32 avr best.ppt
DOCX
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
PPTX
131080111003 mci
PDF
Learn LCD Arduino-v1
PDF
Embedded C Programming Module 7 Presentation
PDF
Microcontroller part 4
PPT
fixed-point-vs-floating-point.ppt
PDF
Lcd tutorial
PPTX
Liquid crystal display
PPTX
Lcd interfacing with microprocessor 8051
DOCX
Interfacing to
PDF
AVR_Course_Day5 avr interfaces
PPT
Presentation2 1-150523155048-lva1-app6892
PPTX
Bidirect visitor counter
PDF
L14 kb-lcd-interfacing-with-atmega328 p
PDF
Arduino: Arduino lcd
DOC
Moving message display
Lcd display
Electronz_Chapter_11.pptx
Lcd interface with atmega32 avr best.ppt
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
131080111003 mci
Learn LCD Arduino-v1
Embedded C Programming Module 7 Presentation
Microcontroller part 4
fixed-point-vs-floating-point.ppt
Lcd tutorial
Liquid crystal display
Lcd interfacing with microprocessor 8051
Interfacing to
AVR_Course_Day5 avr interfaces
Presentation2 1-150523155048-lva1-app6892
Bidirect visitor counter
L14 kb-lcd-interfacing-with-atmega328 p
Arduino: Arduino lcd
Moving message display
Ad

More from Jawaher Abdulwahab Fadhil (20)

PDF
PPT
PDF
Add instruction-part1
PPTX
Dealing with 8086 memory
PPTX
MOV instruction part1
PDF
Cisco webex installation guide
PPTX
A survey on the applications of smart home
PPT
Flag register and add instruction
PDF
Computer Organization -part 1
PPTX
iOS Operating System
PPTX
Android Operating system
PPTX
Types of Mobile Applications
PDF
Ultrasonic with buzzer
PDF
Lecture6 modulation
PDF
Lecture 5: The Convolution Sum
PDF
Lecture 4: Classification of system
PDF
Lecture3: Operations of Ct signals
PDF
Lecture2 : Common continuous time signals
PDF
Lecture1: Introduction to signals
PDF
Arduino- Serial communication
Add instruction-part1
Dealing with 8086 memory
MOV instruction part1
Cisco webex installation guide
A survey on the applications of smart home
Flag register and add instruction
Computer Organization -part 1
iOS Operating System
Android Operating system
Types of Mobile Applications
Ultrasonic with buzzer
Lecture6 modulation
Lecture 5: The Convolution Sum
Lecture 4: Classification of system
Lecture3: Operations of Ct signals
Lecture2 : Common continuous time signals
Lecture1: Introduction to signals
Arduino- Serial communication
Ad

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PDF
Pre independence Education in Inndia.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Business Ethics Teaching Materials for college
PPTX
Institutional Correction lecture only . . .
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Cell Structure & Organelles in detailed.
Pre independence Education in Inndia.pdf
Final Presentation General Medicine 03-08-2024.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Week 4 Term 3 Study Techniques revisited.pptx
TR - Agricultural Crops Production NC III.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Business Ethics Teaching Materials for college
Institutional Correction lecture only . . .
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Cell Types and Its function , kingdom of life
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pharma ospi slides which help in ospi learning
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx

Arduino based applications part 2

  • 2. Liquid Crystal Display 2 LCDs are available to display characters, arbitrary images (as in a general-purpose computer display) or fixed images which can be displayed or hidden, such as preset words, digits, and 7-segment displays as in a digital clock. They use the same basic technology, except that arbitrary images are made up of a large number of small pixels, while other displays have larger elements. Some types of LCDs: 1- Character LCD 2- Graphic LCD 3- Graphic LCD with Touch Panel
  • 3. Liquid Crystal Display 1- Character LCD Character LCDs are ideal for displaying text. They can also be configured to display small icons but the icons must be only 5x7 pixels (very small!). If you look closely to your LCD you can see little rectangles where the characters are displayed. Each rectangle is a grid of pixels. 3
  • 4. Liquid Crystal Display 2- Graphic LCD The graphical LCD has one big grid of pixels (in this case 128x64 of them) - It can display text but its best at displaying images. Graphical LCDs tend to be larger, more expensive, difficult to use and need many more pins because of the complexity added. 4
  • 5. Liquid Crystal Display 3- Graphic LCD with Touch Panel This type of LCD also has one big grid of pixels and in addition to that, it can be used as input screen too, so the user can select some functionality to be done by using the touch feature of this LCD. 5
  • 6. Character LCD 6 :Character LCD pin out The LCDs have a parallel interface, meaning that the microcontroller has to manipulate several interface pins at once to control the display. The interface consists of the following pins:
  • 7. Liquid Crystal Display • Register Select (RS) pin: It controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next. • Read/Write (R/W) pin: It selects reading mode or writing mode. • Enable (E) pin: It enables writing to the registers 7
  • 8. Liquid Crystal Display • Display Contrast (Vo) pin: To control the display contrast. • Power supply (+5V and GND) pins: To power the LCD. • LED Backlight (BKlt+ and BKlt-) pins: To turn on and off the LED backlight. • 8 Data (D0 -D7) pins: The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read 8
  • 9. Liquid Crystal Display 9 The process of controlling the display involves putting the data of what you want to display into the data registers, then putting instructions in the instruction register. The LiquidCrystal Library simplifies this for you so you don't need to know the low-level instructions. The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver.The Hitachi- compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode.
  • 10. Liquid Crystal Display Example: The following example shows how to control a 2x16 LCD in 4-bit mode. Hardware Requirement To build such application, you need the following components: 10 • Arduino Uno • USB cable • 16×2 Character LCD • Jumper wires
  • 11. Liquid Crystal Display 11 LCD to Arduino Uno Connections:
  • 12. Liquid Crystal Display 12 #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd( 12 , 11 , 5 , 4 , 3 , 2 ); int backlightPin = 10; int ContrastPin = 6; void setup( ) { pinMode( backlightPin , OUTPUT ); analogWrite( backlightPin , 100 ); pinMode(ContrastPin,OUTPUT); analogWrite( ContrastPin , 255 );
  • 13. Liquid Crystal Display 13 // set up the LCD's number of columns and rows: lcd.begin( 16, 2 ); // set the cursor to column 0, row 0 lcd.setCursor( 0 , 0 ); // Print a message to the LCD. lcd.print( "Hi" ); lcd.setCursor( 0 , 1 ); // Print a message to the LCD. lcd.print( "CS Students... " ); } void loop( ) { }
  • 15. Speaker 15 A speaker, buzzer, or beeper is an audio signaling device (making beeps, tones and alerts). Typical uses of this device include alarm devices, timers, and confirmation of user input such as a mouse click or keystroke. To build such application, you need the following components: • Arduino Uno • USB cable •Breadboard • Speaker • Jumper wires
  • 17. Inter the Code 17 int speakerPin =6; int numTones = 10; int tones[ ] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440}; void setup( ) { for ( int i = 0; i < numTones; i++ ) { tone( speakerPin, tones[ i ] ); delay( 500 ); } noTone( speakerPin ); } void loop( ) { }
  • 18. Speaker 18 To play a note of a particular pitch, you specify the frequency. The different frequencies for each note are kept in an array. An array is like a list. So, a scale can be played by playing each of the notes in the list in turn. The 'for' loop will count from 0 to 9 using the variable 'i'. To get the frequency of the note to play at each step, we use 'tone[i]'. This means, the value in the 'tones' array at position 'i'. So, for example, 'tones[0]' is 261, 'tones[1]' is 277 etc. The Arduino command 'tone' takes two parameters, the first is the pin to play the tone on and the second is the frequency of the tone to play.
  • 19. Speaker 19 When all the notes have been played, the 'noTone' command stops that pin playing any tone. We could have put the tone playing code into 'loop' rather than 'setup', but frankly the same scale being played over and over again gets a bit tiresome. So in this case, 'loop' is empty. To play the tune again, just press the reset button. Sound waves are vibrations in the air pressure. The speed of the vibrations (cycles per second or Hertz) is what makes the pitch of the sound. The higher the frequency of the vibration, the higher the pitch.
  • 20. Speaker 20 To hear the output, we need to attach something that will convert the electrical signal into sound waves. This can be done with a loudspeaker or as we have used here a piezo sounder. Piezo sounders use a special crystal that expands and contracts as an electrical signal passes through it. This will generate a tone that we can hear.