Weather station with the Arduino

Hello maybe someone can help me I have programmed a weather station with the Arduino (BMP280 sensor), but I occasionally have problems with the display on the lcd display (see picture)
thank you in advance.

ps: I am using BMP280 libary

#include <dht11.h>
#include <LiquidCrystal.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>
#include <Wire.h>

dht11 DHT11;
Adafruit_BMP280 bmp;
#define DHT11PIN 8
#define BMP_SCK  (13)
#define BMP_MISO (12)
#define BMP_MOSI (11)
#define BMP_CS   (10)

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("Wird geladen...");
  lcd.clear();
/*
  if (!bmp.begin()) {
    lcd.println(F("Could not find a valid BMP280 sensor, check wiring!"));
    while (1);
  }

   bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,     /* Operating Mode. */
                  //Adafruit_BMP280::SAMPLING_X2,     /* Temp. oversampling */
                  //Adafruit_BMP280::SAMPLING_X16,    /* Pressure oversampling */
                 // Adafruit_BMP280::FILTER_X16,      /* Filtering. */
                 //Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */
                 
}

void loop() {
  
  int chk = DHT11.read(DHT11PIN);

  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print((float)DHT11.temperature, 1);
  lcd.print("C");

  lcd.setCursor(0, 2);
  lcd.print("RelF: ");
  lcd.print((float)DHT11.humidity, 1);
  lcd.print("%");

  delay(2000);
/*
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Druck: ");
  lcd.print(bmp.readPressure());
  lcd.print(" Pa");

  lcd.setCursor(0, 2);
  lcd.print("Temp: ");
  lcd.print(bmp.readTemperature());
  lcd.print(" C");

  delay(5000);
*/
  //lcd.clear();
}

Pic is on lightshot: Screenshot by Lightshot

Post your picture here on the forum please. And a schematic.

Why are you using dh11 and bmp280? Is one outdoor, one indoor?

We can only guess, as you have not published the actual program you are using.

But you do appear to be using the SPI pins for the BME280 and the same pins for the LCD display.

I think it is a problem with the lcd display ...
I postet a video from the problem on youtube
here is the link: Arduino Problem with the Display - YouTube
maby anyone can find a solution for this problem with the video
thanks for youre help.

I occasionally have problems with the display on the lcd display

So sometimes it works correctly? You have only showed it going wrong in your picture and video. Neither help us to find the problem. If the LCD works correctly some of the time then the problem is probably in the wiring, not the code.

To help you with the wiring, we must see a schematic drawn by you, and some clear bright pictures showing every wire.

Hallo,

i uploaded a new Video, wich is better than the others.
Also you can see at the first seconds when i start the Arduino, that the first seconds anything goes.
I check all cables and i can´t see any problems.
I don't have a circuit diagram, I used a video to connect the LCD display and other videos to use the two sensors.

Video: Arduino LCD error - YouTube

thank you in advance.

Draw a diagram and post it. Hand-drawn is completely acceptable if it is neat.

Take bright clear pictures from above the breadboard so we can zoom in to see everything in detail. Video is no good for checking a circuit for wiring errors, even a good video.

srnet:
We can only guess, as you have not published the actual program you are using.

Why did you say that? Did you spot something in the OP's code what would fail to compile?

srnet:
But you do appear to be using the SPI pins for the BME280 and the same pins for the LCD display.

Its a BMP280, not a BME280, according to the OP. It appears the BMP280 is not part of the sketch at the moment, all lines in setup() and loop() referring to it are commented out. Only the DHT11 is used by the sketch at the moment.

But you are of course correct, changes to the pins used will be needed before the BMP280 can be used.

MySQLInjection:
at the first seconds when i start the Arduino, that the first seconds anything goes.

Try removing the BMP280 module from the breadboard.

Removing the BMP280 do not solve the Problem.
And yes youre right, at the moment i don´t use the BMP280 but i want to use it for the code, thats the reason, why the part of the BMP280 is excluded.

Your display has 2 rows (numbered 0..1), you are writing to row 3 with: lcd.setCursor(0, 2)

MySQLInjection:
Screenshot by Lightshot
Screenshot by Lightshot
Screenshot by Lightshot
Screenshot by Lightshot
Screenshot by Lightshot

Please post pictures here on the forum. The guide in the sticky post will show you how.