Required Hardware
Controlling an Lcd Display (HD44780) via I2C Bus. Learn in this tutorial how to connect your Lcd Display with Arduino using only 2 pins, to make this you will need an PCF8574A Expander. The PCF8574 extender is available in two versions, the PCF8574 and the PCF8574A. The only difference between the two is the I2C base address. The base address for the PCF8574 is 0x20 and the base address for the PCF8574A is 0x38.
Wiring
To wire your LCD screen to your Arduino via PCF8574A, connect the following pins:
- Lcd Pin 1 (Vss) –> Arduino Ground
- Lcd Pin 2 (Vdd) –> Arduino +5V
- Lcd Pin 3 (Vo) –> Middle Pin of Potentiometer 10K
- Lcd Pin 4 (Rs) –> Pcf8574 Pin 11
- Lcd Pin 5 (Rw) –> Pcf8574 Pin 10
- Lcd Pin 6 (E) –> Pcf8574 Pin 9
- Lcd Pin 7-10 –> N/C
- Lcd Pin 11 (D4) –> Pcf8574 Pin 4
- Lcd Pin 12 (D5) –> Pcf8574 Pin 5
- Lcd Pin 13 (D6) –> Pcf8574 Pin 6
- Lcd Pin 14 (D7) –> Pcf8574 Pin 7
- Lcd Pin 15 (A) –> Arduino +3.3V
- Lcd Pin 16 (K) –> Arduino Ground
- Don’t forget to connect and the other 2 pins of potentiometer to Ground and +5V.
To wire your PCF8574A Expander to your Arduino, connect the following pins:
- Pin 1 (A0) –> Arduino Ground
- Pin 2 (A1) –> Arduino Ground
- Pin 3 (A2) –> Arduino Ground
- Pin 4 (P0) –> Lcd Pin 11
- Pin 5 (P1) –> Lcd Pin 12
- Pin 6 (P2) –> Lcd Pin 13
- Pin 7 (P3) –> Lcd Pin 14
- Pin 8 (Vss) –> Arduino Ground
- Pin 9 (P4) –> Lcd Pin 6
- Pin 10 (P5) –> Lcd Pin 5
- Pin 11 (P6) –> Lcd Pin 4
- Pin 12-13 –> N/C
- Pin 14 (Scl) –> Arduino Pin A5
- Pin 15 (Sda) –> Arduino Pin A4
- Pin 16 (Vdd) –> Arduino +5V
Recommended Software
- none
Hey,I have a problem with that.I have an LCD display with a LCM1602 IIC V1 on it but when i upload the code( any code) I can adjust the contrast but the only thing I get is ( only in one line) these little squers.Please help.
What is wrong?
Use this library, it worked ok for me.
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
I got an error when I try to compile this example:
I use LiquidCrystal_I2C.h 3.246 bytes and another 8.233 bytes, with the same results (this error)
can anybody help me?
thanks
ing Prodromos Sabaidis, Thessaloniki, Greece
I tried with this library: http://learning.grobotronics.com/download/arduino-libraries/LiquidCrystal_I2C_Library.zip
on Arduino IDE version 1.5.5 and it worked fine.
now it compiles (I got help from a friend, atmega@xs4all.nl, I had to put all files of .zip under /libraries/)
but does not work , displays nothing!
I have checked the wiring, it looks ok.
Makis
Be sure that you use expander PCF8574A else if you are using another version of PCF for example 8574T you must change the address to 0x20.
Also check the contrast from your trimmer!