Overview

The Arduino LCD Backpack makes it easy and very convenient to  use LCDs in your microcontroller project. Using the LCD backpack has a lot of advantages compared to connecting your LCD directly to your microcontroller. The advantages are as follows:

  • Firstly, you save a lot of I/O pins. The Arduino I2C LCD backpack uses the Inter-integrated Circuit (I2C or I2C) Protocol , meaning you only need two I/O pins for your Serial Data (SDA) and Serial Clock (SCL)  lines. The usual means of connecting the LCD to your microcontroller would have required you to use at  least 6  I/O pins. Using the LCd backpack frees up 4 pins to use for other purposes.
  • Secondly you use less jumper cables and wires, making your project neater, sving you a lot of unnecessary hardware debugging and helping you keep your sanity!

Details

The backpack is very cheap and common to find. Here are the parts we are going to be using for this tutorial.

  • Hitachi HD44780 driver compatible LCD
  • Arduino Uno
  • Some jumper wires
  • A breadboard (optional)

This is how the I2C LCD Backpack looks like. You can solder it directly to the back of an LCD which is the most advisable way. If you are just prototyping however, you can just plug it into the breadboard as shown in this tutorial.

 

Schematic

Below is a Fritzing image of how to connect the LCD to an Arduino. Connect SDA and SCL of the backpack to Arduino pins A4 and A5 respectively. Then connect VCC to 5v and GND to GND on yout Arduino and you are good to go.

Arduino Code

In order to use the I2C LCD backpack with an Arduino, you will have to download the Liquid Crystal I2C library and extract it into your Arduino libraries folder.  Check out this Sparkfun tutorial on how to install an Arduino library if you don’t know how to do so already.

Here is the Sketch below originally by T.K. Hareendran and modified by me.

You can also download the code from github.

If everything goes well, you should have something like this as your final circuit.

 

NOTE: Every I2C device has a special address that enables the Arduino to communicate with it which you have to specify as shown below.  By default, the I2C bus address for the LCD backpack is 0x27.

 However in some cases it may be different and you may have to find the address manually. Fortunately there is a simple Arduino sketch that you can run while having your I2C device connected and it will show you the address of the LCD backpack.

Here is a link to the I2C scanner tutorial to help you find the specific address of your I2C device.

So, thats it!

I hope you enoyed this tutorial. Please leave a comment. The feedback gives me a lot of motivation to do more tutorials.