Interfacing Hitachi HD44780 LCDs using I2C on an Arduino

IMG_0078Akiba was showing me these modules he picked up in Shenzhen which can be soldered directly to the back of the HD44780 alphanumeric displays. One of the issues with these displays is that they are driven by a parallel data stream. While this makes them very easy to code for it uses up a lot of pins on your microcontroller.

This is where the HD44780 to I2C module comes in handy. It uses the I2C serial bus on (for example) the Arduino. This means only only two you go from 7 to 2 pins, you can also put multiple modules on the same bus with minimal overhead.

The module is based about the pcf8574 which is a general purpose I2C I/O expander. It’s going to be a part I keep in mind of other projects, as it looks really useful for any situation where you’re running out of pins.

The NewLiquidCrystalDisplay library supports the adapter module on the Arduino. There are a couple of gotcha, but the code below includes the library and is setup to use the default address (which is configured by 3 unplaced resistors on the back of the module). Aside from the code, the wiring process is really easy, you just need to connect the module to +5V, ground, and SCL/SDA (either via dedicated pins of A4 and A5 on the Arduino Uno). Here’s my horribly messy wiring (I’m afraid I didn’t have any SIL connectors to hand):


There’s one slight gotcha. If you find that the display is illuminated, but blank. Make sure the display intensity is set correctly, just use a screw driver to turn the pot on the back of the module until you can see the text well.

You should be able to buy the module on the freaklabs store soon.

Complete example codebase, including library: i2cLCD.