Guides · 11 min read

Dew Point Calculation Arduino: Mould Alarm and Ventilation Alert

Dew point calculation with Arduino: Magnus formula, indoor and outdoor DHT22 or SHT31, a mould risk table, a "ventilate" LED, ESP32 OLED and Telegram alerts.

Dew point calculation is the most effective way to understand indoor humidity problems with an Arduino: you find the temperature at which water vapour in the air starts to condense, and you know in advance that every surface colder than that will sweat. Windows steaming up in winter, black spots in the wall corner behind a wardrobe and mould in the bathroom all have the same cause: warm, moist indoor air touches a cold surface and drops below its dew point. With a temperature and humidity sensor, a formula of a few lines and an LED, you can turn that risk into a number.

In this guide you'll see what the dew point and the mould limit are, the Magnus formula and its constants, a ready-made temperature-humidity-dew point table, and when ventilating helps and when it does harm. Then you'll compare the DHT22 and SHT31, place the sensors correctly, and build a three-LED "ventilate" indicator with an Arduino Uno, a version with an OLED display and Telegram alerts on the ESP32, and MicroPython code for the Raspberry Pi Pico. You'll find the sensor basics in the DHT11 and DHT22 temperature and humidity sensor article.

DHT22 temperature and humidity sensor
DHT22 (AM2302): with ±0.5 °C and about ±2% humidity accuracy, a cheap sensor that's good enough for dew point calculations.

What is the dew point and why does mould form?

Air can hold a certain amount of water vapour depending on its temperature; warm air holds more, cold air less. Relative humidity (%RH) tells you what percentage of that capacity the air is actually carrying. As moist air cools, the water vapour in it stays the same but the capacity drops, so the relative humidity rises. The temperature at which relative humidity reaches 100% is called the dew point; below it the vapour turns into water. A room at 20 °C and 60% humidity has a dew point of about 12 °C: every surface in the room colder than 12 °C, such as a single-glazed window or an uninsulated outer wall corner, gets wet.

Mould doesn't need water running down the wall. Mould fungi also start to grow when the humidity of the air right at the surface stays above 80% for several days, which is why building physics uses 80% surface humidity as the limit. That means: in a room at 20 °C and 60% humidity the wall has to drop to 12 °C to get wet, but the mould risk begins once the wall falls below about 15.4 °C. In this article we'll call this temperature the "mould limit". Outer wall corners, window reveals, concrete beams and the backs of wardrobes standing against an outer wall can be 4–8 °C colder than the room air in winter, and that's exactly why mould always starts there.

Calculating the dew point with the Magnus formula

The most common way to calculate the dew point from temperature (T, °C) and relative humidity (RH, %) is the Magnus approximation. First you find an intermediate value: γ = ln(RH / 100) + a·T / (b + T). Then the dew point is Td = b·γ / (a − γ). All the code and tables in this article use the constants a = 17.62 and b = 243.12 °C (Sonntag 1990, over water, valid from about −45 to +60 °C). For the mould limit, ln(0.8) is subtracted from γ in the same formula; that gives the temperature at which 80% humidity forms at the surface. Because the formula contains a logarithm, RH must not be 0, which is why skipping the calculation when the sensor reports an error matters.

Constant setab (°C)Note
Sonntag 1990 (used here)17.62243.12Over water, about −45…+60 °C
Classic (Magnus-Tetens)17.27237.7Widely used older set; at room conditions the difference is well under 0.1 °C

Let's go through an example step by step: T = 20 °C, RH = 60%. Since ln(0.60) = −0.511 and 17.62 × 20 / (243.12 + 20) = 1.339, γ = 0.828. Td = 243.12 × 0.828 / (17.62 − 0.828) = 201.4 / 16.79 ≈ 12.0 °C. For the mould limit, take γ' = 0.828 − ln(0.8) = 0.828 + 0.223 = 1.052, which gives 243.12 × 1.052 / (17.62 − 1.052) ≈ 15.4 °C. On the Arduino, log() is the natural logarithm, so you can write the formula exactly as it is.

Temperature, humidity and dew point table

