Skip to content

Arduino Weather Station is an automated weather monitoring project built on Arduino for collecting environmental data, featuring an API (PHP + MySQL + CodeIgniter) and a web interface (Next.js + Redux RTK) for real-time and historical weather data analysis. Please give the project a star :)

License

Notifications You must be signed in to change notification settings

miksrv/arduino-weather-station

Repository files navigation

Arduino Weather Station is an automated weather monitoring project built on Arduino for collecting environmental data, featuring an API (PHP + MySQL + CodeIgniter) and a web interface (Next.js + Redux RTK) for real-time and historical weather data analysis. Please give the project a star :)

Arduino Weather Station

Arduino Weather Station

Demo · Report Bug · Request Feature · Contact


Contributors Forks Stargazers Issues MIT License

UI Checks FTP Deploy Quality Gate Status Coverage


Table of Contents

About of Project

The Arduino Weather Station is an advanced, automated weather monitoring system designed to collect, process, and display real-time environmental data. The weather station is built using an Arduino microcontroller to handle sensor input and transmit data to a backend server. This data is then made available through an API built on PHP, MySQL, and CodeIgniter, with a frontend developed using Next.js and Redux RTK.

Arduino Weather Station

Key Features:

  • Real-time Data Collection: The weather station continuously monitors various atmospheric parameters using multiple sensors.
  • Historical Data Storage: Weather data is stored in a database, allowing users to view and analyze past conditions over selected periods.
  • Remote Access: A web-based interface allows users to access weather information from anywhere, displaying current readings and historical trends.
  • Data Visualization: Users can view live graphs of parameters such as temperature, humidity, pressure, and more, along with detailed statistics for selected time frames.
  • API Integration: The backend provides an API for developers to access weather data for integration into external applications.

Measured Parameters:

  • Temperature
  • Feels like temperature
  • Humidity
  • Dew point
  • UV intensity
  • Solar energy
  • Solar radiation
  • Wind speed and direction
  • Atmospheric pressure
  • Precipitation levels
  • Cloud cover

The system is highly customizable, and additional sensors can be integrated to expand its functionality. This project demonstrates how microcontrollers, web development, and real-time data processing can be combined to create a fully functional, real-world application.

(Back to top)

Built With

The Arduino Weather Station project leverages a wide range of technologies across various layers of the system:

  • C++ Programming language used for the Arduino firmware.
  • PHP Server-side scripting language for the backend API.
  • MySQL Database system for storing weather data.
  • JavaScript Core languages used in frontend development.
  • TypeScript TypeScript extends JavaScript by adding types to the language.
  • NextJS React-based frontend framework for building the user interface.
  • Redux State management for the frontend, providing predictable and centralized state.
  • NodeJS JavaScript runtime used for frontend development and package management.
  • Sass Styling the user interface.
  • GitHub Actions Continuous integration and deployment pipeline for automating tests and deployment processes.
  • SonarCloud Code quality and security analysis.

This project also includes custom-designed components for measuring airflow, voltage, and light, making use of 3D printing for hardware integration.

(Back to top)

Installation

Follow these steps to install and run the Arduino Weather Station project on your local machine.

Prerequisites

Make sure you have the following installed on your system:

  • Node.js (v20 or higher)
  • NPM or Yarn (for frontend dependencies)
  • PHP (v8.0 or higher)
  • Composer (for backend dependencies)
  • MySQL (or any compatible database)
  • Arduino IDE (for programming the Arduino microcontroller)

1. Clone the repository

git clone https://github.com/miksrv/arduino-weather-station.git
cd arduino-weather-station

2. Backend Setup (PHP + CodeIgniter)

  1. Navigate to the server folder:

    cd backend
  2. Install PHP dependencies using Composer:

    composer install
  3. Create a .env file and configure your environment variables, such as database connection settings:

    cp .env.example .env
  4. Migrate the database:

    php spark migrate
  5. Start the backend server (built-in PHP server or any web server of your choice):

    php spark serve

3. Frontend Setup (Next.js + Redux)

  1. Navigate to the client folder:

    cd ../client
  2. Install frontend dependencies:

    npm install
  3. Run the frontend in development mode:

    npm run dev
  4. To build the project for production:

    npm run build
  5. Optionally, start the production build:

    npm start

4. Arduino Setup

  1. Open Arduino Readme
  2. Open the Arduino sketch from the arduino -> main folder in the Arduino IDE.
  3. Connect your Arduino microcontroller and upload the sketch.
  4. Make sure the Arduino is correctly wired with the sensors.

Arduino Components:

  • BMP085: Barometric pressure sensor
  • BH1750: Light sensor
  • DHT22: Temperature and humidity sensor
  • PCF8574: I2C expander for wind direction
  • GUML8511: UV sensor
  • Anemometer: Measures wind speed
  • Wind Vane: Measures wind direction

All models for 3D printing can be found in the models directory.

Arduino Weather Station

