An Arduino LCD library using the PCF8574 I2C adapter.

This is a library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.

This library uses the original Wire library for communication and is partially compatible with the LCD API 1.0. It just can be used as a replacement for the LiquidCrystal library. (see http://playground.arduino.cc//Code/LCDAPI)

Download

The download the LiquidCrystal_PCF8574 library files includes an example. However all the standard examples should work also after adjusting the include file and classname to the library.

By using the Library Manager built into the Arduino Environment you can always download the latest stable version that comes directly from my github repository.

You can find that repository and download directly at:

If you like the latest version including work in progress please use the download from github directly by using the "Download ZIP" button or any git or subversion client.

Hardware

Typical LCD module

The LCD Hardware that fits with this library is pretty standard. You can find manny of the HD44780 compatible LCDs and they come in many sizes like 20 character 2 lines and many colors. As long as they are HD44780 compatible (The name of the LCD controller chip) you can use them. The chip has the limit of displaying 4 lines of 20 character max.

More details about this chip can be found at https://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller. There you can also find a link to the chip manual with all the available commands and features.

Typical PCF8574 module

This is a picture of the PCF8574 module I use.

The wiring of the PCF chip may differ with other adapter boards; the 8 output bits the PCF chip can be attached to the input chips of the LCD in various ways. There is no standard for this.

The board I use connects the lower bits to the control lines and uses the higher bits for transmitting 4 bits at a time:

Bit Signal
1 PCF_RS
1 PCF_RW
1 PCF_EN
1 PCF_BACKLIGHT
5..8 4 bits of data

If you like to adjust this to an adapter board with a different wiring you can do this in the internal function _write2Wire.

History