Skip to content

tamascsiba/Weather_Station

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌦️ Solar Powered IoT Weather Station

Weather Station – Solar Panel

πŸ“Œ Project Overview

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.


🧱 Physical Construction & Hardware

β˜€οΈ Outdoor Installation

Outdoor Installation and Sensors

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)

πŸ“¦ Features

  • 🌑️ 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

🧰 Hardware Requirements

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

πŸ”‹ Power Supply & Electronics

Electronics Enclosure

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.


🌑️ Measured Parameters

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.


πŸ”Œ Pin Configuration

I2C (BME280 + Rainfall Sensor)

Function ESP32 GPIO
SDA GPIO 21
SCL GPIO 22

Analog Inputs

Sensor GPIO
Soil Moisture GPIO 32
Wind Speed GPIO 33
UV Sensor GPIO 34

SIM Module (UART2)

Function ESP32 GPIO
RX GPIO 16
TX GPIO 17

⏱️ System Operation

Every Second

  • Update internal clock
  • Read wind speed and store measurements

Every Minute

  • Read all sensors
  • Calculate maximum wind speed for the last minute
  • Generate a JSON object
  • Store data in an hourly buffer

Every Hour

  • 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

🧭 System Architecture

[Sensors]
↓
[ESP32]
↓ HTTP POST (JSON)
[ASP.NET Core Backend]
↓
[SQLite Database]
↓
[Web Dashboard]

Schematic

Schematic


πŸ–₯️ Web Dashboard

🏠 Main Dashboard

Main 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

πŸ“Š Temperature Chart Example

Temperature Chart

Each sensor has its own interactive daily chart:

  • Date selection
  • Smooth animations
  • Dark theme for readability

Charts are implemented using Chart.js.


πŸ“‹ All Weather Data Table

All Weather Data Table

All collected data can be viewed in a table with:

  • Pagination
  • Sorting
  • Full historical dataset
  • CSV export functionality

βš™οΈ Backend Implementation

🧩 Technologies Used

  • ASP.NET Core
  • Entity Framework Core
  • SQLite
  • REST API
  • JSON communication

πŸ“¦ WeatherData Model

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; }
}

🌐 API Endpoints

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 data

πŸ”Œ ESP32 Firmware

The 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
  }
]

🎨 User Interface

Dark theme

Bootstrap layout

Font Awesome icons

Fully responsive design

Optimized for desktop and mobile use


βœ… Key Features

Solar powered

Fully autonomous operation

Real sensor data

Persistent database storage

Interactive charts

CSV export

Modular backend architecture

Easily expandable system


πŸš€ Possible Future Improvements

Alerts and notifications

Cloud deployment

Multiple weather station support

MQTT communication

Weather prediction algorithms

About

Solar Powered IoT Weather Station

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors