shivc
February 3, 2026, 11:22pm
1
The 0.96” screen says that the temperature is 0 °C in my house, and that there is no water vapor in the air. I think something’s wrong with my code.
Code:
#include <DHT.h>
#include <Arduino.h>
#include <U8x8lib.h>
#define DHTPIN 3
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
void setup(void) {
Serial.begin(9600);
Serial.println("DHTxx test!");
dht.begin();
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
}
void loop(void) {
float temp, humi;
temp = dht.readTemperature();
humi = dht.readHumidity();
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 33);
u8x8.print("Temp:");
u8x8.print(temp);
u8x8.print("C");
u8x8.setCursor(0, 50);
u8x8.print("Humidity");
u8x8.print(humi);
u8x8.print("%");
u8x8.refreshDisplay();
delay(200);
}
The manual is here .
The wiring “diagram” is in the manual.
xfpd
February 4, 2026, 12:54am
2
As always, post your wiring diagram here.
The screen only displays what is sent to it. Do you have a DHT11? Not a DHT22?
shivc
February 4, 2026, 2:08am
4
To @xfpd :
Wiring Diagram (green wires are the grove cables i would use if i broke the modules apart)
I don’t know which one I have. It is a black case (rectangular prism, not the other one that slopes in at one side.
To @LarryD :
I followed the manual; I didn’t know it needed those. I’ll incorporate your suggestions, but what function do I use instead of delay?
shivc
February 4, 2026, 2:11am
6
i dont know anything about the display, i just followed the manual. All I know is that it has a 0.96 inch diagonal
shivc
February 4, 2026, 2:17am
8
But displaying the text isn’t the issue, the DHT not reporting is?
Your DHT should plugged into D3.
good luck.. ~q
shivc
February 4, 2026, 2:19am
11
How do I incorporate the one second wait without delay?
shivc
February 4, 2026, 2:21am
12
ohh i forgot to put a cable
LarryD
February 4, 2026, 2:23am
13
unsigned long previousMillis = 0;
const unsigned long interval = 1000; // 1 second
void setup()
{
Serial.begin(9600);
}
void loop()
{
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval)
{
previousMillis = currentMillis;
//Code below runs every 1 second
Serial.println("1 second passed");
}
// Other non-blocking code goes here.
}
the code you are using is straight out of the manual..
so either your dht is bad or just connected wrong..
if the diagram you posted is correct, then yes, it’s wrong and should be D3..
nice kit.. ~q
shivc
February 4, 2026, 2:28am
15
It still reads 0, and also the LED is on now? it was connected to d4, so how? (I didn’t show it in the wiring diagram because the lesson isn’t even supposed to use it!)
from page 51..
Use Grove cable to connect the OLED to Seeeduino Lotus’s I2C interface (Note: I2C’s default
address is 0x78). Connect the Grove Temperature and Humidity Sensor to Seeeduino Lotus’s
digital signal interface D3.
~q
shivc
February 4, 2026, 2:54am
17
This is my code after I tried adding the waiting method you suggested
#include <DHT.h>
#include <Arduino.h>
#include <U8x8lib.h>
#define DHTPIN 3
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
unsigned long previousMillis = 0;
const unsigned long interval = 1000;
void setup(void) {
Serial.begin(9600);
Serial.println("DHTxx test!");
dht.begin();
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFlipMode(1);
}
void loop(void) {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval)
{
previousMillis = currentMillis;
float temp, humi;
temp = dht.readTemperature();
humi = dht.readHumidity();
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 33);
u8x8.print("Temp: ");
u8x8.print(temp);
u8x8.print("C");
u8x8.setCursor(0, 50);
u8x8.print("Humidity: ");
u8x8.print(humi);
u8x8.print("%");
u8x8.refreshDisplay();
}
}
shivc
February 4, 2026, 2:56am
18
Screen is connected to I2C and DHT is connected to P3 for me, idk what’s happening
shivc
February 4, 2026, 3:09am
19
There was something I didn’t say at the start: the temperature value keeps flashing between 0.00 and nan, but I recently discovered that turning the potentiometer all the way up makes the humidity value flash nan instead of the temperature value
xfpd
February 4, 2026, 3:42am
20
LarryD:
50 lines on the displa
u8g2/u8x8 use "pixel" lines (and columns), not character lines (and columns).