Sensor DHT and Arduino UNO Q

Hi everyone,

I’m trying to porting some of previous weatherstation samples I’ve built on others Arduino (mkrwifi1010, nano33iot, arduino R4 wifi) to the new Arduino Q.

I’m doing this usind Arduino IDE 2.3.6

I’ve learnt the hard way that there is no serial communication possible for debugging purposes and so I’m waiting for future updates.

But… never mind, it should be possible to write temperature and humidity to the led matrix!

So I wrote a strange piece of code that read sensors value and write them to the led matrix.

This code is perfectly compiling on Arduino R4 Wifi. I did the try to validate the matrix approach and the sensor communication.

This code is compiling and uploading without error on Arduino Uno Q but NOTHING IS HAPPENING. I tried to desperately add some blinking of leds just for debugging, but.. nothing.

Here comes the code:

#include <Arduino_LED_Matrix.h>
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
Arduino_LED_Matrix matrix;
DHT dht(DHTPIN, DHTTYPE);
float dhtTemp = 0;
float dhtHum = 0;
unsigned long previousMillis = 0;
const unsigned long interval = 3000;
int displayMode = 0;
bool sensorInitialized = false;

void setup() {
  // Initialize LED Matrix FIRST and show it works
  matrix.begin();
  // Show startup immediately
  uint8_t startup[104] = {
    1,1,1,1,1,1,1,1,1,1,1,1,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,1,1,1,1,1,1,1,1,1,1,1,1
  };
  matrix.draw(startup);
  delay(2000);
 
  // Show "initializing" pattern
  uint8_t init[104] = {
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,1,1,1,1,1,0,0,0,0,
    0,0,0,0,1,1,1,1,1,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0
  };
  matrix.draw(init);
 
 // NOW initialize DHT - but don't let it block
  dht.begin();

  // Brief delay
  delay(1000);

  sensorInitialized = true;
  // Show ready pattern
  uint8_t ready[104] = {
    0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,1,1,1,1,1,1,1,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0
  };

  matrix.draw(ready);
  delay(1000);
}

void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis; 
    if (sensorInitialized) {
      // Try to read sensor - use shorter timeout
      dhtTemp = dht.readTemperature();
      dhtHum = dht.readHumidity();
    }
   
    displayData();
    displayMode = (displayMode + 1) % 2;
  }
}

void displayData() {
  uint8_t frame[104] = {0};
  if (displayMode == 0) {
    // Temperature
    if (!isnan(dhtTemp) && dhtTemp > -50 && dhtTemp < 100) {
      int temp = (int)round(dhtTemp);
      drawNumber(frame, temp, true);
    } else {
      drawError(frame);
    }

  } else {
    // Humidity
    if (!isnan(dhtHum) && dhtHum >= 0 && dhtHum <= 100) {
      int hum = (int)round(dhtHum);
      drawNumber(frame, hum, false);
    } else {
      drawError(frame);
    }
  }
   matrix.draw(frame);
}

void drawNumber(uint8_t frame[], int num, bool isTemp) {
  if (num < 0) num = 0;
  if (num > 99) num = 99;
  int tens = num / 10;
  int ones = num % 10;
   // Icon
  if (isTemp) {
    frame[1*13 + 0] = 1; frame[1*13 + 1] = 1; frame[1*13 + 2] = 1;
    frame[2*13 + 1] = 1;
    frame[3*13 + 1] = 1;
    frame[4*13 + 1] = 1;
    frame[5*13 + 1] = 1;
    frame[6*13 + 1] = 1;
  } else {
    frame[1*13 + 0] = 1; frame[1*13 + 2] = 1;
    frame[2*13 + 0] = 1; frame[2*13 + 2] = 1;
    frame[3*13 + 0] = 1; frame[3*13 + 1] = 1; frame[3*13 + 2] = 1;
    frame[4*13 + 0] = 1; frame[4*13 + 2] = 1;
    frame[5*13 + 0] = 1; frame[5*13 + 2] = 1;
   frame[6*13 + 0] = 1; frame[6*13 + 2] = 1;
  }
  if (tens > 0) {
    drawDigit(frame, tens, 5);
    drawDigit(frame, ones, 9);
  } else {
    drawDigit(frame, ones, 7);
  }
}

void drawDigit(uint8_t frame[], int digit, int startCol) {
 switch(digit) {
    case 0:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1;
      frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 1:
      frame[1*13 + startCol+1] = 1;
      frame[2*13 + startCol+1] = 1;
      frame[3*13 + startCol+1] = 1;
      frame[4*13 + startCol+1] = 1;
      frame[5*13 + startCol+1] = 1;
      frame[6*13 + startCol+1] = 1;
      break;

    case 2:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1;
      frame[5*13 + startCol] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 3:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 4:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol+2] = 1;
      break;

    case 5:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 6:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 7:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+1] = 1;
      frame[5*13 + startCol+1] = 1;
      frame[6*13 + startCol+1] = 1;
      break;

    case 8:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;

    case 9:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
  }

}


