This project is a solar-powered IoT weather station built using an ESP32 microcontroller.
It collects real environmental data from multiple sensors, stores it in a database, and visualizes it through a modern web-based dashboard.
The system is a complete end-to-end IoT solution, covering hardware, firmware, backend, database, and frontend.
The weather station is installed outdoors and powered entirely by a solar panel, making it fully autonomous and independent from grid power.
Mounted components:
- Solar panel (50W)
- Wind speed sensor (anemometer) (dynamo)
- BME280 (temperature, humidity and pressure sensor in IP68 case)
- Soil moisture sensor
- GUVA-S12SD (UV sensor)
- DFRobot Rainfall Gauge (Gravity:SEN0575)
- π‘οΈ Temperature, Humidity, Pressure measurement (BME280)
- π§οΈ Rainfall measurement (DFRobot Rainfall Sensor)
- βοΈ UV Index measurement (GUVA-S12SD)
- π¨ Wind speed measurement (analog wind sensor)
- π± Soil moisture measurement
- π Real-Time Clock (RTC) via NTP (SIM module)
- π Sensor data collected every minute
- π‘ Hourly HTTP POST data upload
- π€ SIM module sleep mode for power saving
| Component | Description |
|---|---|
| ESP32 | Main microcontroller |
| BME280 | Temperature / Humidity / Pressure sensor |
| DFRobot Rainfall Sensor | Rain gauge |
| GUVA-S12SD | UV sensor |
| Analog wind sensor | Wind speed measurement |
| Soil moisture sensor | Analog soil sensor |
| SIM A7670E | Cellular communication module |
| GSM antenna | Required for network connectivity |
The internal electronics are placed in sealed enclosures and include:
- Solar charge controller
- 12V rechargeable battery
- ESP32 microcontroller
- Voltage regulation and wiring
The system is designed for continuous, long-term operation.
The weather station measures and stores the following data:
- Temperature (Β°C)
- Humidity (%)
- Air pressure (hPa)
- Rainfall (mm per hour)
- UV Index (0β11)
- Wind speed (km/h)
- Soil moisture (%)
All measurements are timestamped and permanently stored.
| Function | ESP32 GPIO |
|---|---|
| SDA | GPIO 21 |
| SCL | GPIO 22 |
| Sensor | GPIO |
|---|---|
| Soil Moisture | GPIO 32 |
| Wind Speed | GPIO 33 |
| UV Sensor | GPIO 34 |
| Function | ESP32 GPIO |
|---|---|
| RX | GPIO 16 |
| TX | GPIO 17 |
- Update internal clock
- Read wind speed and store measurements
- Read all sensors
- Calculate maximum wind speed for the last minute
- Generate a JSON object
- Store data in an hourly buffer
- Combine all minute-level JSON objects into a JSON array
- Send data to the server via HTTP POST
- Reset rainfall counter
- Re-sync time using NTP
- Put SIM module into sleep mode
[Sensors]
β
[ESP32]
β HTTP POST (JSON)
[ASP.NET Core Backend]
β
[SQLite Database]
β
[Web Dashboard]
The main dashboard shows the latest received weather data using a card-based layout:
- Large, readable values
- Clear icons
- Visual UV index indicator
- Navigation to detailed charts
Each sensor has its own interactive daily chart:
- Date selection
- Smooth animations
- Dark theme for readability
Charts are implemented using Chart.js.
All collected data can be viewed in a table with:
- Pagination
- Sorting
- Full historical dataset
- CSV export functionality
- ASP.NET Core
- Entity Framework Core
- SQLite
- REST API
- JSON communication
public class WeatherData
{
public int Id { get; set; }
public string Date { get; set; }
public string Time { get; set; }
public float Temperature { get; set; }
public float Humidity { get; set; }
public float Pressure { get; set; }
public float RainfallLastHour { get; set; }
public int uvIndex { get; set; }
public float WindSpeed { get; set; }
public int SoilMoisture { get; set; }
}Method Endpoint Description
POST /WeatherReport/ReceiveData Receives sensor data from ESP32
GET /WeatherReport/GetAllReceivedData Returns all stored data
GET /WeatherReport/GetTemperatureData Temperature data
GET /WeatherReport/GetHumidityData Humidity data
GET /WeatherReport/GetPressureData Pressure data
GET /WeatherReport/GetRainfallData Rainfall data
GET /WeatherReport/GetUVIntensityData UV index data
GET /WeatherReport/GetWindSpeedData Wind speed data
GET /WeatherReport/GetSoilMoistureData Soil moisture dataThe ESP32 firmware:
Reads all connected sensors
Packages measurements into a JSON array
Sends data to the backend using HTTP POST
Supports stable, long-term autonomous operation
Example payload:
[
{
"Date": "2025-01-07",
"Time": "13:00:00",
"Temperature": 5.41,
"Humidity": 80.33,
"Pressure": 997.06,
"RainfallLastHour": 0,
"uvIndex": 0,
"WindSpeed": 0,
"SoilMoisture": 45
}
]
Dark theme
Bootstrap layout
Font Awesome icons
Fully responsive design
Optimized for desktop and mobile use
Solar powered
Fully autonomous operation
Real sensor data
Persistent database storage
Interactive charts
CSV export
Modular backend architecture
Easily expandable system
Alerts and notifications
Cloud deployment
Multiple weather station support
MQTT communication
Weather prediction algorithms