5. Accessing the Application

Once the backend and frontend servers are running, access the weather station UI by visiting:

http://localhost:3000

You can now monitor real-time and historical weather data from the Arduino Weather Station!

(Back to top)

Usage

After successfully installing and setting up the Arduino Weather Station project, follow these steps to start using the application and monitor weather data.

1. Access the Web Interface

  • Open your browser and navigate to the frontend running at http://localhost:3000 (or the production URL if deployed).
  • You will see a dashboard displaying current weather conditions as well as the option to view historical data.

2. Real-Time Weather Data

  • The dashboard updates weather data in real-time, pulling data from the Arduino sensors connected to your weather station.
  • Key metrics displayed include:
    • Temperature
    • Humidity
    • Dew Point
    • UV Index
    • Wind Speed & Direction
    • Pressure
    • Precipitation
    • Solar Radiation

3. Historical Data

  • Navigate to the History or Statistics page from the main menu.
  • Choose a date range to view weather trends and archived data, including charts for various metrics like temperature, wind, and humidity.
![Weather Station User Interface - History Page](./client/public/images/history.jpg)

4. Customize Data Display

  • You can customize the data display to show or hide specific sensors on the dashboard.
  • For example, toggle between temperature readings, feels-like temperature, and dew point, or switch between solar energy and solar radiation.

5. Arduino Sensor Calibration

  • For accurate readings, you may need to calibrate some sensors depending on your specific environment. Refer to the Arduino sketch in the arduino/ folder to adjust the calibration values for sensors such as temperature or pressure.

6. Data Export

  • Weather data can be exported from the Statistics page in various formats (e.g., CSV) to analyze trends further.

7. System Maintenance

  • The backend server running on PHP + CodeIgniter is responsible for handling incoming data from the Arduino sensors and storing it in a MySQL database. Ensure the backend is running to avoid data loss.
  • The frontend is built with Next.js and provides a smooth interface to view, interact with, and analyze weather data.

8. Arduino Weather Station Features

  • Real-time Monitoring: Monitor real-time weather conditions using connected sensors.
  • Historical Data: Review weather history with customizable date ranges.
  • Graphical Visualizations: View weather trends and patterns using interactive charts.
  • Sensor Readings: Monitor multiple environmental factors, such as UV Index, wind speed, and solar radiation.

Screenshots and Demos

1. Current Weather Overview

The Current section provides real-time data on the current weather conditions, including temperature, humidity, UV index, and more. Users can quickly view all key environmental metrics at a glance.

Current Weather Interface

2. Sensors Dashboard

The Sensors section displays a list of all connected weather sensors, including temperature, pressure, wind speed, and solar radiation. This section gives users an in-depth view of each sensor's status and real-time readings.

Sensors Dashboard

3. Weather History and Trends

The History section allows users to explore weather data over a specified time period. Interactive charts provide insights into trends for various weather metrics like temperature, wind speed, and humidity.

History Interface

4. Heatmap

The Heatmap section provides a detailed visualization of weather metrics, including temperature, pressure, humidity, precipitation, and cloud coverage, displayed as a heatmap. Users can select any time period to view trends and patterns across multiple environmental factors at once. This powerful tool allows for quick comparison and in-depth analysis of weather conditions over time.

History Interface

Live Demo

Explore the fully functioning weather station web application at:
🌐 Live Demo

(Back to top)

Contributing

Contributions are what make the open-source community an incredible environment for learning, inspiration, and innovation. Your contributions are highly valued and greatly appreciated, whether it’s reporting bugs, suggesting improvements, or creating new features.

To contribute:

  1. Fork the project by clicking the "Fork" button at the top of this page.
  2. Clone your fork locally:
    git clone https://github.com/miksrv/arduino-weather-station.git
  3. Create a new feature branch:
    git checkout -b feature/AmazingFeature
  4. Make your changes, then commit them:
    git commit -m "Add AmazingFeature"
  5. Push your changes to your forked repository:
    git push origin feature/AmazingFeature
  6. Open a pull request from your feature branch to the main repository.

We encourage contributions of all kinds, whether big or small. Your efforts help improve the project for everyone!

License

Distributed under the MIT License. See LICENSE for more information.

(Back to top)

Acknowledgments

This section is dedicated to recognizing the resources and individuals that have been invaluable to this project. I’d like to highlight a few key tools and contributions that made a significant impact on its development. Feel free to explore them as they may be useful for your own projects!

  1. CodeIgniter
  2. Simple React UI
  3. Weather Icons
  4. Meteocons

(Back to top)

Contact

Misha - miksoft.pro

(Back to top)

About

Arduino Weather Station is an automated weather monitoring project built on Arduino for collecting environmental data, featuring an API (PHP + MySQL + CodeIgniter) and a web interface (Next.js + Redux RTK) for real-time and historical weather data analysis. Please give the project a star :)

Topics

Resources

License

Security policy

Stars

Watchers

Forks