i2c lcd

Hello,

It´s the first time i´m writing here, been looking for some info about my problem but couldn´t find any…

So, i´m trying to use a i2c backpack on a 20*4 lcd and with arduino nano v3. I´m using Arduino 1.8.1, FMalpartida librarie (https://arduino-info.wikispaces.com/LCD-Blue-I2C#v1) and YWROBOT that i download trough arduino.

None works, one gives an error while verifying, the othe just turns the lcd backlight on.

Could anyone help with this?

Thanks :wink:

DiogoBasto:
Hello,

It´s the first time i´m writing here, been looking for some info about my problem but couldn´t find any...

So, i´m trying to use a i2c backpack on a 20*4 lcd and with arduino nano v3. I´m using Arduino 1.8.1, FMalpartida librarie (https://arduino-info.wikispaces.com/LCD-Blue-I2C#v1) and YWROBOT that i download trough arduino.

None works, one gives an error while verifying, the othe just turns the lcd backlight on.

Could anyone help with this?

Thanks :wink:

Slowly adjust the backlight pot till you can see the squares where the characters will display. Run your program and adjust the pot a bit and you should see the characters. They are pretty touchy.

I have used several of those LCDs and all are the same way.

Paul

You didn't connect the GND!

Hello,

thanks for both answers, but the problem isn´t there, yes in the photo i didn´t connect the arduino to the same GND as the LCD, but with it connected doesn´t work still… the adress is ok, 0x27, the potentiometer of the brightness is ok too, i just can see a blinking cursor on the lcd, everytime i hit reset it changes to other position.
Already tryied diferente lcd backpacks, diferent lcds and arduinos… nothing seems to work, might be the librarie?

here´s what i´m using:

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

LiquidCrystal_I2C lcd(0x27,20,4);

void setup()
{
lcd.init(); // initialize the lcd

// Print a message to the LCD.
lcd.backlight();
lcd.print(“Hello, world!”);
}

void loop()
{
}

DiogoBasto:
Hello,

thanks for both answers, but the problem isn´t there, yes in the photo i didn´t connect the arduino to the same GND as the LCD, but with it connected doesn´t work still… the adress is ok, 0x27, the potentiometer of the brightness is ok too, i just can see a blinking cursor on the lcd, everytime i hit reset it changes to other position.
Already tryied diferente lcd backpacks, diferent lcds and arduinos… nothing seems to work, might be the librarie?

here´s what i´m using.

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

LiquidCrystal_I2C lcd(0x27,20,4);

void setup()
{
lcd.init(); // initialize the lcd

// Print a message to the LCD.
lcd.backlight();
lcd.print(“Hello, world!”);
}

void loop()
{
}

Here are the corresponding lines from my oven control program. Notice the address is different. I had a similar struggle until I discovered the address problem.

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

LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
#define LCDROWSIZE 4
#define LCDCOLSIZE 20

lcd.begin(LCDCOLSIZE, LCDROWSIZE); // initialize the lcd for 16 chars 2 lines, turn on backlight

lcd.setCursor(0, 0); // Splash screen
lcd.print(" JODECO DRYING OVEN ");
lcd.setCursor(0, 1);
lcd.print("SET TIM: TMP: "); // allow for a 4 digit time in munutes
lcd.setCursor(0, 2);
lcd.print("RUN TIM: TMP: ");
update_Display_now(); // Show initial values = 0.

void update_Display_now() { // display the value only if changed since last time here.
lcd.setCursor(0, 0);
if (Blinker) {
lcd.print(" “); //clear old second tick
Blinker = false;
} else
{
lcd.print(”."); // print a tick for a second
Blinker = true;
}

if (entered_Time != LCD_entered_Time) {
print_entered_Time();
LCD_entered_Time = entered_Time;
}

if (entered_Temp != LCD_entered_Temp) {
print_entered_Temp();
LCD_entered_Temp = entered_Temp;
}

if (LCD_Minutes != Minutes) {
print_Minutes();
LCD_Minutes = Minutes;
}

if (LCD_running_Temp != running_Temp) {
print_running_Temp();
LCD_running_Temp = running_Temp;
}
}

void print_entered_Time() {
lcd.setCursor(8, 1);
lcd.print(" "); //clear old value
lcd.setCursor(8, 1);
lcd.print(entered_Time);
}

void print_entered_Temp() {
lcd.setCursor(17, 1);
lcd.print(" "); //clear old value
lcd.setCursor(17, 1);
lcd.print(entered_Temp);
}

void print_Minutes() {
lcd.setCursor(8, 2);
lcd.print(" "); //clear old value
lcd.setCursor(8, 2);
lcd.print(Minutes);
}

void print_running_Temp() {
lcd.setCursor(17, 2);
lcd.print(" "); //clear old value
lcd.setCursor(17, 2);
lcd.print(running_Temp);
}

Paul_KD7HB:
Here are the corresponding lines from my oven control program. Notice the address is different. I had a similar struggle until I discovered the address problem.

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

LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
#define LCDROWSIZE 4
#define LCDCOLSIZE 20

lcd.begin(LCDCOLSIZE, LCDROWSIZE); // initialize the lcd for 16 chars 2 lines, turn on backlight

lcd.setCursor(0, 0); // Splash screen
lcd.print(" JODECO DRYING OVEN ");
lcd.setCursor(0, 1);
lcd.print("SET TIM: TMP: "); // allow for a 4 digit time in munutes
lcd.setCursor(0, 2);
lcd.print("RUN TIM: TMP: ");
update_Display_now(); // Show initial values = 0.

void update_Display_now() { // display the value only if changed since last time here.
lcd.setCursor(0, 0);
if (Blinker) {
lcd.print(" “); //clear old second tick
Blinker = false;
} else
{
lcd.print(”."); // print a tick for a second
Blinker = true;
}

if (entered_Time != LCD_entered_Time) {
print_entered_Time();
LCD_entered_Time = entered_Time;
}

if (entered_Temp != LCD_entered_Temp) {
print_entered_Temp();
LCD_entered_Temp = entered_Temp;
}

if (LCD_Minutes != Minutes) {
print_Minutes();
LCD_Minutes = Minutes;
}

if (LCD_running_Temp != running_Temp) {
print_running_Temp();
LCD_running_Temp = running_Temp;
}
}

void print_entered_Time() {
lcd.setCursor(8, 1);
lcd.print(" "); //clear old value
lcd.setCursor(8, 1);
lcd.print(entered_Time);
}

void print_entered_Temp() {
lcd.setCursor(17, 1);
lcd.print(" "); //clear old value
lcd.setCursor(17, 1);
lcd.print(entered_Temp);
}

void print_Minutes() {
lcd.setCursor(8, 2);
lcd.print(" "); //clear old value
lcd.setCursor(8, 2);
lcd.print(Minutes);
}

void print_running_Temp() {
lcd.setCursor(17, 2);
lcd.print(" "); //clear old value
lcd.setCursor(17, 2);
lcd.print(running_Temp);
}

I see, the problem is, at this line “LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);” theres an error, " POSITIVE" was not declared in this scope, do you know why?

No, Don't know why. I also don't recall what led me to that structure. Google helped a lot when I had no problem with the smaller 2X16 LCD, but could not get the 4X20 to work.

Paul

I recommend that you use a new library called hd44780. It is available for download with the library manager.

It is auto configuring, and will be “plug and play” compatible with your display. It has help many people in your situation, and its use is now the solution being recommended on the Display section of the forum for people trying to get I2C lcd’s operating.

For your sketch you will use the io class hd44780_I2Cexp.h.

#include <Wire.h>
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // include i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & config display for hd44780 chip

void setup()
{
  // initialize LCD with number of columns and rows:
  lcd.begin(20, 4);

  // Print a message to the LCD
  lcd.print("Hello, World!");
}
void loop() {}

In the examples sketches for the hd44780_I2Cexp class there is a sketch called I2CexpDiag which will show you the exact constructor for your display and test other functionality. You should run that sketch.

cattledog:
I recommend that you use a new library called hd44780. It is available for download with the library manager.

It is auto configuring, and will be “plug and play” compatible with your display. It has help many people in your situation, and its use is now the solution being recommended on the Display section of the forum for people trying to get I2C lcd’s operating.

For your sketch you will use the io class hd44780_I2Cexp.h.

#include <Wire.h>

#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // include i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & config display for hd44780 chip

void setup()
{
  // initialize LCD with number of columns and rows:
  lcd.begin(20, 4);

// Print a message to the LCD
  lcd.print(“Hello, World!”);
}
void loop() {}




In the examples sketches for the hd44780_I2Cexp class there is a sketch called I2CexpDiag which will show you the exact constructor for your display and test other functionality. You should run that sketch.

Thanks for the info. I will try it out on my current project, upgrading a 16 year old coil winder.

Paul

cattledog:
I recommend that you use a new library called hd44780. It is available for download with the library manager.

It is auto configuring, and will be “plug and play” compatible with your display. It has help many people in your situation, and its use is now the solution being recommended on the Display section of the forum for people trying to get I2C lcd’s operating.

For your sketch you will use the io class hd44780_I2Cexp.h.

#include <Wire.h>

#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h> // include i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & config display for hd44780 chip

void setup()
{
  // initialize LCD with number of columns and rows:
  lcd.begin(20, 4);

// Print a message to the LCD
  lcd.print(“Hello, World!”);
}
void loop() {}




In the examples sketches for the hd44780_I2Cexp class there is a sketch called I2CexpDiag which will show you the exact constructor for your display and test other functionality. You should run that sketch.

Thank you so much!!! it works fine, easy to connect multiple lcd´s. great!!