Air temperatureRelative humidityDew pointMould limit (80%)Absolute humidity
22 °C40%7.8 °C11.1 °C7.7 g/m³
22 °C50%11.1 °C14.5 °C9.7 g/m³
22 °C60%13.9 °C17.4 °C11.6 g/m³
20 °C40%6.0 °C9.3 °C6.9 g/m³
20 °C50%9.3 °C12.6 °C8.6 g/m³
20 °C60%12.0 °C15.4 °C10.3 g/m³
20 °C70%14.4 °C17.9 °C12.1 g/m³
18 °C50%7.4 °C10.7 °C7.7 g/m³
18 °C60%10.1 °C13.5 °C9.2 g/m³
18 °C70%12.4 °C15.9 °C10.7 g/m³
16 °C70%10.5 °C13.9 °C9.5 g/m³
5 °C80%1.8 °C5.0 °C5.4 g/m³
0 °C90%−1.4 °C1.6 °C4.4 g/m³
Read the table like this: in a room at 20 °C and 60% humidity, there's a mould risk if the coldest point of the wall is below 15.4 °C, and the surface gets wet below 12 °C. Bring the same room down to 50% and the mould limit drops to 12.6 °C; that 3 °C margin is enough to solve the problem in most homes. That's why it's recommended to keep indoor humidity in winter at 40–60%, preferably below 50% in older buildings with cold outer walls.

The ventilation decision: is it wetter inside or outside?

Seeing 90% humidity outside tempts you to keep the window shut, but that's misleading. Relative humidity depends on temperature; what you need to compare is the amount of water vapour the air carries, and the dew points show that most easily. Outdoor air at 0 °C and 90% humidity has a dew point of −1.4 °C; once it comes inside and warms up to 20 °C, its relative humidity drops to only about 24%. Indoor air at 20 °C and 60% has a dew point of 12 °C, so the winter air is much drier than the indoor air and ventilating lowers the humidity. In summer it can be the other way round: outdoor air at 25 °C and 70% has a dew point of 19.1 °C; ventilate a 15 °C cellar with that air and water collects on the walls. The rule is simple: ventilate when the outdoor dew point is clearly lower than the indoor dew point. The code in this article says "ventilate" at a difference of 3 °C and doesn't take that back until the difference drops below 2 °C; this small hysteresis keeps the LED from flickering when the values sit right at the limit.

Choosing a sensor: DHT22 or SHT31?

FeatureDHT11DHT22 (AM2302)SHT31
Temperature range and accuracy0–50 °C, ±2 °C−40…80 °C, ±0.5 °C−40…125 °C, ±0.3 °C
Humidity accuracy±5%Typically ±2%Typically ±2%
InterfaceSingle wireSingle wireI2C (0x44 or 0x45)
Reading interval1 sAt least 2 sVery fast
Dew point error (approx.)±2–3 °C±1 °C±0.7 °C
For this projectNot suitableGood indoors and outdoorsBest choice (indoors)

The dew point error comes from two sources. Around 20 °C and 60%, a ±2% humidity error shifts the dew point by about ±0.5 °C, and a ±0.5 °C temperature error also shifts it by about ±0.5 °C; together they add up to roughly ±1 °C with a DHT22. That's more than good enough for the "ventilate" decision, because on winter days the difference between indoor and outdoor dew points is usually 8–15 °C. The DHT11, with ±5% humidity and ±2 °C temperature error, can be off by 2–3 °C, so don't use it for this project. If your sensor won't read, the DHT sensor not reading article helps; for other options see the AHT10 and AHT20 and BME280 articles.

Wiring: Arduino Uno, ESP32 and Pico

