|
HOMEABOUT US!YourDuinoShopNEWSLETTERSBLOGTHIS WIKI:WHAT IS Arduino? LEARNING Arduino: ARDUINO HOWTO:
BJK ZZ |
|
Contributions to http://arduino-info.wikispaces.com/ are licensed under a Creative Commons Attribution Non-Commercial 3.0 License. Portions not contributed by visitors are Copyright 2013 Tangient LLC |
LCD Displays (Blue and YELLOW) with I2C/TWI Interface
ALL the displays will now use the great Library written by F Malpartida . You should download that Library HERE (Click)
NOTE! THERE ARE THREE (or More??) VERSIONS OF THE 2 and 4 LINE DISPLAYS. Check the small "backpack" interface board on the back.
LCD Version 1 - Marked "YwRobot Arduino LCM1602 IIC V1"
LCD Version 2 - Marked "Arduino-IIC-LCD GY-LCD-V1"
LCD Version 3 - Marked "LCM1602 IIC A0 A1 A2"
These displays are Available HERE:
NOTE! These displays are very clear bright white on dark blue (or Black on Yellow) background: it is difficult to get a good digital photo due to polarization effects.
WHY THE I2C (IIC) TYPE LCD DISPLAY?
To use this type LCD directly with Arduino, you would need 6 pins: RS, EN, D7, D6, D5, and D4 to talk to the LCD. If you are doing more than a simple project, you may be out of pins using a normal LCD shield. With this I2C interface LCD module, you only need 2 lines (I2C) to display information. If you already have I2C devices in your project, this LCD module actually uses no more pins at all. More information about I2C/TWI (Wikipedia)This unit connects with 4 wires including Vcc and Gnd. It is easiest with a 4-wire cable (supplied) that plugs into the Sensor Shield communications connector.
But you can wire it directly yourself if needed: There are 4 pins on the display.. (see photo below)
Top to bottom:
GND - GND
VCC - 5V
SDA - ANALOG Pin 4
SCL - ANALOG pin 5
On most Arduino boards, SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5. On the Arduino Mega, SDA is digital pin 20 and SCL is 21.
NOTE: The Blue Potentiometer (Photo) adjusts Contrast. If you don't see any characters, adjust it. Start clockwise and back down to where the characters are bright and the background does not have boxes behind the characters.
See a LCD used in the Temperature-Humidity project.
LiquidCrystal_I2C Library Support Functions
See the "Docs" folder within the Library folder. There are many advanced functions.Below are Example Software Sketches for different displays. They will display characters you type on the Serial Monitor screen on the LCD. NOTE: Line 1 only is correct when writing a long sequence of characters. The characters fill the first line and continue on the third, due to the way the LCD internal addressing works. So this is "normal" and has to do with the LCD hardware. Usually you will set the cursor position before writing characters. (Details in the document linked at the end of this page, if you want them.)
(Cut and paste these examples into a blank page on the Arduino IDE).
I2C LCD DISPLAY VERSION 1:
Example Software Sketch for 2 line 16 character Displays:
(NOTE: for displays with backpack interface labelled "YwRobot Arduino LCM1602 IIC V1")Example Software Sketch for 4 line 20 character Displays:
(NOTE: for displays with backpack interface labelled "YwRobot Arduino LCM1602 IIC V1")I2C LCD DISPLAY VERSION 2:
Marked "Arduino-IIC-LCD GY-LCD-V1"NOTE: The wire connections are in a different order! See the labels on the PC Board.
NEW TYPE 4 line 20 character Displays: Example Software Sketch
I2C LCD DISPLAY VERSION 3:
This has Yet Another I2C board type marked "LCM1602 IIC A0 A1 A2" (Photo)You need the same new library in the section above.
Here's an example Software Sketch that works with this display. Copy this and paste into blank Arduino IDE window. Verify (Need the library above installed), then upload.
Detailed information about LCD displays from Donald Weiman (weimandn@alfredstate.edu)
z