Ask a parent, teacher, or trusted adult before building, powering a circuit, using tools or batteries, or buying parts. Purchases are optional and at your own cost. If anything gets hot, smells burnt, leaks, swells, sparks, or moves unexpectedly, switch off or disconnect power without touching the damaged or hot part, then tell an adult. Read safety rules

All projects
🌡️🟡 Intermediate 1 hr

Mini Weather Station

Measure temperature and humidity and show them live on an LCD screen.

What You'll Build

This is your own weather station for a bedroom, greenhouse or classroom. A DHT11 sensor measures the temperature and the humidity of the air, and a small LCD screen displays both values, refreshing every couple of seconds. It is the first project where your Arduino talks back with words instead of blinking lights.

What You Need

  • ✓Arduino Uno
  • ✓DHT11 sensor module (3-pin)
  • ✓16×2 I2C LCD
  • ✓Breadboard
  • ✓Jumper wires

How It Works

The DHT11 contains a tiny thermometer and a humidity-sensitive material. It packages both readings into a digital message the Arduino reads through one data wire. The LCD uses I2C, a two-wire system that lets many devices share the same pair of wires — that is why it only needs SDA and SCL instead of a dozen connections.

Before You Wire It

Ask a parent, teacher, or trusted adult before building, powering a circuit, using tools or batteries, or buying parts. Purchases are optional and at your own cost. If anything gets hot, smells burnt, leaks, swells, sparks, or moves unexpectedly, switch off or disconnect power without touching the damaged or hot part, then tell an adult. Read safety rules

Wiring

  1. 1DHT11 VCC → 5V, GND → GND, DATA → pin 2. Blue 3-pin modules already have the pull-up built in.
  2. 2LCD VCC → 5V, GND → GND.
  3. 3LCD SDA → A4, SCL → A5 (on an Uno).

Step-by-Step Instructions

  1. 1

    Install the libraries

    In the Arduino IDE open Library Manager and install 'DHT sensor library' by Adafruit (it will also ask for 'Adafruit Unified Sensor' — accept) and 'LiquidCrystal I2C' by Frank de Brabander. Libraries are code other makers wrote so you do not have to.

  2. 2

    Wire the sensor

    Three wires only: 5V, GND and DATA to pin 2. The little blue module has the pull-up resistor on the board already, so you do not add one. If readings come back as nan, check the wires and wait two seconds between reads.

  3. 3

    Find your screen's I²C address

    Most backpacks are 0x27, but plenty are 0x3F. Run the Arduino IDE's 'i2c_scanner' example once and use whatever address it prints in LiquidCrystal_I2C lcd(0x27, 16, 2). If the screen stays blank or shows only white blocks, that address (or the contrast pot) is usually the reason.

  4. 4

    Connect the screen

    Only four wires: power, ground, SDA, SCL. If nothing appears, turn the little blue potentiometer on the back to adjust contrast.

  5. 5

    Print to the screen

    Upload the sketch. The first line shows temperature, the second shows humidity.

  6. 6

    Log the weather

    Note the reading every hour for a day and see how your room changes between morning and night.

Arduino Code

mini-weather-station.ino
#include <DHT.h>
#include <LiquidCrystal_I2C.h>

DHT dht(2, DHT11);
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  dht.begin();
  lcd.init();
  lcd.backlight();
}

void loop() {
  float temp = dht.readTemperature();
  float hum  = dht.readHumidity();

  if (isnan(temp) || isnan(hum)) {
    lcd.setCursor(0, 0);
    lcd.print("Sensor error   ");
    return;
  }

  lcd.setCursor(0, 0);
  lcd.print("Temp: ");
  lcd.print(temp);
  lcd.print((char)223);
  lcd.print("C ");

  lcd.setCursor(0, 1);
  lcd.print("Humidity: ");
  lcd.print(hum);
  lcd.print("%");

  delay(2000);
}

Understanding the Code

DHT dht(2, DHT11);

Creates a sensor object on pin 2 and tells the library which model you own.

float temp

A float stores decimal numbers like 21.7 — perfect for temperature.

isnan(temp)

Checks for 'not a number'. If the sensor did not answer in time you show an error instead of nonsense.

lcd.setCursor(0, 1)

Moves the writing position to column 0 of the second row.

Challenges & Upgrades

Add an LED that turns red when the room goes above 28 °C.
Show the highest and lowest temperature seen today.
Swap the DHT11 for a DHT22 and compare accuracy.

Troubleshooting

😖 Screen is blank but backlit

Fix: Turn the contrast trimmer on the back of the LCD module.

😖 Readings say nan

Fix: Wait at least two seconds between reads — the DHT11 is slow. Also check the DATA wire and that you picked DHT11 (not DHT22) in the code. Bare 4-pin sensors need a 10kΩ pull-up from DATA to 5V; the blue 3-pin module already has one.

Helpful Resources

Want extra help? Build a virtual circuit in Tinkercad or watch a video guide for this project. These are optional external resources.

Try it in Tinkercad

Open Tinkercad Circuits to recreate and test the circuit online before using real parts.

Open Tinkercad

Watch video guides

Browse video tutorials for this exact project and compare how each part is connected.

Find videos

Outside examples may use different pins or parts. Follow this page’s wiring and safety instructions if they do not match. Ask a trusted adult before following an outside guide or buying anything; external parts, advice, and costs are your responsibility.

Up next

🚗 Obstacle-Avoiding Car

Build This