Smart Weather Station + Auto Ventilation System using Arduino (Wokwi Simulation)

 

Smart Weather Station + Auto Ventilation System using Arduino (Wokwi Simulation)


The Smart Weather Station with Auto Ventilation System is an innovative Arduino project designed to monitor environmental conditions and automatically control ventilation based on real-time data. This project is built and simulated using the powerful online simulator Wokwi, making it easy for students, beginners, and electronics enthusiasts to design and test their circuits without physical hardware.

This system continuously measures temperature and humidity using sensors and automatically activates a ventilation fan or servo-controlled vent when the environment becomes too hot or humid. The result is a smart environmental monitoring system that improves air circulation and maintains comfortable indoor conditions.


How the Smart Weather Station Works

The weather station uses an Arduino microcontroller connected to environmental sensors to collect atmospheric data. The system processes the sensor readings and displays the values on an LCD or serial monitor.

When the temperature or humidity crosses a predefined threshold, the Arduino automatically triggers a ventilation mechanism such as:

  • A cooling fan

  • A servo motor opening a vent

  • An exhaust system

This automation makes the project ideal for smart homes, greenhouses, classrooms, and IoT-based environmental monitoring systems.


Key Features

✔ Real-time temperature and humidity monitoring
✔ Automatic ventilation control
✔ Simulation using Wokwi (no hardware required)
✔ LCD display for live weather data
✔ Energy-efficient automation
✔ Beginner-friendly Arduino project


Components Used in the Project

Diagram.json:
{
  "version": 1,
  "author": "Smart Weather Station",
  "editor": "wokwi",
  "parts": [
    { "type": "wokwi-arduino-uno", "id": "uno", "top": 200, "left": 180, "attrs": {} },
    {
      "type": "wokwi-dht22",
      "id": "dht1",
      "top": 0,
      "left": 0,
      "attrs": { "temperature": "-34.9" }
    },
    {
      "type": "wokwi-lcd1602",
      "id": "lcd1",
      "top": -147.2,
      "left": 389.6,
      "attrs": { "pins": "i2c" }
    },
    { "type": "wokwi-servo", "id": "sv1", "top": 0, "left": 450, "attrs": { "horn": "cross" } },
    { "type": "wokwi-led", "id": "ledG", "top": 420, "left": 80, "attrs": { "color": "green" } },
    { "type": "wokwi-led", "id": "ledY", "top": 420, "left": 130, "attrs": { "color": "yellow" } },
    { "type": "wokwi-led", "id": "ledR", "top": 420, "left": 180, "attrs": { "color": "red" } },
    { "type": "wokwi-resistor", "id": "rG", "top": 460, "left": 80, "attrs": { "value": "220" } },
    { "type": "wokwi-resistor", "id": "rY", "top": 460, "left": 130, "attrs": { "value": "220" } },
    { "type": "wokwi-resistor", "id": "rR", "top": 460, "left": 180, "attrs": { "value": "220" } },
    { "type": "wokwi-buzzer", "id": "bz1", "top": 420, "left": 280, "attrs": {} },
    {
      "type": "wokwi-pushbutton",
      "id": "btn1",
      "top": 420,
      "left": 370,
      "attrs": { "color": "blue" }
    }
  ],
  "connections": [
    [ "dht1:VCC", "uno:3.3V", "red", [] ],
    [ "dht1:SDA", "uno:7", "green", [] ],
    [ "dht1:GND", "uno:GND.1", "black", [] ],
    [ "lcd1:VCC", "uno:5V", "red", [] ],
    [ "lcd1:GND", "uno:GND.2", "black", [] ],
    [ "lcd1:SDA", "uno:A4", "blue", [] ],
    [ "lcd1:SCL", "uno:A5", "yellow", [] ],
    [ "sv1:PWM", "uno:9", "orange", [] ],
    [ "sv1:V+", "uno:5V", "red", [] ],
    [ "sv1:GND", "uno:GND.3", "black", [] ],
    [ "ledG:A", "rG:1", "green", [] ],
    [ "rG:2", "uno:2", "green", [] ],
    [ "ledG:C", "uno:GND.4", "black", [] ],
    [ "ledY:A", "rY:1", "yellow", [] ],
    [ "rY:2", "uno:3", "yellow", [] ],
    [ "ledY:C", "uno:GND.5", "black", [] ],
    [ "ledR:A", "rR:1", "red", [] ],
    [ "rR:2", "uno:4", "red", [] ],
    [ "ledR:C", "uno:GND.6", "black", [] ],
    [ "bz1:1", "uno:5", "purple", [] ],
    [ "bz1:2", "uno:GND.7", "black", [] ],
    [ "btn1:1.l", "uno:6", "blue", [] ],
    [ "btn1:2.l", "uno:GND.8", "black", [] ]
  ],
  "dependencies": {}
}

