I2c 2004 LCD
I2c 2004 LCD
User Guide
SKU: DSP-1165
Brief Data:
Compatible with Arduino Board or other controller board with I2C bus.
Display Type: Black on yellow green backlight.
I2C Address:0x38-0x3F (0x3F default)
Supply voltage: 5V
Interface: I2C to 4bits LCD data and control lines.
Contrast Adjustment : built-in Potentiometer.
Backlight Control: Firmware or jumper wire.
Board Size: 98x60 mm.
1 www.handsontec.com
Setting Up:
Hitachi’s HD44780 based character LCD are very cheap and widely available, and is an essential part for any project
that displays information. Using the LCD piggy-back board, desired data can be displayed on the LCD through the
I2C bus. In principle, such backpacks are built around PCF8574 (from NXP) which is a general purpose bidirectional
8 bit I/O port expander that uses the I2C protocol. The PCF8574 is a silicon CMOS circuit provides general purpose
remote I/O expansion (an 8-bit quasi-bidirectional) for most microcontroller families via the two-line bidirectional bus
(I2C-bus). Note that most piggy-back modules are centered around PCF8574T (SO16 package of PCF8574 in DIP16
package) with a default slave address of 0x27. If your piggy-back board holds a PCF8574AT chip, then the default
slave address will change to 0x3F. In short, if the piggy-back board is based on PCF8574T and the address
connections (A0-A1-A2) are not bridged with solder it will have the slave address 0x27.
2 www.handsontec.com
Reference circuit diagram of the I2C-to-LCD piggy-back board.
3 www.handsontec.com
Arduino Setup
For this experiment it is necessary to download and install the “Arduino I2C LCD” library. First of all, rename the
existing “LiquidCrystal” library folder in your Arduino libraries folder as a backup, and proceed to the rest of the
process.
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
Next, copy-paste this example sketch Listing-1 for the experiment into the blank code window, verify, and then
upload.
Arduino Sketch Listing-1:
/*==========================================================================
// Author : Handson Technology
// Project : I2C to LCD with Arduino Uno
// Description : LCD with I2C Interface.
// LiquidCrystal Library - I2C Serial to LCD
// Source-Code : I2C_LCD.ino
//==========================================================================
*/
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
// set the LCD address to 0x3F for PCF8574AT with A0,A1,A0 address line open, default
setting.
// Set the pins on the I2C chip used for LCD connections:
// (addr, en,rw,rs,d4,d5,d6,d7,bl,blpol)
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C
address
4 www.handsontec.com
delay(1000);
lcd.setCursor(0,2);
lcd.print("20 by 4 Line Display");
lcd.setCursor(0,3);
delay(2000);
lcd.print(" www.handsontec.com ");
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters
to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Start Serial Monitor");
lcd.setCursor(0,1);
lcd.print("Type char to display");
/* ( THE END ) */
If you are 100% sure that everything is okay, but you don’t see any characters on the display, try to adjust the contrast
control pot of the backpack and set it a position where the characters are bright and the background does not have dirty
boxes behind the characters. Following is a partial view of author’s experiment with the above described code with
20x4 display module. Since the display used by the author is a very clear bright “black on yellow” type, it is very
difficult to get a good catch due to polarization effects.
5 www.handsontec.com
This sketch will also display character send from serial Monitor:
In Arduino IDE, go to “Tools” > “Serial Monitor”. Set the correct baud rate at 9600. Type the character on the top
empty space and hit “SEND”.
Resources:
Handson Technology
Lelong.com.my
6 www.handsontec.com
Handsontec. com
7 www.handsontec.com
The Face behind our product quality…
In a world of constant change and continuous technological development, a new or replacement
product is never far away – and they all need to be tested.
Many vendors simply import and sell wihtout checks and this cannot be the ultimate interests of
anyone, particularly the customer. Every part sell on Handsotec is fully tested. So when buying from
Handsontec products range, you can be confident you’re getting outstanding quality and value.
We keep adding the new parts so that you can get rolling on your next project.
P
Engineering Material Mechanical Hardware Electronics Components
8 www.handsontec.com
GDM2004D-FL-YBW SPECIFICATIONS OF
LCD MODULE
1.Features
1. 5x8 dots with cursor
2. STN(Yellow-Green), Positive, Transflective
3. 1/16 duty cycle
4. Viewing direction: 6:00 o’clock
5. Built-in controller (S6A0069 or equivalent)
6. +5V power supply
7. Yellow-Green LED BKL ,to be driven by A, K
2.Outline dimension
Unit: mm
3.Absolute maximum ratings
Item Symbol Standard Unit
Power voltage VDD-VSS 0 - 7.0
V
Input voltage Vin VSS - VDD
Operating temperature range Top -20 - +70
℃
Storage temperature range Tst -30 - +80
GDM2004D-FL-YBW
4.Block diagram
6.Contrast adjust
V: B 2/18 2008/06/02
GDM2004D-FL-YBW
7.Optical characteristics
θ1 φ1 φ2
θ2
12:00
9:00 3:00
6:00
STN type display module (Ta=25℃, VDD=5.0V)
Item Symbol Condition Min. Typ. Max. Unit
θ1 20
θ2 40
Viewing angle Cr≥3 deg
Φ1 35
Φ2 35
Contrast ratio Cr - 10 - -
Response time (rise) Tr - - 200 250
ms
Response time (fall) Tr - - 300 350
8.Electrical characteristics
Backlight circuit diagram(light 12X4)
COLOUR: YELLOW-GREEN
LED RATINGS
ITEM SYMBOL MIN TYP. MAX UNIT
FORWARD VOLTAGE VF 4.0 4.2 4.4 V
FORWARD CURRENT IF - 240 - MA
POWER P - 1.0 - W
PEAK WAVE LENGTH ΛP 569 571 573 NM
LUMINANCE LV - 340 - CD/M2
Operating temperature range Vop -20 - +70
℃
Storage temperature range Vst -25 - +80
DC characteristics
Parameter Symbol Conditions Min. Typ. Max. Unit
Supply voltage for LCD VDD-V0 Ta =25℃ - 4.5 - V
Input voltage VDD 4.7 5.0 5.5
Supply current IDD Ta=25℃, VDD=5.0V - 1.5 2.5 mA
Input leakage current ILKG - - 1.0 uA
“H” level input voltage VIH 2.2 - VDD V
“L” level input voltage VIL Twice initial value or less 0 - 0.6
“H” level output voltage VOH LOH=-0.25mA 2.4 - -
V: B 3/18 2008/06/02
GDM2004D-FL-YBW
“L” level output voltage VOL LOH=1.6mA - - 0.4
Backlight supply current IF VDD=5.0V,R=6.8Ω - 240 -
Write cycle (Ta=25℃, VDD=5.0V)
Parameter Symbol Test pin Min. Typ. Max. Unit
Enable cycle time tc 500 - -
Enable pulse width tw E 230 - -
Enable rise/fall time tr, tf - - 20
RS; R/W setup time tsu1 40 - - ns
RS; R/W
RS; R/W address hold time th1 10 - -
Data output delay tsu2 80 - -
DB0~DB7
Data hold time th2 10 - -
Write mode timing diagram
V: B 4/18 2008/06/02
GDM2004D-FL-YBW
Read mode timing diagram
9. FUNCTION DESCRIPTION
System Interface
This chip has all two kinds of interface type with MPU : 4-bit bus and 8-bit bus. 4-bit bus and 8-bit bus is
selected by DL bit in the instruction register.
Busy Flag (BF)
When BF = "High", it indicates that the internal operation is being processed. So during this time the next
instruction cannot be accepted. BF can be read, when RS = Low and R/W = High (Read Instruction Operation),
through DB7 port. Before executing the next instruction, be sure that BF is not high.
V: B 5/18 2008/06/02
GDM2004D-FL-YBW
Relationship between CGRAM Addresses, Character Codes (DDRAM) and Character patterns (CGRAM Data)
Notes:
1. Character code bits 0 to 2 correspond to CGRAM address bits 3 to 5 (3 bits: 8 types).
2. CGRAM address bits 0 to 2 designate the character pattern line position. The 8th line is the cursor position
and its display is formed by a logical OR with the cursor. Maintain the 8th line data, corresponding to the cursor
display position, at 0 as the cursor display. If the 8th line data is 1, 1 bit will light up the 8th line regardless of
the cursor presence.
3. Character pattern row positions correspond to CGRAM data bits 0 to 4 (bit 4 being at the left).
4. As shown Table, CGRAM character patterns are selected when character code bits 4 to 7 are all 0. However,
since character code bit 3 has no effect, the R display example above can be selected by either character code
00H or 08H.
5. 1 for CGRAM data corresponds to display selection and 0 to non-selection.
“-“: Indicates no effect.
10.Instruction description
Outline
To overcome the speed difference between the internal clock of S6A0069 and the MPU clock, S6A0069
performs internal operations by storing control in formations to IR or DR. The internal operation is determined
according to the signal from MPU, composed of read/write and data bus (Refer to Table7).
Instructions can be divided largely into four groups:
1) S6A0069 function set instructions (set display methods, set data length, etc.)
2) Address set instructions to internal RAM
3) Data transfer instructions with internal RAM
4) Others
The address of the internal RAM is automatically increased or decreased by 1.
NOTE:
When an MPU program with checking the busy flag (DB7) is made, it must be necessary 1/2fosc is necessary
for executing the next instruction by the falling edge of the “E” signal after the busy flag (DB7) goes to
“Low”.
Contents
1) Clear display
Clear all the display data by writing “20H” (space code) to all DDRAM address, and set DDRAM address
to “00H” into AC (address counter).
Return cursor to the original status, namely, bring the cursor to the left edge on the fist line of the display.
Make the entry mode increment (I/D=“High”).
2) Return home
V: B 7/18 2008/06/02
GDM2004D-FL-YBW
Shifting of right/left cursor position or display without writing or reading of display data.
This instruction is used to correct or search display data.
During 2-line mode display, cursor moves to the 2nd line after the 40th digit of the 1st line.
Note that display shift is performed simultaneously in all the lines.
When display data is shifted repeatedly, each line is shifted individually.
When display shift is performed, the contents of the address counter are not changed.
6) Function set
V: B 9/18 2008/06/02
GDM2004D-FL-YBW
11) Read data from RAM
V: B 10/18 2008/06/02
GDM2004D-FL-YBW
Standard character pattern(English/European )
V: B 11/18 2008/06/02
GDM2004D-FL-YBW
11.Quality Specifications
11.1 Standard of the product appearance test
Manner of appearance test: The inspection should be performed in using 20W x 2 fluorescent lamps.
Distance between LCM and fluorescent lamps should be 100 cm or more. Distance between LCM and
inspector eyes should be 25 cm or more.
Viewing direction for inspection is 35° from vertical against LCM.
LCM
Definition of zone:
A Zone
B Zone
V: B 12/18 2008/06/02
GDM2004D-FL-YBW
LC leakage
Flickering
No display
Wrong Back-light
Unit:Inch2
4 Line defect,
W
Line Acceptable Qty.
Scratch L W
L --- 0.05>W
3.0>L 0.1>W>0.05 Disregard
2.0>L 0.15≥W>0.1
Unit: mm
5 Rainbow Not more than two color changes across the viewing area.
V: B 13/18 2008/06/02
GDM2004D-FL-YBW
No Item Criterion
6 Chip
Acceptable criterion
X Y Z
Remark:
< L /8 0.5mm ≤t/2
X: Length direction
Y: Short direction
Z: Thickness direction
t: Glass thickness
W: Terminal width
L: Glass length Acceptable criterion
X Y X Y Z
≤2 0.5mm ≤t
Acceptable criterion
X Y Z
≤3 ≤2 ≤t
Y shall not reach to ITO
Acceptable criterion
W
Y X Y Z
Disregard ≤0.2 ≤t
Z
X
Y Acceptable criterion
X Y Z
≤5 ≤2 ≤t/3
Z
X
V: B 14/18 2008/06/02
GDM2004D-FL-YBW
8 Back-light
(1) The color of backlight should be in match with the
specification.
(2) Not allow flickering
9 Soldering
(1) Not allow heavy dirty and solder ball on PCB.
(The size of dirty refer to point and dust defect)
(2) Over 50% of lead should be soldered on Land.
Lead
Land
50% lead
10 Wire
(1) Copper wire should not be rusted
(2) Not allow crack on copper wire connection.
(3) Not allow reversing the position of the flat cable.
(4) Not allow exposed copper wire inside the flat cable.
11* PCB
(1) Not allow screw rust or damage.
(2) Not allow missing or wrong putting of component.
V: B 15/18 2008/06/02
GDM2004D-FL-YBW
No Item Criterion
12 Protruded
13 TAB
1. Position
W
W1
ITO W1≤1/3W
H H1≤1/3H
H1 TAB
TAB
B. Zone
It is acceptable when it is no trouble for quality and assembly in customer’s end
product.
V: B 16/18 2008/06/02
GDM2004D-FL-YBW
Recovery time should be 24 hours minimum. Moreover, functions, performance and appearance shall be free from
remarkable deterioration within 50,000 hours under ordinary operating and storage conditions room temperature
(20+8°C), normal humidity (below 65% RH), and in the area not exposed to direct sun light.
General Precautions:
1. LCD panel is made of glass. Avoid excessive mechanical shock or applying strong pressure onto the surface of
display area.
2. The polarizer used on the display surface is easily scratched and damaged. Extreme care should be taken when
handling. To clean dust or dirt off the display surface, wipe gently with cotton, or other soft material soaked with
isoproply alcohol, ethyl alcohol or trichlorotriflorothane, do not use water, ketone or aromatics and never scrub hard.
3. Do not tamper in any way with the tabs on the metal frame.
4. Do not make any modification on the PCB without consulting XIAMEM OCULAR
5. When mounting a LCM, make sure that the PCB is not under any stress such as bending or twisting. Elastomer
contacts are very delicate and missing pixels could result from slight dislocation of any of the elements.
6. Avoid pressing on the metal bezel, otherwise the elastomer connector could be deformed and lose contact,
resulting in missing pixels and also cause rainbow on the display.
7. Be careful not to touch or swallow liquid crystal that might leak from a damaged cell. Any liquid crystal spreads
to skin or clothes, wash it off immediately with soap and water.
V: B 17/18 2008/06/02
GDM2004D-FL-YBW
terminals with any parts of the human body.
3. Do not touch the connection terminals of the display with bare hand; it will cause disconnection or defective
insulation of terminals.
4. The modules should be kept in anti-static bags or other containers resistant to static for storage.
5. Only properly grounded soldering irons should be used.
6. If an electric screwdriver is used, it should be grounded and shielded to prevent sparks.
7. The normal static prevention measures should be observed for work clothes and working benches.
8. Since dry air is inductive to static, a relative humidity of 50-60% is recommended.
Soldering Precautions:
1. Soldering should be performed only on the I/O terminals.
2. Use soldering irons with proper grounding and no leakage.
3. Soldering temperature: 280°C+10°C
4. Soldering time: 3 to 4 second.
5. Use eutectic solder with resin flux filling.
6. If flux is used, the LCD surface should be protected to avoid spattering flux.
7. Flux residue should be removed.
Operation Precautions:
1. The viewing angle can be adjusted by varying the LCD driving voltage Vo.
2. Since applied DC voltage causes electro-chemical reactions, which deteriorate the display, the applied pulse
waveform should be a symmetric waveform such that no DC component remains. Be sure to use the specified
operating voltage.
3. Driving voltage should be kept within specified range; excess voltage will shorten display life.
4. Response time increases with decrease in temperature.
5. Display color may be affected at temperatures above its operational range.
6. Keep the temperature within the specified range usage and storage. Excessive temperature and humidity could
cause polarization degradation, polarizer peel-off or generate bubbles.
7. For long-term storage over 40°C is required, the relative humidity should be kept below 60%, and avoid direct
sunlight.
V: B 18/18 2008/06/02