Project Overview
A DIY weather station is one of the most satisfying beginner-to-intermediate maker projects. It combines hardware wiring, programming, and a practical real-world application — and when it's done, you actually use it every day. In this guide, you'll build a weather station that displays temperature and humidity on an LCD screen and logs readings via Serial for later analysis.
What You'll Build
- Real-time temperature (°C and °F) and humidity display on a 16x2 LCD
- Serial output for data logging to a computer
- Optional: add a BMP280 module for barometric pressure readings
Parts List
| Component | Quantity | Notes |
|---|---|---|
| Arduino Uno (or Nano) | 1 | Any 5V Arduino works |
| DHT22 sensor module | 1 | More accurate than DHT11 |
| 16x2 LCD (I2C module) | 1 | I2C version simplifies wiring |
| Jumper wires | 10–15 | Male-to-male and male-to-female |
| Breadboard | 1 | Half-size is fine |
| USB cable | 1 | For programming and power |
Step 1: Wiring the DHT22 Sensor
The DHT22 module (3-pin version) connects directly to the Arduino with three wires:
- VCC → Arduino 5V pin
- GND → Arduino GND pin
- DATA → Arduino Digital Pin 2
If you're using a bare DHT22 chip (4-pin), add a 10kΩ pull-up resistor between VCC and DATA.
Step 2: Wiring the I2C LCD
The I2C LCD module only needs four wires — this is one of its major advantages over parallel-wired LCDs:
- VCC → Arduino 5V
- GND → Arduino GND
- SDA → Arduino A4
- SCL → Arduino A5
Note: On Arduino Mega, SDA is pin 20 and SCL is pin 21.
Step 3: Installing Libraries
Open the Arduino IDE and install the following libraries via Sketch → Include Library → Manage Libraries:
- DHT sensor library by Adafruit
- Adafruit Unified Sensor (dependency for the DHT library)
- LiquidCrystal I2C by Frank de Brabander
Step 4: The Code
Here is the complete sketch for your weather station:
#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
dht.begin();
lcd.init();
lcd.backlight();
lcd.print("Weather Station");
delay(2000);
lcd.clear();
}
void loop() {
float humidity = dht.readHumidity();
float tempC = dht.readTemperature();
float tempF = dht.readTemperature(true);
if (isnan(humidity) || isnan(tempC)) {
lcd.print("Sensor Error!");
return;
}
lcd.setCursor(0, 0);
lcd.print("T:");
lcd.print(tempC, 1);
lcd.print("C ");
lcd.print(tempF, 1);
lcd.print("F");
lcd.setCursor(0, 1);
lcd.print("Humidity: ");
lcd.print(humidity, 1);
lcd.print("%");
Serial.print("Temp: ");
Serial.print(tempC);
Serial.print("C | Humidity: ");
Serial.println(humidity);
delay(2000);
}
Step 5: Upload and Test
- Connect your Arduino via USB.
- Select the correct board and COM port in the Arduino IDE.
- Upload the sketch (Ctrl+U).
- Open the Serial Monitor (Ctrl+Shift+M) at 9600 baud to see readings.
- Check the LCD — you should see live temperature and humidity.
If the LCD shows nothing, adjust the contrast potentiometer on the back of the I2C module. If sensor readings show "nan", check your wiring on Pin 2 and verify the library is installed.
Taking It Further
Once your basic station is running, consider these upgrades:
- Add a BMP280 module for barometric pressure — connects via I2C alongside the LCD.
- Log data to an SD card with a microSD module for long-term trend tracking.
- Add WiFi with an ESP8266 or ESP32 to send readings to a web dashboard or home automation system like Home Assistant.
- Build an enclosure from a project box with ventilation holes to protect the electronics while allowing accurate readings.
This project is a genuine entry point into IoT and environmental sensing — skills that transfer directly into dozens of other maker projects.