A desk-friendly weather station that shows live temperature and humidity on a crisp OLED display — a perfect first sensor project.
What you’ll build
The DHT11 sensor reports temperature and relative humidity once a second. The Arduino Nano reads it and renders big, readable numbers on the 0.96″ OLED over I2C, complete with degree symbols and a humidity bar.
Components you’ll need
| Component | Qty | Price |
|---|---|---|
| Arduino Nano ATmega328P Compatible Board | 1 | ₹149 |
| DHT11 | 1 | ₹69 |
| 0.96 inch OLED Display Module I2C 128×64 Blue | 1 | ₹149 |
| 400 Point Breadboard | 1 | ₹299 |
| Jumper Wires MM | 1 | ₹299 |
| Total | ₹965 |
Step-by-step guide
- Place the Nano and DHT11 on the breadboard. DHT11: VCC to 5V, GND to GND, DATA to pin D4.
- Connect the OLED over I2C: VCC to 5V, GND to GND, SDA to A4, SCL to A5.
- Install the “DHT sensor library” by Adafruit plus Adafruit_GFX and Adafruit_SSD1306 from the Library Manager (accept the dependency prompts).
- Upload the sketch below.
- Breathe gently on the sensor — humidity should jump within a couple of readings.
The code
The sketch polls the DHT11 every two seconds and refreshes the display. Failed readings (the DHT11 occasionally skips one) are simply retried.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>
Adafruit_SSD1306 display(128, 64, &Wire);
DHT dht(4, DHT11);
void setup(){ dht.begin(); display.begin(SSD1306_SWITCHCAPVCC, 0x3C); }
void loop(){
float t = dht.readTemperature(), h = dht.readHumidity();
if(isnan(t) || isnan(h)){ delay(500); return; }
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(2); display.setCursor(0,4);
display.print(t,1); display.print((char)247); display.print("C");
display.setCursor(0,36); display.print(h,0); display.print("% RH");
display.display();
delay(2000);
}Build this project
Add all 5 required components to your cart in one click — total ₹965.
Add all components to cart