This project is a IoT-Based-Weather-Monitoring-System designed to collect, process, and analyze weather data in real time. It integrates sensor data with geolocation information and uploads the data to an AWS RDS database and ThingSpeak for further processing and visualization. This platform is part of a larger system aimed at forecasting weather patterns and analyzing climate trends.
- Real-Time Data Collection: Collects temperature, humidity, and geolocation data from sensors.
- Database Integration: Stores collected data into an AWS RDS MySQL database for persistent storage and future analysis.
- ThingSpeak Integration: Uploads real-time weather data to ThingSpeak for visualization and monitoring.
- Geolocation Services: Utilizes Google Geolocation API to obtain accurate coordinates based on nearby Wi-Fi access points.
- Own GPS Sensor: This program does not require any GPS sensor. It uses geolocation and a custom header file, nearest_city.h, to replace the need for a GPS sensor.
- Modular Design: Easily extendable and adaptable to different hardware setups and data processing needs.
- ESP8266 or ESP32 Microcontroller
- DHT11 Temperature and Humidity Sensor
- Wi-Fi Access
- AWS RDS Instance (MySQL Database)
- Google Cloud Account for Geolocation API
- ThingSpeak Account
- Arduino IDE
- MySQL Connector for Arduino
- ArduinoJson Library
- ESP8266WiFi Library (or WiFi Library for ESP32)
- ESP8266HTTPClient Library (or HTTPClient Library for ESP32)
- Clone the Repository:
git clone https://github.com/karthikeyan1134/IoT-Based-Weather-Monitoring-System.git cd IoT-Based-Weather-Monitoring-System
- Configure the Project:
- Open the project in Arduino IDE.
- Replace the placeholders in the code with your actual credentials:
- Wi-Fi SSID and Password
- Google Geolocation API Key
- AWS RDS MySQL database endpoint, username, and password
- ThingSpeak API Key
- Upload the Code:
- Connect your ESP8266/ESP32 microcontroller to your computer.
- Select the correct board and port in Arduino IDE.
- Upload the code to the microcontroller.
- Run the System:
- Once the code is uploaded, the system will start collecting data from the DHT11 sensor.
- The geolocation data will be fetched using the Google Geolocation API.
- The collected data will be uploaded to the AWS RDS database and ThingSpeak for storage and visualization.
- geolocation.h: Handles the Wi-Fi connection and geolocation data fetching using Google Geolocation API.
- nearest_city.h This header file defines structures and functions for geographic computations, including finding the nearest city to a given location using the Haversine formula and CSV data.
- IN.csv This file includes over 6,56,678 places with their latitudes & longitudes accross all over indian (*Reference from GeoNames)
- main.c++: The main file that integrates all components, collects sensor data, and manages data uploads to the database and ThingSpeak.
- config.h: Contains configuration parameters like API keys, database credentials, etc. (Optional, depending on your setup).
- Table:
weather
device_id:
VARCHAR, ID of the device collecting datatemperature:
FLOAT, temperature readinghumidity:
FLOAT, humidity readinglatitude:
FLOAT, latitude of the data pointlongitude:
FLOAT, longitude of the data pointnearest_place:
VARCHAR, nearest place of the data pointtimestamp:
TIMESTAMP, the time the data was recorded
- Integration of additional sensors (e.g., wind speed, pressure).
- Implementation of predictive analytics and weather forecasting models.
- Development of a web-based dashboard for real-time monitoring and data visualization.
- Expansion of the system to support multiple devices and locations.