LCD 16x2 with I2C backpack help - display goes crazy, garbage (SOLVED)

I am not a newbie. I have programmed a lot of controllers, modules, etc. However I seem to be confounded by the use of the I2C backpack and standard 16x2 display.

I have two of the above, and recently bought one that is soldered to the display. When I connect the display without the I2C backpack it works great. I can use the I2C backpack with the Raspberry Pi, no issues (took some doing). However all three displays (that work) combined with the I2C backpack result in garbage display, flickering backlight, and nothing as expected.

I am using the attached library. I have compiled to Uno, Nano, Mini-pro, even using INO on my Raspi. Same result. i have worked with 1.0.5, 1.5.5 and 1.5.8 on a Mac, and again, same. Blinking backlight, etc. I have verified that the I2C address (and the only one that responds). I even used 4.7 (2.2K+2.2K) resistors to bring SDA and SDL up to VCC.

it must be something trivial I am missing and I am not sure what. I have gotten this to work before but with similar difficulty. I have spent 3 days debugging and no luck. any help would be appreciated.
Frustrated …

the current config is Uno + I2C backpack soldered to LCD. using 5V and GND + SDA pin A4 and SDL pin 5. I am using INO on Raspberry PI with clean install. i have tested the I2C with the LCD and python script and it works fine. However not with the Arudino 1.0.5+ INO currently.

pi@raspberrypi ~/pilcd $ gpio i2cd
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

pi@raspberrypi ~/lcd3 $ cat src/HelloWorld.ino

#include <Wire.h> 
#include "LiquidCrystal_I2C.h"

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x20 for a 16 chars and 2 line display

void setup()
  lcd.init();                      // initialize the lcd 
  // Print a message to the LCD.
  lcd.print("Hello, world!");

void loop()

pi@raspberrypi ~/lcd3 $ (1.19 MB)

it must be something trivial I am missing and I am not sure what.

The LCD modules are standardized as far as what each of their 14 or 16 pins do.

Most of the inexpensive I2C adapters use similar chips although their addresses may differ. You already know the address for your chip so that part of the problem is solved.

The remaining problem is that there no standard way to connect the pins of I2C adapter chip to the pins on the LCD module. Unfortunately this relationship must be known in order to write software to control the LCD via I2C.

The perpetrator of your library assumed a certain pin relationship and wrote his software to accommodate that relationship which is apparently different from that of your adapter. It would have been nice if he shared that information.

You will need to determine the relationship for your I2C adapter and then use a library that will permit you to use that information.

All of the information on how to deal with both of these has appeared many times in this forum so start by looking through some of the many posts that have I2C in their title.


Take a look at this tutorial and some of the referenced threads.

You should use the F. Malpartido library instead of the one you have attached to your sketch, because it will work with many different varieties of backpacks. You will want to use Bill Perry's i2cLCD guesser to determine the constructor for your specific backpack. The F. Malpartido library needs to be installed in order to use that tool.

Wow that was easy and painful at the same time. with Success on the Raspi+INO config. I will move it to my Mac and see if works fine there also.

the link provided works fine. I had tried it many times before. I would get POSITIVE not defined. Or constructor didn’t match.

thank you for the quick reply. Now I can go to sleep assured i can do this again.