void drawError(uint8_t frame[]) {
  frame[1*13 + 4] = 1; frame[1*13 + 8] = 1;
  frame[2*13 + 5] = 1; frame[2*13 + 7] = 1;
  frame[3*13 + 6] = 1;
  frame[4*13 + 6] = 1;
  frame[5*13 + 5] = 1; frame[5*13 + 7] = 1;
  frame[6*13 + 4] = 1; frame[6*13 + 8] = 1;
}

Consider that if I use same approach to the led matrix and I remove the sensor reading part as in following code:

//Arduino UNO Q LED Matrix - Number Display Test
//8 rows x 13 columns matrix
//No sensors - just displays numbers 0-99 in a loop




#include <Arduino_LED_Matrix.h>
Arduino_LED_Matrix matrix;
int currentNumber = 0;
unsigned long previousMillis = 0;
const unsigned long interval = 1000; // Change number every 1 second

void setup() {
  // Initialize LED Matrix
  matrix.begin();
    // Show startup pattern - 8x13 array

  uint8_t startup[104] = {
    1,1,1,1,1,1,1,1,1,1,1,1,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,0,0,0,0,0,0,0,0,0,0,0,1,
    1,1,1,1,1,1,1,1,1,1,1,1,1
  };
  matrix.draw(startup);
  delay(2000);
}

void loop() {
  unsigned long currentMillis = millis();
  
  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
        // Display current number
    displayNumber(currentNumber);
     // Increment number (loop back to 0 after 99)
    currentNumber++;
    if (currentNumber > 99) {
      currentNumber = 0;
    }
  }

}

void displayNumber(int num) {
  // 8 rows x 13 columns = 104 elements
  uint8_t frame[104] = {0};
  // Limit to valid range
  if (num < 0) num = 0;
  if (num > 99) num = 99;
  int tens = num / 10;
  int ones = num % 10;
  // Each digit is 3 columns wide
  if (tens > 0) {
    // Two digit number: tens at column 3, ones at column 8
    drawDigit(frame, tens, 3);
    drawDigit(frame, ones, 8);
  } else {
    // Single digit: center it at column 5
    drawDigit(frame, ones, 5);
  }
   matrix.draw(frame);
}


void drawDigit(uint8_t frame[], int digit, int startCol) {
  // Draw digit starting at row 1, using rows 1-6 (leaving top and bottom empty)
  // Array position = row * 13 + col
    switch(digit) {
    case 0:
      // Row 1
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      // Row 2
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      // Row 3
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+2] = 1;
      // Row 4
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      // Row 5
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      // Row 6
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
      
    case 1:
      frame[1*13 + startCol+1] = 1;
      frame[2*13 + startCol+1] = 1;
      frame[3*13 + startCol+1] = 1;
      frame[4*13 + startCol+1] = 1;
      frame[5*13 + startCol+1] = 1;
      frame[6*13 + startCol+1] = 1;
      break;
      
    case 2:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1;
      frame[5*13 + startCol] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
   
    case 3:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
     
    case 4:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol+2] = 1;
      break;

      case 5:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
      
    case 6:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
      
    case 7:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+1] = 1;
      frame[5*13 + startCol+1] = 1;
      frame[6*13 + startCol+1] = 1;
      break;
      
    case 8:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol] = 1; frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol] = 1; frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
      
    case 9:
      frame[1*13 + startCol] = 1; frame[1*13 + startCol+1] = 1; frame[1*13 + startCol+2] = 1;
      frame[2*13 + startCol] = 1; frame[2*13 + startCol+2] = 1;
      frame[3*13 + startCol] = 1; frame[3*13 + startCol+1] = 1; frame[3*13 + startCol+2] = 1;
      frame[4*13 + startCol+2] = 1;
      frame[5*13 + startCol+2] = 1;
      frame[6*13 + startCol] = 1; frame[6*13 + startCol+1] = 1; frame[6*13 + startCol+2] = 1;
      break;
  }
}

the magic happens and I see numbers incrementing on the led matrix as it should be.

The conclusion is that DHT.h library is not supported?

If so, why didn’t I get any compiling error?

And, how is possible to read a DHT22 (and ds18b02, and BME280,..) sensor with ArduinoQ?

Thanks a lot for support and guidance on these questions.

Sorry, but I will not look at code where every other line is empty. Good luck.

Hi,

You could use a visual help with STM user led 1 and 2.

You also could use Serial (RX pin 0 and TX pin 1) to debug you application with an RS232 to USB adaptator and this is the only way to detect a zephyr OS problem when loading your application as it use Serial to print error messages.

What DHT11 library are use using? I try with Adafruit DHT sensor library and my test application is working, without results as I have no DHT11.

// Global includes
#include <Arduino.h>
#include <Wire.h>
#include <Arduino_RouterBridge.h>
#include <DHT.h>
// Local includes

// Defines
#define DHTPIN 2
#define DHTTYPE DHT22

// Globals
DHT dht(DHTPIN, DHTTYPE);

