Fork me on GitHub

Project Notes

#398 LCD/I2CAdapter

Using an I²C adapter to reduce the Arduino pins needed to drive an LCD.



LCDs based on the Hitachi HD44780 or a compatible chipset are a popular display option for Arduino project. Common form factors are 1602 (16 column, 2 row) and 2004 (20 column, 4 row).

The basic LCDs require at least 6 Arduino pins to drive, and the standard LiquidCrystal library is available for this.

To save pins and simplify wiring, there are I²C adapters available - either separately or packaged with an LCD. These board basically use some form of Remote 8-Bit I/O Expander chip, such as the TI PCF8574.

Another product that is very common on aliexpress and eBay users a part apparently from Philips, but I haven’t found d datasheet for it yet.


I²C Addressing

The default address for my module turns out to be 0x3F (other common default addresses appear to include 0x27), although I had to scan the address space to discover this!

There are 3 unsoldered address pads on the module which I presume will allow adjusting the unit address.

Code and Libraries

I²C is not supported by the standard LiquidCrystal library. When I searched for I²C LCD libraries:

  • it seems there is no clear leader
  • there are many independent forks of common source code
  • it’s a bit of a mess!

Never-the-less, I picked a reletively recent one: LiquidCrystal_I2C and it is working just fine.

The I2CAdapter.ino sketch is a simple test of the library.





Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.