IoT Weather Station

Introduction

An IoT Weather Station is a system that measures environmental parameters such as temperature, humidity, and atmospheric pressure and sends the data to the cloud or a web application for real-time monitoring.

This project combines sensors, microcontrollers, and IoT platforms to create a smart weather monitoring solution. It is widely used in smart homes, agriculture, and environmental monitoring.


Objective of the Project

  • To measure temperature, humidity, and pressure using sensors.
  • To send real-time weather data to an IoT platform (like ThingSpeak or Blynk).
  • To implement wireless monitoring for convenience and efficiency.
  • To learn IoT integration with Arduino.

Working Principle

The IoT Weather Station works on sensor data collection and cloud communication:

How It Works

  1. Sensors measure environmental parameters:
    • DHT11/DHT22 for temperature and humidity
    • BMP180/BMP280 for atmospheric pressure
  2. Arduino reads sensor data via digital or I2C interface.
  3. Data is sent to the IoT platform using Wi-Fi (ESP8266 or ESP32).
  4. Users can view real-time weather data on a mobile app or web dashboard.

Components Required

  • Arduino Uno or ESP8266/ESP32
  • DHT11 or DHT22 Temperature & Humidity Sensor
  • BMP180/BMP280 Pressure Sensor (optional)
  • Jumper Wires
  • Breadboard / PCB
  • Wi-Fi Module (ESP8266 for Arduino Uno)
  • 5V Power Supply

Circuit Diagram

Connections (Using Arduino Uno + ESP8266 + DHT11)

DHT11 Sensor:
VCC -> 5V
GND -> GND
DATA -> D2 (Arduino digital input)

ESP8266 Wi-Fi Module:
VCC -> 3.3V
GND -> GND
TX  -> RX of Arduino (through voltage divider)
RX  -> TX of Arduino (through voltage divider)

Arduino:
5V & GND to sensors
D2 -> DHT11 data

Note: If using ESP32, it has built-in Wi-Fi, and you can connect sensors directly without ESP8266.


Arduino Code for IoT Weather Station (Using ThingSpeak)

#include <DHT.h>
#include <ESP8266WiFi.h>
#include <ThingSpeak.h>

#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

const char* ssid = "Your_WiFi_SSID";
const char* password = "Your_WiFi_Password";
WiFiClient client;
unsigned long myChannelNumber = 123456; // ThingSpeak channel ID
const char* myWriteAPIKey = "YOUR_API_KEY";

void setup() {
  Serial.begin(115200);
  dht.begin();
  WiFi.begin(ssid, password);
  
  Serial.print("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("Connected!");
  ThingSpeak.begin(client);
}

void loop() {
  float temp = dht.readTemperature(); // Celsius
  float hum = dht.readHumidity();
  
  if (isnan(temp) || isnan(hum)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  
  Serial.print("Temperature: ");
  Serial.print(temp);
  Serial.print(" °C, Humidity: ");
  Serial.print(hum);
  Serial.println(" %");
  
  // Send data to ThingSpeak
  ThingSpeak.setField(1, temp);
  ThingSpeak.setField(2, hum);
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
  
  delay(20000); // Update every 20 seconds
}

Code Explanation

  • DHT library reads temperature and humidity from the DHT11 sensor.
  • ESP8266 connects Arduino to Wi-Fi for Internet access.
  • Data is sent to ThingSpeak using ThingSpeak.writeFields().
  • Users can view live data on the ThingSpeak dashboard.

Advantages

  • Real-time weather monitoring
  • Wireless IoT integration
  • Low-cost and easy to implement
  • Can be expanded with multiple sensors (pressure, gas, rainfall)

Applications

  • Smart home weather stations
  • Agriculture monitoring
  • Environmental data collection
  • Educational IoT projects

Future Enhancements

  • Add more sensors (rain, UV, air quality)
  • Integrate with Blynk app for mobile alerts
  • Add automated irrigation control based on temperature & humidity
  • Use ESP32 for a compact, Wi-Fi-only solution

Conclusion

The IoT Weather Station is an advanced electronics project that combines sensors, Arduino/ESP8266, and IoT platforms to provide real-time environmental data. It is highly practical for smart homes, agriculture, and educational purposes.

Leave a Reply

Shopping cart

0
image/svg+xml

No products in the cart.

Continue Shopping