The Smart Weather Station can be built using the following components:

  • Arduino Uno

  • DHT11 or DHT22 Temperature & Humidity Sensor

  • Servo Motor / DC Fan

  • LCD Display (16x2)

  • Breadboard

  • Jumper Wires

  • Power Supply

All these components can be easily simulated in Wokwi, making the project perfect for learning Arduino programming and IoT concepts.


Applications of Smart Weather Station

This project demonstrates practical real-world applications including:

  • Smart greenhouse monitoring

  • Automatic room ventilation systems

  • Climate control for smart homes

  • Environmental monitoring in laboratories

  • STEM and robotics education projects

Code:
// ============================================================
//  SMART WEATHER STATION + AUTO VENTILATION
//  Arduino UNO | Wokwi Simulation
//
//  Parts (all verified from Wokwi docs):
//    wokwi-dht22          → temp + humidity sensor
//    wokwi-lcd1602 (i2c)  → 16x2 display
//    wokwi-servo          → auto vent flap (opens when hot)
//    wokwi-led (x3)       → status LEDs: green/yellow/red
//    wokwi-buzzer         → alarm when temp critical
//    wokwi-pushbutton     → cycle display screens
//
//  Libraries: DHT sensor library, LiquidCrystal I2C, Servo
// ============================================================

#include <DHT.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

// ── Pin definitions ──────────────────────────────────────
#define DHT_PIN     7
#define DHT_TYPE    DHT22
#define SERVO_PIN   9
#define LED_GREEN   2
#define LED_YELLOW  3
#define LED_RED     4
#define BUZZER_PIN  5
#define BTN_PIN     6

