This project involves building a weather station using an Arduino MCU connected to an ESP8266 module for Wi-Fi capabilities. The weather station gathers environmental data such as temperature, humidity, and atmospheric pressure from various sensors. The collected data is published as MQTT topics and stored in InfluxDB, a time-series database. Finally, the measurements are visualized using Grafana dashboards. The entire stack is containerized using Docker Compose for a streamlined deployment process.
- Real-time Data Collection: Collects data from multiple sensors (e.g. temperature, humidity, pressure).
- Wireless Connectivity: Utilizes an ESP8266 module to enable Wi-Fi connectivity.
- MQTT Protocol: Sends data as topics to an MQTT broker for reliable communication.
- Time-Series Data Storage: Uses InfluxDB to store the sensor readings with timestamped precision.
- Data Visualization: Visualizes data using Grafana dashboards.
- Dockerized Services: All services (MQTT broker, Telegraf, InfluxDB, and Grafana) are containerized with Docker and managed using Docker Compose for easy deployment.
- Arduino MCU (e.g., Arduino Uno, Nano)
- ESP8266 Wi-Fi module
- Environmental sensors (e.g. DHT22 for temperature and humidity, BMP280 for pressure, MQ-7 for gas)
- Jumper wires and breadboard
- Power supply or battery pack
- Arduino IDE (for programming the MCU)
- Docker and Docker Compose (for deploying services)
- MQTT library for Arduino (e.g., PubSubClient)
- Arduino MCU collects data from sensors and sends it to ESP8266.
- ESP8266 acts as the Wi-Fi interface, publishing data to an MQTT broker.
- MQTT Broker receives data and forwards it to Subscribers.
- Telegraf subscribes to MQTT Topics, proccesses, transforms and forwards data to InfluxDB.
- InfluxDB stores the time-series data.
- Grafana connects to InfluxDB and visualizes the data.
-
Clone the repository:
git clone https://github.com/Vasilis-Thomas/IoT-Weather-Station.git cd IoT-Weather-Station -
MCUs Software Configuration:
- Open
esp8266Sketch.inoin the Arduino IDE available in the./Arduino/sketches/esp8266Sketchdirectory. - Install the necessary libraries (e.g. PubSubClient, sensor libraries).
- Modify the Wi-Fi credentials and MQTT broker address in the code.
- Flash the ESP8266 with the firmware code.
- Flash the Arduino with the firmware code available in the
./Arduino/sketches/arduinoSketchdirectory.
- Open
-
MCUs Hardware Configuration:
-
Start the Docker services:
- Adjust the environment variables defined in
./Docker/.envthat are used to setup and deploy the stack.
cd Docker docker-compose up -d - Adjust the environment variables defined in
-
InfluxDB Configuration:
- Access InfluxDB at
http://localhost:8086.
- Access InfluxDB at
-
Grafana Configuration:
- Access Grafana at
http://localhost:3000(default credentials: admin/admin).
- Access Grafana at
The following topics are used for MQTT communication:
arduino/humidity/dht22arduino/temprerature/dht22arduino/temprerature/bmp280arduino/pressure/bmp280arduino/altitude/bmp280arduino/carbon_monoxide/mq7arduino/light_intensity/ld
Each topic corresponds to a specific sensor measurement.
- Once all the services are up and running, your IoT Weather Station should begin sending data to the MQTT broker.
- Use the Grafana dashboard to monitor real-time data and visualize historical trends.
👤 Θωμάς Βασίλειος
- GitHub: @Vasilis-Thomas
👤 Σαρακενίδης Νικόλαος
- GitHub: @Nikoreve



