IoT Weather Station using ESP32 and FreeRTOS is a smart embedded project that gathers real-time environmental data such as temperature, humidity, and pressure and uploads it to the cloud for monitoring. By using the ESP32 microcontroller with FreeRTOS, this IoT weather monitoring system can efficiently manage multiple processes such as sensor data acquisition, display updates, and network communication simultaneously.
IoT Weather Station using ESP32 and FreeRTOS is designed to help you build an efficient weather monitoring system using BME280 and DHT sensors. This project explains how to upload real-time sensor readings to ThingSpeak and implement task management in FreeRTOS for better performance and reliability. It is one of the best ESP32 IoT projects for both beginners and professionals looking to learn IoT system development.
An IoT Weather Station monitors environmental parameters using sensors such as DHT11, DHT22, and BME280 with ESP32.
These sensors measure temperature, humidity, and pressure, then send data to a cloud service like ThingSpeak or Node-RED.
This compact setup makes it an ideal ESP32 weather station project, perfect for students and engineers learning IoT system design and cloud integration.
The ESP32 board reads data from environmental sensors and runs multiple FreeRTOS tasks to handle display updates, cloud uploads, and Wi-Fi management concurrently.
Each process runs independently using task management in FreeRTOS, improving reliability and responsiveness, which is essential for real-time IoT systems.
| Component | Description |
| ESP32 Board | Dual-core MCU with Wi-Fi and Bluetooth |
| DHT11/DHT22 | Measures temperature and humidity |
| BME280 Sensor | Measures humidity, pressure, and temperature |
| OLED Display (0.96”) | Displays current readings |
| Breadboard and Jumpers | For sensor connections |
| Power Supply/USB Cable | Provides power to the ESP32 |
Each block in the diagram represents a FreeRTOS task:
This modular design keeps each process isolated, improving stability.
Using FreeRTOS, you can assign different priority levels to each process:
This prioritization ensures consistent performance even under high CPU load.
| Task | Priority | Function |
| Sensor Task | Medium | Reads DHT or BME280 data every few seconds and pushes data to a queue |
| Display Task | Low | Updates the OLED with real-time readings |
| Wi-Fi Task | High | Maintains Wi-Fi connectivity and reconnection logic |
| Cloud Task | Medium | Publishes data to ThingSpeak using HTTP or MQTT |
Both protocols are practical for ESP32 weather station projects, depending on your application.
#include
#include
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
const char* ssid = "YourWiFi";
const char* password = "YourPassword";
String apiKey = "YOUR_API_KEY";
const char* server = "http://api.thingspeak.com/update";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
dht.begin();
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
float h = dht.readHumidity();
float t = dht.readTemperature();
String url = server + String("?api_key=") + apiKey + "&field1=" + t + "&field2=" + h;
http.begin(url);
http.GET();
http.end();
}
delay(20000);
}
uxTaskGetStackHighWaterMark() to monitor heap usage.vTaskList() and other FreeRTOS debugging tools.
The IoT Weather Station using FreeRTOS and ESP32 demonstrates real-time task management, efficient resource allocation, and cloud connectivity , all key aspects of modern IoT weather monitoring systems.
With sensors like DHT and BME280, and cloud platforms like ThingSpeak, this ESP32 IoT project serves as a complete learning experience for embedded developers and IoT enthusiasts looking to master real-time applications.
It is connecting a microcontroller to a GSM module to send/receive messages or data over mobile networks.
The SIM300 GSM module is widely used due to its tri-band support and compact size.
AT commands are instructions sent to the module to perform operations like sending SMS or making calls.
Enable ESP32 deep sleep mode for power-efficient applications.
Indian Institute of Embedded Systems – IIES