// ── Objects ───────────────────────────────────────────────
DHT           dht(DHT_PIN, DHT_TYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
Servo         ventServo;

// ── State ─────────────────────────────────────────────────
float tempC     = 0;
float humidity  = 0;
float heatIndex = 0;
int   ventAngle = 0;       // 0 = closed, 90 = half, 170 = fully open
int   screen    = 0;       // 0=temp/hum, 1=heat index, 2=vent status
bool  alarmOn   = false;

unsigned long lastRead   = 0;
unsigned long lastBlink  = 0;
unsigned long lastBuzz   = 0;
bool          blinkState = false;

bool prevBtn = HIGH;
unsigned long dbBtn = 0;

// ── Custom LCD characters ─────────────────────────────────
// Thermometer icon
uint8_t thermChar[8] = {
  0b00100, 0b01010, 0b01010, 0b01110,
  0b01110, 0b11111, 0b11111, 0b01110
};
// Droplet icon
uint8_t dropChar[8] = {
  0b00100, 0b00100, 0b01010, 0b01010,
  0b10001, 0b10001, 0b10001, 0b01110
};
// Fan icon
uint8_t fanChar[8] = {
  0b00000, 0b01110, 0b11011, 0b00100,
  0b11011, 0b01110, 0b00000, 0b00000
};
// Up arrow
uint8_t upArrow[8] = {
  0b00100, 0b01110, 0b11111, 0b00100,
  0b00100, 0b00100, 0b00100, 0b00000
};

// ── Helpers ───────────────────────────────────────────────
// Compute heat index (simplified Steadman)
float computeHeatIndex(float t, float h) {
  return -8.78469 + 1.61139*t + 2.33855*h
         - 0.14612*t*h - 0.01230*t*t
         - 0.01642*h*h + 0.00221*t*t*h
         + 0.00072*t*h*h - 0.00000358*t*t*h*h;
}

// Map temperature to vent angle
int tempToVent(float t) {
  if (t < 25.0) return 0;          // cool  → closed
  if (t < 30.0) return map((int)(t*10), 250, 300, 0,  60);  // warm → partial
  if (t < 38.0) return map((int)(t*10), 300, 380, 60, 160);  // hot  → wide
  return 170;                       // critical → fully open
}

// Draw a bar on LCD row using filled/empty blocks
void drawBar(int col, int row, int percent, int width) {
  int filled = (percent * width) / 100;
  lcd.setCursor(col, row);
  for (int i = 0; i < width; i++) {
    lcd.write(i < filled ? (uint8_t)255 : (uint8_t)'-');
  }
}

// ── Screens ───────────────────────────────────────────────
void showScreenTemp() {
  // Row 0: therm icon + temperature
  lcd.setCursor(0, 0);
  lcd.write((uint8_t)0);           // thermometer
  lcd.print(" Temp: ");
  if (tempC < 10) lcd.print(" ");
  lcd.print(tempC, 1);
  lcd.print("\xDF""C ");

  // Row 1: drop icon + humidity bar
  lcd.setCursor(0, 1);
  lcd.write((uint8_t)1);           // droplet
  lcd.print(" Hum:");
  lcd.print((int)humidity);
  lcd.print("% ");
  drawBar(11, 1, (int)humidity, 5);
}

void showScreenHeatIdx() {
  lcd.setCursor(0, 0);
  lcd.print("Heat Index:     ");
  lcd.setCursor(0, 1);
  if (heatIndex < 27)      lcd.print("Comfort  ");
  else if (heatIndex < 32) lcd.print("Caution  ");
  else if (heatIndex < 41) lcd.print("Warning! ");
  else                     lcd.print("DANGER!! ");
  lcd.print(heatIndex, 1);
  lcd.print("\xDF""C");
}

void showScreenVent() {
  lcd.setCursor(0, 0);
  lcd.write((uint8_t)2);           // fan icon
  lcd.print(" Vent: ");
  int pct = map(ventAngle, 0, 170, 0, 100);
  lcd.print(pct);
  lcd.print("%   ");

  lcd.setCursor(0, 1);
  lcd.print("[");
  drawBar(1, 1, pct, 12);
  lcd.setCursor(13, 1);
  lcd.print("]  ");
}

// ── Setup ─────────────────────────────────────────────────
void setup() {
  dht.begin();

  lcd.init();
  lcd.backlight();
  lcd.createChar(0, thermChar);
  lcd.createChar(1, dropChar);
  lcd.createChar(2, fanChar);
  lcd.createChar(3, upArrow);

  ventServo.attach(SERVO_PIN);
  ventServo.write(0);

  pinMode(LED_GREEN,  OUTPUT);
  pinMode(LED_YELLOW, OUTPUT);
  pinMode(LED_RED,    OUTPUT);
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(BTN_PIN,    INPUT_PULLUP);

  // Splash screen
  lcd.setCursor(2, 0);
  lcd.print("WeatherStation");
  lcd.setCursor(3, 1);
  lcd.print("Auto Vent v1");
  delay(1800);
  lcd.clear();

  // Boot LED test
  digitalWrite(LED_GREEN,  HIGH); delay(200);
  digitalWrite(LED_YELLOW, HIGH); delay(200);
  digitalWrite(LED_RED,    HIGH); delay(200);
  digitalWrite(LED_GREEN,  LOW);
  digitalWrite(LED_YELLOW, LOW);
  digitalWrite(LED_RED,    LOW);

  lastRead = millis();
}

// ── Loop ──────────────────────────────────────────────────
void loop() {
  unsigned long now = millis();

  // ---- Read sensor every 2 s ----
  if (now - lastRead >= 2000) {
    lastRead = now;
    float t = dht.readTemperature();
    float h = dht.readHumidity();
    if (!isnan(t) && !isnan(h)) {
      tempC    = t;
      humidity = h;
      heatIndex = computeHeatIndex(t, h);
    }

    // ---- Update vent servo ----
    int targetAngle = tempToVent(tempC);
    // Smooth movement: step 5° per cycle toward target
    if (ventAngle < targetAngle) ventAngle = min(ventAngle + 5, targetAngle);
    else if (ventAngle > targetAngle) ventAngle = max(ventAngle - 5, targetAngle);
    ventServo.write(ventAngle);

    // ---- Update LEDs ----
    if (tempC < 28) {
      digitalWrite(LED_GREEN,  HIGH);
      digitalWrite(LED_YELLOW, LOW);
      digitalWrite(LED_RED,    LOW);
      alarmOn = false;
    } else if (tempC < 35) {
      digitalWrite(LED_GREEN,  LOW);
      digitalWrite(LED_YELLOW, HIGH);
      digitalWrite(LED_RED,    LOW);
      alarmOn = false;
    } else {
      digitalWrite(LED_GREEN,  LOW);
      digitalWrite(LED_YELLOW, LOW);
      alarmOn = true;
    }

    // ---- Refresh LCD screen ----
    lcd.clear();
    switch (screen) {
      case 0: showScreenTemp();    break;
      case 1: showScreenHeatIdx(); break;
      case 2: showScreenVent();    break;
    }
  }

  // ---- Red LED blink + buzzer when alarm ----
  if (alarmOn && now - lastBlink >= 300) {
    lastBlink = now;
    blinkState = !blinkState;
    digitalWrite(LED_RED, blinkState ? HIGH : LOW);
  }
  if (alarmOn && now - lastBuzz >= 800) {
    lastBuzz = now;
    tone(BUZZER_PIN, 1200, 120);
  }

  // ---- Button: cycle screens ----
  bool btn = digitalRead(BTN_PIN);
  if (prevBtn == HIGH && btn == LOW && now - dbBtn > 200) {
    screen = (screen + 1) % 3;
    dbBtn = now;
    lcd.clear();
    switch (screen) {
      case 0: showScreenTemp();    break;
      case 1: showScreenHeatIdx(); break;
      case 2: showScreenVent();    break;
    }
  }
  prevBtn = btn;

  delay(20);
}



Why Use Wokwi for This Project?

The Wokwi Arduino simulator allows users to design and test electronics circuits directly in the browser. It eliminates the need for physical components while still providing a realistic simulation of Arduino hardware.

Benefits include:

  • Instant circuit testing

  • Easy debugging of Arduino code

  • Free online simulation

  • Ideal for students and beginners




Conclusion

The Smart Weather Station with Auto Ventilation System is a practical and visually impressive Arduino project that combines environmental sensing, automation, and IoT concepts. By using the Wokwi simulator, learners can experiment with smart automation systems without requiring expensive hardware.

This project is perfect for electronics students, robotics enthusiasts, and anyone interested in building smart environmental monitoring systems using Arduino.

🔵 1. Arduino Basics & Learning

1.Basics Electronics
2.Login Steps (Tinkercad)
3.Electronic Components
4.Arduino UNO Introduction
5.Different Types of Electronic Components
6.7 Segment Display

🟢 2. Beginner Arduino Projects

7.Soil Moisture Based Watering System

8.Servo Control Using Potentiometer

9.Traffic Light Using 7 Segment Display

10.Ultrasonic Distance Measurement

11.PIR Based Theft Alert System

12.Temperature Controlled Fan

13.LDR Controlled Street Light

14.LCD Interface with Arduino UNO

15.Kids Piano Using Arduino

16.LPG Gas Leakage Detection

17.Automatic Door Locking System

18.Joystick Interface with Arduino UNO

19.Robo Arm & Leg Control Using Servo

20.Automatic Parking System

21.Simple Clock Using Arduino UNO

22.Automatic Voting Machine Using Arduino UNO

23.Temperature Measurement Using Arduino

24.Home Automation Using Arduino UNO

25.PIR Based Security Alarm System

26.DC Motor Speed Control


🔴 3. Arduino Robotics Projects

27.RC Car Using L293D

28.Bluetooth RC Car

29.Smart Irrigation Using Arduino

30.Arduino UNO to LCD Display

31.Arduino Radar System

32.NeoPixel Ring Lighting

33.Bi-Directional People Counter

34.Automatic Plant Watering System

35.RGB Lamp Control

36.Obstacle Avoiding Robot

37.Line Follower Robot

38.Smart Gloves for Bedridden People


🟢 4. IoT & Smart System Projects

39.IoT Weather Monitoring System

40.ESP8266 Smart Health & Environment Monitoring

41.ESP32 Wi-Fi Weight Sensor (HX711)

42.Smart RFID Access Control System

43.Smart IoT Motor Control System

44.Smart Waste Management System

45.Raspberry Pi + GSM Ultrasonic Distance Monitor

46.Arduino UNO Smart Surveillance System

47.Arduino Environmental Monitoring with OLED

48.Smart Home Automation with Flame & IR Sensors

49.Arduino Nano Landslide Detection with GSM

50.Arduino Nano Rain-Sensing Stepper Motor

51.Automatic Tire Inflator

52.Automatic Cooker Using Servo & Sensors

53.Plastic Bottle Reverse Vending Machine

🚦 5. Smart Traffic & Smart City
54.RFID Based Smart Traffic Control
https://www.makemindz.com/2026/02/rfid-based-smart-traffic-control-system.html

55.Arduino Traffic Light Control
https://www.makemindz.com/2026/02/arduino-uno-traffic-light-control.html

56.Traffic Light with Joystick Interface
https://www.makemindz.com/2026/02/arduino-uno-controlled-traffic-light.html


🤖 6. Robotics Systems
57.Smart Obstacle Avoiding Robot

https://www.makemindz.com/2026/02/arduino-uno-smart-obstacle-avoiding.html

58.Autonomous Obstacle Avoidance Robot
https://www.makemindz.com/2026/02/arduino-powered-autonomous-obstacle.html

59.Bluetooth Controlled Line Follower Robot
https://www.makemindz.com/2026/02/arduino-nano-bluetooth-controlled-line.html

60.Bluetooth Controlled 4WD Robot
https://www.makemindz.com/2026/02/arduino-uno-bluetooth-controlled-4wd.html

61.Multi-Sensor Obstacle Avoidance Robot
https://www.makemindz.com/2026/02/arduino-uno-multi-sensor-obstacle.html

62.Raspberry Pi Motor Control Robot
https://www.makemindz.com/2026/02/raspberry-pi-motor-control-system-using.html

63.RC Car with L298N & Joystick
https://www.makemindz.com/2026/02/rc-car-simulation-with-l298n-motor.html

64.Raspberry Pi Robotic Arm with Camera
https://www.makemindz.com/2026/02/raspberry-pi-robotic-arm-control-system.html

65.ESP32 4WD Robot Car
https://www.makemindz.com/2026/02/esp32-based-4wd-robot-car-using-dual.html


📡 7. LoRa & Wireless Projects
66.Arduino LoRa Communication (RFM95W)

https://www.makemindz.com/2026/02/arduino-lora-communication-project.html

67.Arduino Nano LoRa SX1276
https://www.makemindz.com/2026/02/arduino-nano-with-rfm95-lora-sx1276.html

68.Arduino Nano Digital Clock DS3231
https://www.makemindz.com/2026/02/arduino-nano-digital-clock-using-ds3231.html


💡 8. LED & Display Projects
69.NeoPixel Ring Light Show

https://www.makemindz.com/2026/02/50-arduino-esp32-iot-projects-for.html

70.Wi-Fi Controlled NeoPixel Ring (ESP8266)
https://www.makemindz.com/2026/02/wi-fi-controlled-neopixel-ring-with.html

71.Chained NeoPixel Rings
https://www.makemindz.com/2026/02/chained-neopixel-rings-with-arduino.html

72.Lighting System with Gesture & Sound
https://www.makemindz.com/2026/02/arduino-nano-controlled-lighting-system.html

73.Raspberry Pi GPIO Multi-LED Control
https://www.makemindz.com/2026/02/raspberry-pi-gpio-multi-led-control.html

74.4 Channel Relay Module with Arduino UNO
https://www.makemindz.com/2026/02/4-channel-relay-module-using-arduino.html


🔍 9. Sensor & Detection Projects
75.Color Sensor + Proximity System

https://www.makemindz.com/2026/02/arduino-uno-based-color-sensor-and.html

76.Arduino Color Detection (TCS34725)
https://www.makemindz.com/2026/02/arduino-color-detection-project-using.html

77.Gas Leakage Detection (MQ-2)
https://www.makemindz.com/2026/02/arduino-gas-leakage-detection-and.html

78.MQ-135 Air Quality Monitor
https://www.makemindz.com/2026/02/mq-135-air-quality-detector-using.html

79.Pulse Sensor Monitoring System
https://www.makemindz.com/2026/02/pulse-sensor-using-arduino-complete.html

80.HX711 Load Sensor Demo
https://www.makemindz.com/2026/02/50-arduino-esp32-iot-projects-for.html

81.DS1307 RTC with 16x2 LCD
https://www.makemindz.com/2026/02/track-time-with-ds1307-rtc-and-display.html

82.Parking Sensor Simulator (HC-SR04)
https://www.makemindz.com/2026/02/parking-sensor-simulator-using-arduino.html


🎮 10. Fun & Interactive Projects
83.Pong Game with OLED Display

https://www.makemindz.com/2026/02/pong-game-with-arduino-uno-and-oled.html

84.Bluetooth Controlled Servo Motor
https://www.makemindz.com/2026/02/arduino-uno-bluetooth-controlled-servo.html

85.Touch and Distance Sensing System
https://www.makemindz.com/2026/02/arduino-uno-based-interactive-touch-and.html


🏭 11. Industrial & Automation Projects
86.Smart Waste Sorting System

https://www.makemindz.com/2026/02/arduino-uno-smart-waste-sorting-system.html

87.Smart Waste Segregation System
https://www.makemindz.com/2026/02/arduino-sketch-for-plastic-bottle-and.html

88.ESP32 Digital Weighing Scale
https://www.makemindz.com/2026/02/esp32-based-digital-weighing-scale.html


🚀 12. Advanced Projects
89.Smart Toll Gate Automation

https://www.makemindz.com/search?q=Arduino-Based+Smart+Toll+Gate+Automation+System

90.Automatic Pill Dispenser Machine
https://www.makemindz.com/search?q=Arduino-Based+Automatic+Pill+Dispenser+Machine

91.Smart Water Quality Monitoring
https://www.makemindz.com/search?q=Smart+Water+Quality+Monitoring+System

91.Ocean Cleaning Boat Robot
https://www.makemindz.com/search?q=Ocean+Cleaning+Boat+Robot

93.Accident Detection & Health Monitoring
https://www.makemindz.com/search?q=Accident+Detection+Health+Monitoring

94.Raspberry Pi RFID Smart Door Lock
https://www.makemindz.com/search?q=Raspberry+Pi+RFID+Keypad+Smart+Door+Lock

95.Smart Shopping Trolley with RFID
https://www.makemindz.com/search?q=Smart+Shopping+Trolley+Arduino+RFID

96.Automatic Hand Sanitizer Dispenser
https://www.makemindz.com/search?q=Automatic+Liquid+Hand+Sanitizer+Arduino

97.Robotic Weeding Machine
https://www.makemindz.com/search?q=Robotic+Weeding+Machine

98.Biometric Electronic Voting System
https://www.makemindz.com/search?q=Biometric+Electronic+Voting+System


99.Electronic Voting System with TFT Display
https://www.makemindz.com/search?q=Electronic+Voting+System+ILI9341+TFT

🟣 13. ESP32 Projects

100.ESP32 WiFi Scanner

https://www.makemindz.com/2026/02/esp32-wifi-scanner-using-wokwi-online.html

101.MQTT Weather Logger

102.ESP32 Gas Leak Detection System

103.OLED Display with ESP32

104.RGB LED Control with ESP32-S3 Sense


🟡 14. Arduino Wokwi Simulator Projects

105.Introduction to Wokwi Simulator

106.Kinetic Mandala Using Servo

107.Biometric Access System

108.ColorChord Musical Color Sequencer

109.32×32 LED Matrix with Arduino Mega

110.Password Based Lock System

111.Arduino RFID Access Control

112.Arduino Weather Station

113.Arduino Knight Rider LED Chaser

https://www.makemindz.com/2026/02/arduino-knight-rider-led-chaser-with.html

Comments