/*
 * Initialize application
 *
 * @param: none
 *
 * @return: none
*/
void setup()
{

  // User led 1 blue pin
  pinMode(LED3_B, OUTPUT);

  // Signal start of setup
  digitalWrite(LED3_B, LOW);

  // Serial
  Serial.begin(115200);

  // User led 2 red pin
  pinMode(LED4_R, OUTPUT);
  digitalWrite(LED4_R, HIGH);

  // Monitor
  Monitor.begin();

  // I2C
  Wire.begin();

  // Do some stuff
  dht.begin();

  delay(5000);

  // Signal end of setup
  digitalWrite(LED3_B, HIGH);
}

/*
 * Application main loop
 *
 * @param: none
 *
 * @return: none
*/
void loop()
{

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();

  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t)) {
    Serial.println(F("Failed to read from DHT sensor!"));
  }
  else {
    Serial.print(F("Humidity: "));
    Serial.print(h);

    Serial.print(F("%  Temperature: "));
    Serial.print(t);
    Serial.println(F("°C "));
  }
  
  digitalWrite(LED4_R, !digitalRead(LED4_R));
 
  delay(2000);
}

I also make a test with I2C BME280 (BlueDot_BME280 library) that works fine.

Thanks @bborredon for your swing answer.

I think that my problem is not with reading DHT Sensor, but is related on how to view / debug what Arduino Q is reading.

May I ask you which system / IDE are you using, since Serial.print, that is the ovious/straighforward choice for communicating with the board apparently is NOT working with WINDOWS systems yet together with Arduino Q.

Anyway, thanks for your feedback and kind attempt to support.

BR

Andrea

I use 2.3.6 IDE on Debian 13.1.

As I write, you need to use an RS232 to USB adaptator connected to STM connector pin RX (0) and TX (1) (ground to ground, RX to TX and TX to RX but not VCC) and a terminal emulator (I use putty both on Windows and Linux) to connect to the serial device (COMXX on Windows and /dev/ttyUSBXX on Linux) with the same baudrate as in the sketch.

It’ the only way to debug Zephyr OS when the kernel load the sketch.

The problem you are referring to is with using the Monitor object to communicate via the UNO Q board's USB CDC serial port, as we discussed in your other topic:

As is explained by the documentation you referenced, the "UNO Q Board" core's Serial object being associated with the UART interface of the UNO Q's STM32U585 microcontroller is an intentional design by the Arduino developers:

https://docs.arduino.cc/tutorials/uno-q/user-manual/#from-serial-to-monitor


It is important to keep the two distinct subjects separate in your mind:

  • A bug that causes the Arduino App Lab's Serial Monitor to not receive data when running in non-SBC mode on a Windows machine.
  • The intentional design of the Serial object.

The former will be resolved in the next release of Arduino App Lab. The latter is something you will always need to consider when developing sketches for the UNO Q.

There is also now a fix for a problem that caused the serial output from the USB interface of the UNO Q (as produced by the Monitor object in the sketch code) to not be available in the Arduino IDE Serial Monitor:

Good morning.
I have the same issue of Andrea, it happens there is no way to get DHT11 sensor to work with Arduino Uno Q. I'm using the Monitor object to debug and tried with the Adafruit library and the test script provided from them. Nothing is coming out, only nan values. Same code works ok on ESP32 so there should be something wrong on the Arduino Q side but i really don't understand what it could be.
Thanks in advance for any help you'd provide.

Cristiano

I found a solution to the problem. I was originally using the TinyDHT library, but it did not work properly with the Arduino Q (UNO R4 WiFi). After switching to a different library called DHTesp, everything worked correctly.

Below is my working code using the DHTesp library.

#include <DHTesp.h>
#include <Arduino_RouterBridge.h>

#define DHTPIN 3

DHTesp dht;
unsigned long lastReadTime = 0;
const unsigned long readInterval = 3000; 

void setup() {
  Monitor.begin();
  delay(2000);
  dht.setup(DHTPIN, DHTesp::DHT22);
  Monitor.println("DHTesp stable reading test starting...");
}

void loop() {
  unsigned long currentTime = millis();
  if (currentTime - lastReadTime >= readInterval) {
    lastReadTime = currentTime;

    float tempC = dht.getTemperature();
    float humidity = dht.getHumidity();

    if (isnan(tempC)  isnan(humidity)  tempC < -40  tempC > 80  humidity < 0 || humidity > 100) {
      Monitor.println("Sensor read error, skipping this reading...");
    } else {
      float tempF = tempC * 9.0 / 5.0 + 32.0;

      String output = "TempF: " + String(tempF, 1) + "  Humidity: " + String(humidity, 1);
      Monitor.println(output);
    }
  }
}

BME280 works well with UNO Q IDE 2.3.7 in Here.

Thank you Momo for your suggestion.

I tried to properly install the library you pointed out within ArduinoAppLab but I couldn’t find it:

I used the same approach that worked out while adding other libraries. Am I perhaps missing something?

You spot on GolamMostafa :+1:

I’m using BME280 with I2C protocol on Arduino Q SDA and SCL pins with following libraries:

and everything works fine. Thank you for your suggestion