Cant get I2C LCD working

  • Hello,
    Hooked up a new 20x4 I2C lcd pannel as in the described in the irrigation controller drawing (A4 & A5, PWR, and GND). Used the fmalpartida-new-liquidcrystal-bb6d545c00c3 library form GITHUB, but cant get Hello World working. Changed LCD Address to 0x20. Any other place to find a library?

  • @y4CdW42Ol8
    Let me be more specific. I have the 20x4 line LCD connected to a Arduino DUE using 5v, GND, A4 > SDA, and A5 > SCL. The back light come on when power is ON, and that's it. I have successfully compiled the Blinking Cursor and Hello World examples in the MySensory I2C libary (changing: LiquidCrystal_I2C lcd(0x20, 20, 4); because my LCD A0-A2 not jumpered). But nothing happens on the LCD. The LED on the small I2C board is ON. The DUE is working, since I have run other sketches.

    What could I be doing wrong? A bad LCD? Bad PINS on the DUE? How do I change the PIN numbers on the DUE.

    Some other Examples in the LiquidCrystal_I2C library use the following:

    #define BACKLIGHT_PIN 13
    LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address

    //LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE); // Set the LCD I2C address

    What does Backlight_PIN 13 do?

    Also, what does the potentiometer on the small I2C board?

    Hope someone can help...

  • Just a similar issue some new LCD s arrived and swapped them into an existing working Sketch and got nothing

    I was using "0x27" so tried "0x3F" and I got back light, good start. Then turned the little pot (Contrast) on the back a bongo, text. All good.

    LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address
    LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address

  • @NotTooTechy said:

    LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address

    What do I declare POSITIVE as?

  • @y4CdW42Ol8

    Your suggestions did not work. I ran the YourDuino address scanner, and got:
    I2C scanner. Scanning ...
    **Found 0 device(s).

  • **Found 0 device(s).

    Are you sure you have it all wired correctly?
    SDA goes to ANALOG pin 4
    SCL goes to ANALOG pin 5

    Also, looking at your first Post I don't think 0x20 is a valid address for LCD. Try the two I posted above one-at-a-time and don't forget the Contrast pot on the back, the little blue block.

    I will try YourDuino and see what I get.

    POSITIVE being in all caps suggests it is a Global predefined Constant so just use it EXACTLY as I provided above. Copy, paste and try one at a time.

  • 100% sure it's wired correctly. Tried your addresses, and cut/paste your line - nothing works.
    I'm pretty sure the LCD is dead or pin A4 or A5 on the DUE is dead.

  • Is there a jumper on the two pins at the other end of the serial board on the back? My most recent ones came withOUT those and I get no back-light or red-LED on the serial board until I put a jumper on them.

  • @y4CdW42Ol8 said:

    Also, what does the potentiometer on the small I2C board?

    Most if not all of these LCD modules are based off of the older parallel 44780 based LCDs. This is probably a clone or very similar. I am guessing that the potentiometer is the contrast control. double check that in the documentation for the I2C board that is on the back, but if it is, you may need to turn that up or down to get your unit to display. If there is no documentation, look at the I2C board on the back. It should connect to a 16 pin header connector. For the 44780 LCDs it was pin 3 that was the contrast pin. The pot just created a voltage divider that went from 0(GND) to +5V. If you can trace the pins on the pot, you should see one going to GND or pin 1 on the header, 1 to +5V or pin 2 on the header, and the other one to the contrast pin 3 of the header. If that all checks, then that is for sure your contrast control.

  • Hello All,
    Everything is working… The problem was that the Arduino DUE puts out SCL and SDA on pins 21 & 20, respectively.
    Thank you.

  • Hardware Contributor

    Try compiling with SDA instead of A4 and SCL instrad of A5 in the pinmode function. This should make the sketch board independant. And then use the correct pins on each board.


Suggested Topics