LCD 20X4 I2c screen stops showing data

Hey, i am having a problem with my lcd screen.
I have 2 I2C devices connected:

  1. LCD 20x4 screen
  2. SCD30 sensor

I have also connected 2 10K resistors from the scl/sda to the 5V line.

The sketch works OK for around 30 minutes and then the screen freezes and no new data is shown.
On the serial monitor i can still see that the sensor is working and outputting data to the serial monitor.

The sketch is fairly simple and short, i’m trying to understand if this is a hardware issue or software and would like some help.
I’ve also added the pictures of connection (hope its understandable)

#include <Wire.h>
#include "SparkFun_SCD30_Arduino_Library.h" 
#include <RTClib.h>
#include <SPI.h> 
#include "LCD.h" // For LCD
#include "LiquidCrystal_I2C.h" // Added library*

//Set the pins on the I2C chip used for LCD connections

//ADDR,EN,R/W,RS,D4,D5,D6,D7
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 0x27 is the default I2C bus address of the backpack-see article
SCD30 airSensor;
RTC_PCF8523 RTC;


const int chipPin = 10;
float lowRH, lowTemp;

void setup()
{
  Serial.begin(9600);
  Wire.begin();
  lcd.begin(20,4);
  lowRH = 80;
  Serial.println(String(lowRH));
  
  if (airSensor.begin() == false)
  {
    Serial.println(F("Air sensor not detected. Please check wiring. Freezing..."));
    while (1);
  }
//   
  lcd.setBacklightPin(3,POSITIVE); // BL, BL_POL
  lcd.setBacklight(HIGH);

  //The SCD30 has data ready every two seconds
}

void loop()
{
  DateTime now = RTC.now();
  float temp,rh;
  int co2;
  
  if (airSensor.dataAvailable())
  {
    co2 = airSensor.getCO2();
    temp = airSensor.getTemperature();
    rh = airSensor.getHumidity();
    
    Serial.print(F("Co2(ppm):"));
    Serial.print(co2);
//    lcd.clear(); 
    lcd.setCursor(0,0);   
    lcd.print("Date:" + String(now.day()) + "/" + String(now.month()) + "/" + String(now.year()));
    lcd.setCursor(0,1);
    lcd.print(F("Co2(ppm): "));
    lcd.print(co2);

    Serial.print(F(" Temp(C):"));
    Serial.print(temp);
    lcd.setCursor(0,2);
    lcd.print(F("Temp(C): "));
    lcd.print(temp);
    
    Serial.print(F(" Humidity(%):"));
    Serial.print(rh);
    lcd.setCursor(0,3);
    lcd.print(F("Humidity(%):"));
    lcd.print(rh);
    
    Serial.println();
    if (rh < lowRH){
    }
// 
  }   
  
  delay(2000);
}

    lcd.print("Date:" + String(now.day()) + "/" + String(now.month()) + "/" + String(now.year()));

Hey, is this line wrong?

The Evils of Arduino Strings

avoid Arduino Strings on the Uno.

untested:

lcd.print("Date:"); lcd.print(now.day()); lcd.print("/"); lcd.print(now.month()); lcd.print("/"); lcd.print(now.year());

noiasca: The Evils of Arduino Strings

avoid Arduino Strings on the Uno.

untested:

lcd.print("Date:"); lcd.print(now.day()); lcd.print("/"); lcd.print(now.month()); lcd.print("/"); lcd.print(now.year());

Thanks, i'll do this change and see what happens.

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 0x27 is the default I2C bus address of the backpack-see article <

Pins 0 & 1 are serial pins , and should not be used in conjunction with serial printing AND the lcd !!
:o

cherk:
Pins 0 & 1 are serial pins , and should not be used in conjunction with serial printing AND the LCD !!
:o

Which is perfectly fine, because he is using an I2C backpack which connects to A4 and A5, the I2C pins of the UNO/ Nano.

This has nothing whatsoever to do with pins 0 and 1 on the Arduino. :roll_eyes: You haven’t used an I2C backpack, have you?

Just saw that i didn't mention it, i'm using arduino R3 and the i2c are connected to the dedicated i2c connections and not A4,A5.