PartArduino UnoESP32Raspberry Pi Pico
Indoor sensor dataDHT22 → D2SHT31 SDA → GPIO 21, SCL → GPIO 22DHT22 → GP15
Outdoor sensor dataDHT22 → D3DHT22 → GPIO 4DHT22 → GP14
OLED (I2C)-SDA → GPIO 21, SCL → GPIO 22 (same bus as SHT31)-
LEDs (with 220 Ω)Green D5, yellow D6, red D7Text on the OLEDYellow LED GP16
Sensor supply5V3V33V3(OUT)
A bare DHT22 needs a 10 kΩ pull-up resistor between its data pin and VCC; three-pin modules already have it. Don't read the DHT22 more often than every 2 seconds, or you'll get an old value or NaN. Connecting the outdoor sensor with a few metres of cable usually works fine; if read errors increase as the cable gets longer, lower the pull-up to 4.7 kΩ and power the sensor from 5 V (on the ESP32 and Pico, make sure the data line then doesn't go above 3.3 V).

Where to place the sensors

  • Indoor sensor: place it where it sees the average air of the room, 1–1.5 m above the floor; not next to a radiator, the cooker, the shower or in direct sun.
  • Window and outer wall: don't stick the sensor directly onto cold glass or an outer wall; measuring the wall surface is a separate job, covered below.
  • Outdoor sensor: put it on the north side, in the shade and sheltered from rain, a few centimetres away from the wall. A sensor in the sun reads several degrees too high.
  • Protection: put the outdoor sensor in a small ventilated box or a radiation shield made of stacked white plastic plates; a closed box traps humidity.
  • Window gap: rather than running the outdoor cable through the window seal, use a thin cable along the edge of the frame; a window left ajar spoils the indoor reading.
  • Quiet periods: showering, cooking and drying laundry naturally raise indoor humidity; base the decision on an average over a few minutes rather than a single reading.

Step by step: a "ventilate" indicator with Arduino Uno

  1. From the Library Manager, install the DHT sensor library (Adafruit) and its dependency Adafruit Unified Sensor.
  2. Connect the indoor DHT22's data to D2 and the outdoor DHT22's data to D3; both VCC pins go to 5V and both GND pins to GND.
  3. Connect the green, yellow and red LEDs to D5, D6 and D7 through 220 Ω resistors.
  4. Upload the code below, open the Serial Monitor at 9600 baud and watch the indoor and outdoor dew points.
  5. Before moving the outdoor sensor outside, run both sensors side by side for a few minutes; if their dew points differ by more than 1 °C, one of them is drifting.
C++ (Arduino IDE)
1// İç ve dış DHT22 ile çiy noktası ve "havalandır" göstergesi (Arduino Uno)
2// Indoor + outdoor DHT22: dew point and a "ventilate" indicator (Arduino Uno)
3#include <DHT.h>
4
5DHT dhtIn(2, DHT22);                   // iç sensör D2 / indoor sensor on D2
6DHT dhtOut(3, DHT22);                  // dış sensör D3 / outdoor sensor on D3
7const int LED_GREEN = 5, LED_YELLOW = 6, LED_RED = 7;
8
9const float A = 17.62, B = 243.12;     // Magnus sabitleri (Sonntag 1990) / Magnus constants
10const float RH_LIMIT = 60.0;           // bu nemin üstünde uyar / warn above this indoor RH
11const float MARGIN_ON = 3.0;           // dış çiy noktası en az 3 °C düşükse havalandır / ventilate if outdoor Td is 3 °C lower
12const float MARGIN_OFF = 2.0;          // 2 °C'nin altına inince bırak (histerezis) / release below 2 °C (hysteresis)
13bool ventilate = false;
14
15float dewPoint(float t, float rh) {    // Magnus formülü / Magnus formula
16  float g = log(rh / 100.0) + (A * t) / (B + t);
17  return (B * g) / (A - g);
18}
19
20float mouldLimit(float t, float rh) {  // yüzeyde %80 nem oluşan sıcaklık / surface temp where RH reaches 80 %
21  float g = log(rh / 100.0) + (A * t) / (B + t) - log(0.8);
22  return (B * g) / (A - g);
23}
24
25void setLeds(bool g, bool y, bool r) {
26  digitalWrite(LED_GREEN, g);
27  digitalWrite(LED_YELLOW, y);
28  digitalWrite(LED_RED, r);
29}
30
31void setup() {
32  Serial.begin(9600);
33  dhtIn.begin();
34  dhtOut.begin();
35  pinMode(LED_GREEN, OUTPUT);
36  pinMode(LED_YELLOW, OUTPUT);
37  pinMode(LED_RED, OUTPUT);
38}
39
40void loop() {
41  delay(2500);                         // DHT22 en fazla 2 sn'de bir okunur / read DHT22 at most every 2 s
42  float tIn = dhtIn.readTemperature(), hIn = dhtIn.readHumidity();
43  float tOut = dhtOut.readTemperature(), hOut = dhtOut.readHumidity();
44  if (isnan(tIn) || isnan(hIn) || isnan(tOut) || isnan(hOut)) {
45    Serial.println(F("Sensor okunamadi / Sensor read failed"));
46    setLeds(LOW, LOW, HIGH);
47    return;
48  }
49
50  float tdIn = dewPoint(tIn, hIn);
51  float tdOut = dewPoint(tOut, hOut);
52  float diff = tdIn - tdOut;           // pozitif = dışarısı daha kuru / positive = outside air is drier
53  if (!ventilate && diff >= MARGIN_ON) ventilate = true;
54  if (ventilate && diff < MARGIN_OFF) ventilate = false;
55
56  if (hIn < RH_LIMIT) {
57    setLeds(HIGH, LOW, LOW);           // nem normal / humidity OK
58  } else if (ventilate) {
59    setLeds(LOW, HIGH, LOW);           // havalandır / ventilate now
60  } else {
61    setLeds(LOW, LOW, HIGH);           // nem yüksek ama dışarısı daha nemli / humid but outside is wetter
62  }
63
64  Serial.print(F("Ic / In: "));   Serial.print(tIn, 1);  Serial.print(F(" C %")); Serial.print(hIn, 0);
65  Serial.print(F("  Td ")); Serial.print(tdIn, 1);
66  Serial.print(F("  Kuf siniri / Mould limit ")); Serial.print(mouldLimit(tIn, hIn), 1);
67  Serial.print(F(" | Dis / Out: ")); Serial.print(tOut, 1); Serial.print(F(" C %")); Serial.print(hOut, 0);
68  Serial.print(F("  Td ")); Serial.print(tdOut, 1);
69  Serial.println(ventilate ? F("  -> HAVALANDIR / VENTILATE") : F(""));
70}
LEDStateWhat to do?
GreenIndoor humidity below 60%Nothing to do
YellowHumidity high, outdoor air clearly drierAir the room for 5–10 minutes with the windows wide open
RedHumidity high but the outdoor air isn't drier (or a sensor error)Don't open the window; raise the heating a little or use a dehumidifier

OLED display and Telegram alerts with the ESP32

The ESP32 version uses the more accurate SHT31 indoors and a DHT22 outdoors, and shows the results on a 0.96-inch OLED display. The SHT31 and the OLED share the same I2C bus (addresses 0x44 and 0x3C). When the "ventilate" state begins, the ESP32 sends a Telegram message and, while it lasts, reminds you at most once an hour. Before uploading, install the Adafruit SHT31, DHT sensor library and Adafruit SSD1306 libraries, and fill in your Wi-Fi details and the bot token you got from BotFather. Bot setup is covered in the ESP32 Telegram bot article and the display in the SSD1306 OLED display article.

C++ (Arduino IDE)
1// ESP32: iç SHT31 + dış DHT22 + OLED + Telegram "havalandır" bildirimi
2// ESP32: indoor SHT31 + outdoor DHT22 + OLED + Telegram "ventilate" alert
3#include <WiFi.h>
4#include <WiFiClientSecure.h>
5#include <HTTPClient.h>
6#include <Wire.h>
7#include <Adafruit_SHT31.h>
8#include <DHT.h>
9#include <Adafruit_GFX.h>
10#include <Adafruit_SSD1306.h>
11
12const char* WIFI_SSID = "WIFI_ADI";              // Wi-Fi adın / your Wi-Fi name
13const char* WIFI_PASS = "WIFI_SIFRESI";          // Wi-Fi şifren / your Wi-Fi password
14const char* BOT_TOKEN = "123456789:ABCdefGhIJK"; // BotFather'dan / from BotFather
15const char* CHAT_ID   = "123456789";             // sohbet kimliğin / your chat id
16
17Adafruit_SHT31 sht = Adafruit_SHT31();           // iç sensör, I2C 0x44 / indoor sensor
18DHT dhtOut(4, DHT22);                            // dış sensör GPIO 4 / outdoor sensor
19Adafruit_SSD1306 display(128, 64, &Wire, -1);
20
21const float A = 17.62, B = 243.12;               // Magnus sabitleri / Magnus constants
22const float RH_LIMIT = 60.0;
23const float MARGIN_ON = 3.0, MARGIN_OFF = 2.0;
24const unsigned long ALERT_GAP_MS = 3600000UL;    // en fazla saatte bir mesaj / at most one message per hour
25
26bool ventilate = false;
27unsigned long lastAlert = 0;
28bool alertSent = false;
29
30float dewPoint(float t, float rh) {
31  float g = log(rh / 100.0) + (A * t) / (B + t);
32  return (B * g) / (A - g);
33}
34
35bool sendTelegram(const String& text) {
36  if (WiFi.status() != WL_CONNECTED) return false;
37  WiFiClientSecure client;
38  client.setInsecure();                          // sertifika doğrulaması yok / no certificate check
39  HTTPClient http;
40  String url = String("https://api.telegram.org/bot") + BOT_TOKEN + "/sendMessage";
41  if (!http.begin(client, url)) return false;
42  http.addHeader("Content-Type", "application/json");
43  int code = http.POST(String("{\"chat_id\":\"") + CHAT_ID + "\",\"text\":\"" + text + "\"}");
44  http.end();
45  return code == 200;
46}
47
48void setup() {
49  Serial.begin(115200);
50  Wire.begin(21, 22);
51  if (!sht.begin(0x44)) Serial.println("SHT31 yok / SHT31 missing");
52  dhtOut.begin();
53  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
54  display.setTextColor(SSD1306_WHITE);
55  WiFi.mode(WIFI_STA);
56  WiFi.begin(WIFI_SSID, WIFI_PASS);              // bağlantı arka planda kurulur / connects in the background
57}
58
59void loop() {
60  float tIn = sht.readTemperature(), hIn = sht.readHumidity();
61  float tOut = dhtOut.readTemperature(), hOut = dhtOut.readHumidity();
62  if (isnan(tIn) || isnan(hIn) || isnan(tOut) || isnan(hOut)) {
63    Serial.println("Sensor hatasi / Sensor error");
64    delay(3000);
65    return;
66  }
67  float tdIn = dewPoint(tIn, hIn), tdOut = dewPoint(tOut, hOut);
68  float diff = tdIn - tdOut;
69  if (!ventilate && diff >= MARGIN_ON) ventilate = true;
70  if (ventilate && diff < MARGIN_OFF) ventilate = false;
71  bool advise = ventilate && hIn >= RH_LIMIT;
72
73  display.clearDisplay();
74  display.setTextSize(1);
75  display.setCursor(0, 0);
76  display.printf("Ic  %4.1fC %3.0f%%\n", tIn, hIn);
77  display.printf("    Ciy %4.1fC\n", tdIn);
78  display.printf("Dis %4.1fC %3.0f%%\n", tOut, hOut);
79  display.printf("    Ciy %4.1fC\n", tdOut);
80  display.setTextSize(2);
81  display.setCursor(0, 44);
82  display.print(advise ? "HAVALANDIR" : (hIn >= RH_LIMIT ? "NEM YUKSEK" : "IYI"));
83  display.display();
84
85  if (advise && (!alertSent || millis() - lastAlert > ALERT_GAP_MS)) {
86    String msg = "Havalandirma zamani: ic %" + String(hIn, 0) + ", ic ciy " + String(tdIn, 1) +
87                 " C, dis ciy " + String(tdOut, 1) + " C";
88    if (sendTelegram(msg)) {
89      alertSent = true;
90      lastAlert = millis();
91    }
92  }
93  if (!advise) alertSent = false;                // durum düzelince bir sonraki uyarı hazır / re-arm when it clears
94  delay(5000);
95}

The alertSent and lastAlert variables in the code prevent a flood of messages: the first message goes out as soon as the state begins, a reminder follows an hour later if it continues, and once the humidity is back to normal the system re-arms for the next event. The text on the OLED is written in ASCII characters because the default Adafruit GFX font can't show accented letters. If the Wi-Fi connection drops, measuring and the display keep working; only the alert can't be sent. If you run the device for a long time, you can dry the SHT31 by briefly switching its built-in heater on and off when you suspect condensation.

Dew point with Raspberry Pi Pico and MicroPython

The rp2 port of MicroPython has a built-in dht module for the DHT22, so no extra library is needed. The indoor sensor goes to GP15, the outdoor sensor to GP14 and the yellow LED to GP16 through 220 Ω, and both sensors are powered from the 3V3(OUT) pin. The code reads both sensors every five seconds, calculates the dew point difference and drives the LED with the same 3 °C / 2 °C hysteresis. If a read fails, measure() raises an OSError; the code catches it and tries again a few seconds later.

MicroPython
1# Raspberry Pi Pico: iki DHT22 ile çiy noktası ve havalandırma uyarısı
2# Raspberry Pi Pico: dew point and a ventilation hint with two DHT22 sensors
3from machine import Pin
4import dht, math, time
5
6d_in = dht.DHT22(Pin(15))       # iç sensör GP15 / indoor sensor
7d_out = dht.DHT22(Pin(14))      # dış sensör GP14 / outdoor sensor
8led = Pin(16, Pin.OUT)          # sarı LED: havalandır / yellow LED: ventilate
9
10A, B = 17.62, 243.12            # Magnus sabitleri / Magnus constants
11
12def dew_point(t, rh):
13    g = math.log(rh / 100) + A * t / (B + t)
14    return B * g / (A - g)
15
16ventilate = False
17while True:
18    try:
19        d_in.measure()
20        d_out.measure()
21    except OSError:
22        print("Sensor okunamadi / Sensor read failed")
23        time.sleep(3)
24        continue
25    t_in, h_in = d_in.temperature(), d_in.humidity()
26    t_out, h_out = d_out.temperature(), d_out.humidity()
27    diff = dew_point(t_in, h_in) - dew_point(t_out, h_out)
28    if not ventilate and diff >= 3.0:
29        ventilate = True
30    elif ventilate and diff < 2.0:
31        ventilate = False
32    led.value(ventilate and h_in >= 60)
33    print("Ic %.1f C %%%d  Dis %.1f C %%%d  fark %.1f C" % (t_in, h_in, t_out, h_out, diff))
34    time.sleep(5)

Measuring the wall surface: seeing the real mould risk

Indoor and outdoor air are enough for the ventilation decision, but if you want to see the mould risk for certain, you need to measure the surface temperature of the problem corner. The easiest way is to tape a thin DS18B20 sensor to the coldest corner of the wall with aluminium tape and insulate its tip from the room air with a bit of foam. Then you apply a simple rule: give a yellow warning if the surface is below the mould limit and a red one if it gets within 1 °C of the dew point. For one-off checks, scanning the wall with an MLX90614 contactless thermometer to find the coldest spot is also a good method; a device combining the two is the natural next step for the ideas in this article.

Project ideas

  • Bathroom fan automation: after a shower, switch the extractor fan on with a relay when humidity goes above 70% and off again below 60%.
  • Cellar ventilation control: an automatic system that runs a fan only when the outdoor dew point is at least 5 °C lower than indoors; it keeps humid summer air out.
  • Room-by-room humidity map: put an ESP32 and a sensor in every room and collect the data on a Home Assistant dashboard via MQTT.
  • Long-term logging: write the dew point and mould limit to an SD card once a minute and see on a chart which hours are risky in winter.
  • Window-edge warning: put a DS18B20 on the edge of the glass and let it warn you when the glass approaches the dew point, before it steams up in the morning.

Common mistakes and how to fix them

SymptomLikely causeFix
Dew point shows "nan"Sensor not read, RH = 0 or NaNCheck with isnan(), keep the read interval above 2 s
Outdoor sensor always shows 99.9%Sensor wet from condensationProtect it from rain and fog, use a ventilated housing
Outdoor temperature several degrees high at noonSun shining on the sensorMove it to the north side and into the shade, use a radiation shield
Two sensors side by side give different dew pointsOne sensor has driftedCompare them side by side and add the difference as a fixed offset in the code
LED keeps switching between yellow and redValues right at the threshold, no hysteresisUse the 3 °C / 2 °C hysteresis from this article and average the readings
Humidity rises again right after airingThe source is still there (laundry, shower) or the walls are wetReduce the moisture source, air briefly and often, don't switch off the heating

If you're just starting to measure temperature and humidity, the DHT11 Temperature and Humidity, ESP32 DHT22 Temperature and Humidity (with LCD) and ESP32 Temperature Logger projects in the BlueGrays app are a good start; each comes with a step-by-step circuit diagram and ready-to-use code. Add the dewPoint() function from this article to their code and you can show the dew point on the display too.

Frequently asked questions

How do you calculate the dew point?

The most common method is the Magnus formula: first find γ = ln(RH/100) + a·T/(b+T), then the dew point is Td = b·γ/(a−γ). The constants are usually a = 17.62 and b = 243.12 °C. For example, at 20 °C and 60% humidity the dew point is about 12 °C.

What should the humidity be at home?

In winter, 40–60% is recommended for living rooms. In older, poorly insulated buildings with cold outer walls, staying below 50% is safer to reduce the mould risk. Below 35% the air can dry out your throat and skin.

Is it right to ventilate in winter when it's humid outside?

Usually yes. Cold outdoor air may show 90% humidity, but it carries little water vapour; once it comes in and warms up, its relative humidity drops to around 20–30%. For a proper comparison, look at the indoor and outdoor dew points: if the outdoor dew point is clearly lower, ventilating reduces indoor humidity.

At what humidity does mould form?

Mould doesn't need the surface to be wet; if the humidity of the air next to the surface stays above 80% for several days, mould can start to grow. So what really matters isn't the room humidity but the humidity at the coldest wall corner. In a room at 20 °C and 60%, that limit is crossed when the wall drops below 15.4 °C.

Is a DHT11 good enough for the dew point?

Not really. The DHT11's ±5% humidity and ±2 °C temperature error can throw the dew point off by 2–3 °C, and because it can't measure below 0 °C it's useless as an outdoor sensor in winter. Choose a more accurate sensor such as the DHT22, SHT31 or AHT20.

What's the difference between dew point and relative humidity?

Relative humidity tells you what percentage of its capacity the air is carrying, and it changes whenever the temperature changes. The dew point expresses the amount of water vapour in the air directly as a temperature and stays the same when the air warms up or cools down. That's why the dew point is the better measure for comparing indoor and outdoor air, or rooms at different temperatures.

See all projects
Temperature and Humidity with DHT11
AR-55Intermediate

Temperature and Humidity with DHT11

How warm is your room, and is the air humid or dry? The DHT11 sensor measures temperature and humidity, and the Arduino writes the values on a two-line LCD screen, refreshing every couple of seconds.

4.7(47)
96
ESP32 DHT22 Temperature and Humidity (with LCD Display)
ES-15Intermediate

ESP32 DHT22 Temperature and Humidity (with LCD Display)

This project measures ambient temperature and humidity using a DHT22 sensor and displays the data in real time on a 16x2 I2C LCD. Data is read from the sensor using the one-wire protocol via the Adafruit DHT library. This project serves as the foundation for IoT weather stations, smart home automation, or environmental monitoring systems in greenhouses. Communication with the DHT22 is established via the ESP32's GPIO 4 pin.

4.8(38)
57
ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
ES-40Advanced
Premium

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)

Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

