I2C to lcd1602 not working

Hey so I ordered the I2C: http://www.ebay.com/itm/330882787997?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
and the LCD 1602: http://www.ebay.com/itm/251176543073?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

I soldered them together and connected them properly to my Ardunio UNO (SDA to A4, SCL to A5)
I downloaded LiquidCrystal_I2C.zip from here: Arduino Playground - LCDi2c
I extracted it and placed it in my libraries folder and then booted Arduino.

However, when I run the program, HelloWorld, nothing happens (backlight is always on) (picture attached).
I tried messing with the potentiometer but it didn't affect anything.
Any help would be greatly appreciated!

I'm running Arduino 1.0.2

The code from HelloWorld is here:

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

LiquidCrystal_I2C lcd(0x20,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.backlight();
lcd.print("Hello, world!");
}

void loop()
{
}

The eBay listing states the I2C address for the LCD module adapter is hex 0x27. That is decimal 39. So you need to change your code line after the includes to another address.

Ah yes, I changed it to 0x27 and it still doesn't work.

Are you sure you connected it correct ?
Most pics of I2C to display adapters, the adapters are hidden behind the display after mounting them.
And use Nick Gammon's I2C scanner.
It wil tell you the I2C address of your module (assumed it is working).

Facepalm I had it wired up in reverse, after a lot of time desoldering and resoldering, it works!

The eBay listing states the I2C address for the LCD module adapter is hex 0x27. That is decimal 39. So you need to change your code line after the includes to another address.

This is entirely correct but I am wondering why you included the sentence "That is decimal 39." which is entirely irrelevant.

You could also have said 'The eBay listing states the I2C address for the LCD module adapter is hex 0x27. Your display has a red background. So you need to change your code line after the includes to another address.' This would be equally correct and equally irrelevant.

Why bring this up you ask? Well the manufacturer expressed the address in hex and the compiler understands hex. You can convert the address to decimal and the compiler will understand that as well BUT when you do the conversion from hex to decimal the absolute very best that you can do is get the conversion correct. On the other hand it is very easy to get the conversion wrong and whatever you are doing will then fail.

Don

ChipFixes,
I'm curious about the library download.
If I go to the page you linked to and then click on the
Donwload the latest version from here
link.
All I get is some goofy Apple iCloud thing.
I can't get to the library.
How did you get to the library zip image?

(I've sent an email to Dale Wentz to see if he could update the playground page)

--- bill

All I get is some goofy Apple iCloud thing.
I can't get to the library.

Are you and I the only ones without a ifad?

Don

Oh, to get the library, scroll down to the table and then it's the 5th one down. It's labeled: PCF8574-HD44780 F E LiquidCrystal_I2C.zip i2c

Also, it turns out that when I change the address in the program from 0x20 to 0x27, the display won't work, but when I leave it as 0x20, everything works fine.

That PCF8574 is the part that is doing the work on your pcb.
It can be set to any address between 0x20 and 0x27h.
Most of them are preset with all 3 bits high, so 27h.
Yours has all low.
I don't know if the part has internal pull ups or pull downs, couldn't find that in the datasheet.

By the way the partnumber has been scratched off so you don't know what part it is and would be unable to copy it.
Thats pretty hilarious.

Just to add to MAS3's comment.
The address for the PCF8574 is set in hardware and cannot be modified in s/w.
That is you must set logic levels on the 3 address pins (A0, A1, A2) which are
pins 1, 2, and 3.

The funny part about them scratching off the chip part number is that it is does not
really hide anything. There is pretty much only one i2c i/o expander chip with 16 pins.
Not only that but to use the board, they have to provide a library in source code form.
It takes about 30 seconds or less of looking at the source code to figure out
which chip it is and how the pins are wired up.
And if that isn't enough, the boards are only double layer, sometimes even single
layer, so in less than 5 minutes you can derive the full schematic.
All scratching/sanding off the part number does is waste the vendors time.

--- bill

All scratching/sanding off the part number does is waste the vendors time.

It wasted your time as well, so next time you might want to vote with your wallet and use a different vendor.

Don

Just to add to MAS3's comment.
The address for the PCF8574 is set in hardware and cannot be modified in s/w.
That is you must set logic levels on the 3 address pins (A0, A1, A2) which are
pins 1, 2, and 3.

Let me add to both comments.

The base address for the bare PCF8574 is set in hardware and cannot be modified in s/w.

The actual address for the wired up PCF8574 is determined by the logic levels on the 3 address pins (A0, A1, A2) which are pins 1, 2, and 3. You may or may not be able to easily change these logic levels depending upon the physical design of the pc board.

Once you have determined the specific address of your PCF8574 as determined by the logic levels on your pc board you must then use that specific address in your software.

Don