Lab 11 - Iot - Nobicode

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

LAB 11: LCD (Liquid Crystal Display)

• LCD modules in market, the most commonly used one is 16×2 LCD Module which can display 32 ASCII characters
in 2 lines (16 characters in 1 line).
• Other commonly used LCD displays are 20×4 Character LCD, Nokia 5110 LCD module, 128×64 Graphical LCD
Display and 2.4 inch TFT Touch screen LCD display.
• The JHD162A has 16 pins and can be operated in 4-bit mode (using only 4 data lines) or 8-bit mode (using all 8
data lines).

IOT101_NOBICODE
LAB 11: LCD (Liquid Crystal Display)
16×2 LCD Module Pin Out Diagram
• Pin1(Vss):Ground pin of the LCD module.
• Pin2(Vcc): Power to LCD module (+5V supply is given to this pin)
• Pin3(VEE):Contrast adjustment pin. This is done by connecting
the ends of a 10K potentimeter to +5V and ground and then connecting the slider pin to the VEE pin. The voltage
at the VEE pin defines the contrast. The normal setting is between 0.4 and 0.9V.
• Pin4(RS):Register select pin.The JHD162A has two registers namely command registerand data register.
Logic HIGH at RS pin selects data register and logic LOW at RS pin selects command register. If we make the RS
pin HIGH and feed an input to the data lines (DB0 to DB7), this input will be treated as data to display on LCD
screen. If we make the RS pin LOW and feed an input to the data lines, then this will be treated as a command ( a
command to be written to LCD controller – like positioning cursor or clear screen or scroll).
• Pin5(R/W): Read/Write modes. This pin is used for selecting between read and write modes. Logic HIGH at this
pin activates read mode and logic LOW at this pin activates write mode.
• Pin6(E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at this pin will enable the
module.
• Pin7(DB0) to Pin14(DB7): Â These are data pins. The commands and data are fed to the LCD module though
these pins.
• Pin15(LED+): Anode of the back light LED. When operated on 5V, a 560 ohm resistor should be connected in
series to this pin. In arduino based projects the back light LED can be powered from the 3.3V source on the
arduino board.
• Pin16(LED-): Cathode of the back light LED.
IOT101_NOBICODE
LAB 11: LCD (Liquid Crystal Display)
16×2 LCD Module Pin Out Diagram

IOT101_NOBICODE
LAB 11: LCD (Liquid Crystal Display)

• RS pin is connected to digital pin 12.


• R/W pin is grounded.
• Enable pin is connected to digital pin 11.
• In this project, the LCD module and arduino are interfaced in the 4-bit mode.
• Digital lines DB4, DB5, DB6 and DB7 are interfaced to digital pins 5, 4, 3 and 2.
• The 10K potentiometer is used for adjusting the contrast of the display.
• 560 ohm resistor R1 limits the current through the back light LED.
• data string can be printed on the LCD module by merely calling a method lcd.print()
If you want to print “Hello World” at row 1, starting from column 3; first set the cursor at
the desired position using method lcd.setCursor(1,3) and then write the command to
print the characters as lcd.print(“Hello World”);

IOT101_NOBICODE
LAB 11: LCD (Liquid Crystal Display)

IOT101_NOBICODE
LAB 11: LCD (Liquid Crystal Display)

1. #include<LiquidCrystal.h>
2. LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // sets the interfacing pins
3. void setup() {
1.lcd.begin(16, 2); // initializes the 16x2 LCD }
4. void loop() {
1. lcd.setCursor(0,0); //sets the cursor at row 0 column 0
2. lcd.print("16x2 LCD MODULE"); // prints 16x2 LCD MODULE
3. lcd.setCursor(2,1); //sets the cursor at row 1 column 2
4. lcd.print("HELLO WORLD"); // prints HELLO WORLD }

IOT101_NOBICODE

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy