SainSmart IIC/I2C/TWI Serial 2004 Character 20x4 LCD doesn't work with yun

Hi guys,

I bought a SainSmart IIC/I2C/TWI Serial 2004 Character 20x4 LCD modul for my yun. The display shows only hieroglyphics. I downloaded the LiquidCrystal_I2C2004V1 and installed in the IDE and I tried the example "Hello World". In the net, I read that I should change the address of LCD from lcd(0x27,20,4) to new (0x3F,20,4). The example doesn't work with 0x27 and 0x3F.

My connection between yun and display are

GND (Display) -> GND (Arduino YUN)
VCC (Display) -> 5V (Arduino YUN)
SDA (Display) -> D2 (Arduino YUN)
SCL (Display) -> D3 (Arduino YUN)

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

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

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Hello, world!");
  lcd.setCursor(2,1);
  lcd.print("Ywrobot Arduino!");
   lcd.setCursor(0,2);
  lcd.print("Arduino LCM IIC 2004");
   lcd.setCursor(2,3);
  lcd.print("Power By Ec-yuan!");
}


void loop()
{
}

Thanks for your help
Andreas

I don't know if you need this anymore... but tonight i had your same issue and i solved this way. Maybe will be useful for someone else...

First i connected the SDA pin from the Display directly to the SDA pin on the YUN board, and i made the same for the SCL.

In the code, before the setup(), i used this code:

#define I2C_ADDR 0x27 // The address for the I2C protocol for PCF8574A processor

#define BACKLIGHT_PIN 3

// Other pins related to the PCF8574A on I2C BUS

#define En_pin 2 // -En
#define Rw_pin 1 // -Rw
#define Rs_pin 0 // -Rs
#define D4_pin 4 // -D4
#define D5_pin 5 // -D5
#define D6_pin 6 // -D6
#define D7_pin 7 // -D7

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

Than in the setup(), i used, according to the library,

lcd.begin (20,4);

lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);

lcd.setBacklight(HIGH);

The last two are used to enlight the display.

Here you can find the link to the updated library,

Best Regards

pl3g921:
Hi guys,

I bought a SainSmart IIC/I2C/TWI Serial 2004 Character 20x4 LCD modul for my yun. The display shows only hieroglyphics. I downloaded the LiquidCrystal_I2C2004V1 and installed in the IDE and I tried the example "Hello World". In the net, I read that I should change the address of LCD from lcd(0x27,20,4) to new (0x3F,20,4). The example doesn't work with 0x27 and 0x3F.

My connection between yun and display are

GND (Display) -> GND (Arduino YUN)
VCC (Display) -> 5V (Arduino YUN)
SDA (Display) -> D2 (Arduino YUN)
SCL (Display) -> D3 (Arduino YUN)

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

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

void setup()
{
  lcd.init();                      // initialize the lcd
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Hello, world!");
  lcd.setCursor(2,1);
  lcd.print("Ywrobot Arduino!");
  lcd.setCursor(0,2);
  lcd.print("Arduino LCM IIC 2004");
  lcd.setCursor(2,3);
  lcd.print("Power By Ec-yuan!");
}

void loop()
{
}




Thanks for your help 
Andreas

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I had been pulling my hair out for hours until I found this. With the download from

and your code sample, I got the 20-4 display to work. THANK YOU TO ALL WHO CONTRIBUTED.