Problem connecting Arduino UNO and SaintSmart 20x4

Hello,

i´ve tried everything, but i have problems connecting the LCD from SaintSmart, 20x4, I2C-Adapter, to the Arduino UNO. This is my test program:

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

LiquidCrystal_I2C lcd(0x27,20,4); // 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.setCursor(0, 0);
    lcd.print("Hello, world!");
}

void loop()
{
}

The connections:

Arduino --- LCD

GND --- GND
3,3V --- VCC
A4 --- SDA
A5 --- SCL

I don´t know, what is going wrong ... (?)

regards

Hi.

Your information is insufficient, even though you put your test sketch in code tags.
What problem do you have ?

First thing that comes to mind is to use bpedrrybab's i2cLCDguesser sketch (click !).

When i run the programm, only the backlight is shining and nothing happens.

I´ve changed already the lcd address to 0x3F, but still, when i upload it (whith avrdude), only the backlight is bright, but nothing else happens. (Uploading and programming is ok, for example, if i upload an other programm, like "blink")

regards

(i can´t test the linked example, i cannot handle the attached file)

Yes you can.
A *.pde file is an Arduino sketch, made with an IDE version lower than 1.0.
You can open it by pointing to the Arduino program, or drag it to an already open IDE, i just tried that.
I can't tell how to do that if you are a non windows user, because i don't know.

By the way:
Read the requirements mentioned in the comments in top of the sketch.

The connections:

Arduino --- LCD

GND --- GND
3,3V --- VCC
A4 --- SDA
A5 --- SCL

Are you sure that the lcd takes 3.3 Volts?
Do you know what the backpack IC is?
Did you run the I2C scanner to check the address?

@MAS3,

i can´t compile it in the Arduino IDE, there are a lot of error messages, (which shows that there is not the right Library used or that the code is depreceated for this ide).

sketch_aug02b.ino: In function 'int guessconfig(uint8_t)':
sketch_aug02b:374: error: 'POSITIVE' was not declared in this scope
sketch_aug02b:390: error: no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t&, uint8_t&, uint8_t&, uint8_t&, uint8_t&, uint8_t&, uint8_t&, uint8_t&, uint8_t&, int&)'
C:\arducodes-read-only\jD_IOBoard\jD_IOBoard_FrSkyMAVLink\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.h:57: note: candidates are: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
C:\arducodes-read-only\jD_IOBoard\jD_IOBoard_FrSkyMAVLink\libraries\LiquidCrystal_I2C2004V1/LiquidCrystal_I2C.h:55: note: LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)


And if i try to compile it in AtmelStudio, it will compile, but with AtmelStudio i am not able to upload the scetch, it says:

Compiling 'Sketch1' for 'Arduino Uno'
Binary sketch size: 466 bytes (used 1% of a 32.256 byte maximum) (0,23 secs)
'Upload Using' requires a programmer. Upload cancelled.

So, i don´t know if the work is worth to compile this program, i´d rather would solve the problem with the LCD perhaps with documentation.

I´ve fetch my oscilloscope an tried to find out, if there are signals on the lcd-display. It seems, that it is doing the init procedure well, voltage is going down, after initialisation, voltage raises to about 5V and then there is some sort of digital signal on SDA, but i don´t know if this signal is correct, maybe someone can have a glance on this.

(i hope, the image is displayed, can´t check it with the preview)

@steinie44:

  • If i supply the LCD with 5V i can´t upload any programm anymore.

  • The backpack IC is the i2c, the Philips Semiconductor PCF8574 (http://www.nxp.com/documents/data_sheet/PCF8574.pdf)

  • i see no way to upload the Testprogram, i´ve tried it with AtmelStudio and Arduino IDE

regards,

and thank you

UNO_SAintSmart01.BMP (329 KB)

I missed that you wired it to 3 volts, but i don't think that is correct.
The unit i'm using is connected to 5 volts, but it isn't one from sainsmart.

I pointed out that you need to use the correct library.
This is what the sketch tells you:

sketch:

You do not need to use this sketch if you know what adapter you have.
Because then you can find the correct settings to tell the library at which PCF8574 pins what LCD pins are connected, and that is what you need to know and tell the library.
You should be able to find this by visiting the website of the product.
If there is no website available, the above mentioned guesser comes in.

Perhaps you should wait for bperrybab to chime in (if he does see this thread), but as he's been telling about this sketch in 2013 (after introduction of IDE > 1.0), i assumed there are no issues left.
That could turn out incorrect, which does happen when assuming things.

Perhaps you should wait for bperrybab to chime in (if he does see this thread),...

You will have a better chance of attracting Bill if you put the term 'I2C' in the topic heading.

Don

*  It requires using fm's LiquidCrystal library replacement:
 *  https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

With this library the small example code does not even compile and the signal on the oscilloscope shows that there is no signal from arduino, about 160mV Vpp which seems very low to me. I don´t know.

regards

Hello,

it seems that the lcd was working all the time. It seems that it needs a refresh cycle, which is done in the loop and since i had nothing in the loop, it displayed the message for a very short time and then it dissapeared.

This code is running:

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


LiquidCrystal_I2C lcd(0x3F,20,4); 
void setup()
{
    lcd.init(); 
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("Coliban");
    lcd.setCursor(0, 1);
    lcd.print("Voltage: ");
    lcd.setCursor(18, 1);
    lcd.print("V");
    lcd.setCursor(0, 2);
    lcd.print("Ampere: ");
    lcd.setCursor(18, 2);
    lcd.print("A");
}
void loop()
{
    int val, val2;
    float temp;
    val=analogRead(0);
    val2=analogRead(1);
    temp=val/4.092;
    val=(int)temp;//
    lcd.setCursor(9, 1);
    lcd.print(0x30+val/100); 
    lcd.print(0x30+(val%100)/10); 
    lcd.print('.');
    lcd.print(0x30+val%10);
    
    lcd.setCursor(9, 2);
    lcd.print(0x30+val2/100); 
    lcd.print(0x30+(val2%100)/10); 
    lcd.print('.');
    lcd.print(0x30+val2%10);
    
    
    delay(400);
}

it seems that the lcd was working all the time. It seems that it needs a refresh cycle, which is done in the loop and since i had nothing in the loop, it displayed the message for a very short time and then it dissapeared.

These LCDs do not need any sort of refresh cycle. Data written to the display will remain there until overwritten or until the power is removed. You had something else wrong.

Don