4.7(7)
12
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
ES-32Advanced
Premium

ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

4.3(10)
22
Dot Matrix Clock, Calendar and Weather Station (MAX7219, DS1307)
AR-85Intermediate
Premium

Dot Matrix Clock, Calendar and Weather Station (MAX7219, DS1307)

A scrolling-text board for your desk or wall that shows the time, the date and the room's weather in turn.

5.0(50)
66
Temperature Measurement with NTC and 2x16 Lcd Display
AR-44Beginner
Premium

Temperature Measurement with NTC and 2x16 Lcd Display

Measure the temperature around you with a sensor that looks like a tiny bead. This part, called an NTC, lets electricity through more easily as it warms up; the Arduino reads that change, turns it…

4.5(33)
44
ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)
ES-41Advanced
Premium

ESP32 Motion Alarm System (PIR + Buzzer + LED + Telegram)

A smart security alarm: when the PIR sensor detects motion, it sounds the buzzer, lights the LED and sends the owner an instant Telegram notification. A 30-second cooldown limits how often the alarm repeats; it does not filter out the PIR sensor's false detections. Use it at home, in a garage, a storeroom or a study.

4.0(1)
9
ESP32 I2C LCD Display (16x2)
ES-17Intermediate
Premium

ESP32 I2C LCD Display (16x2)

In this project we connect a 16x2 character LCD to the ESP32 over I2C and display text. With I2C, just 2 data pins (SDA and SCL) control the screen, instead of the 6+ pins a classic parallel connection wastes. The code prints a fixed message on the first line and a counter that goes up every second on the second. At startup an I2C scanner also prints the display's address to the Serial Monitor (usually 0x27 or 0x3F).

4.9(23)
40