Project weather station on arduino. Includes backend (PHP), frontend (ReactJS) and code for the Aduino microcontroller
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 :)
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.
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.
The Arduino Weather Station project leverages a wide range of technologies across various layers of the system:
This project also includes custom-designed components for measuring airflow, voltage, and light, making use of 3D printing for hardware integration.
Follow these steps to install and run the Arduino Weather Station project on your local machine.
Make sure you have the following installed on your system:
git clone https://github.com/miksrv/arduino-weather-station.git
cd arduino-weather-station
Navigate to the server
folder:
cd backend
Install PHP dependencies using Composer:
composer install
Create a .env
file and configure your environment variables, such as database connection settings:
cp .env.example .env
Don’t forget to set the parameter app.arduino.token
= ‘’ in the .env file. This token will be used for proper authentication of the Arduino weather station when transmitting data to the server. The same token will need to be set in the Arduino sketch, which will be described in step 4.
Migrate the database:
php spark migrate
Start the backend server (built-in PHP server or any web server of your choice):
php spark serve
Navigate to the client
folder:
cd ../client
Install frontend dependencies:
npm install
Run the frontend in development mode:
npm run dev
To build the project for production:
npm run build
Optionally, start the production build:
npm start
arduino/main
folder in the Arduino IDE.main.ino
file for Arduino:API_SERVER
- the server address for sending data from the weather station.API_METHOD
- the correct method (if you haven’t changed anything in the server settings in this repository, you don’t need to change it).API_SECRET
- your secret for server authentication, the same secret key set in step 2 during server setup.PIN_ANEMOMETR
, PIN_DHT22
, PIN_UV_OUT
, PIN_UV_REF
/arduino
directory into the libraries
folder of your Arduino IDE.All models for 3D printing can be found in the models
directory.
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!
After successfully installing and setting up the Arduino Weather Station project, follow these steps to start using the application and monitor weather data.
http://localhost:3000
(or the production URL if deployed).arduino/
folder to adjust the calibration values for sensors such as temperature or pressure.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.
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.
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.
The Forecast section offers a comprehensive weather outlook for the next five days, accompanied by a detailed breakdown for the current day. Users can access forecasts for temperature, precipitation, wind speed, humidity, and more, presented in an intuitive interface. This section is designed to help users plan their activities with precision by providing accurate, easy-to-read weather data for both short-term and extended periods.
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.
Explore the fully functioning weather station web application at:
🌐 Live Demo
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:
git clone https://github.com/miksrv/arduino-weather-station.git
git checkout -b feature/AmazingFeature
git commit -m "Add AmazingFeature"
git push origin feature/AmazingFeature
We encourage contributions of all kinds, whether big or small. Your efforts help improve the project for everyone!
Distributed under the MIT License. See LICENSE for more information.
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!
Misha - miksoft.pro