Z-Weather is a lightweight project designed to collect weather data such as temperature π‘οΈ and humidity π§ using an ESP8266 module and a DHT22 sensor. The collected data is transmitted in real-time using the MQTT (Message Queuing Telemetry Transport) protocol, a lightweight and efficient protocol designed for machine-to-machine communication. This project leverages RabbitMQ as the MQTT broker, ensuring reliable and efficient message routing from the ESP8266 to the server, which processes and monitors the incoming data.
In addition to MQTT, Z-Weather includes features like a WiFi Manager for easy network configuration, mDNS (Multicast DNS) for local device access via z-weather.local
, and a Web UI for device control and monitoring. Settings are stored in EEPROM to ensure persistent configurations even after device reboot. This combination of features makes Z-Weather a powerful and easy-to-use weather monitoring tool, capable of providing real-time and reliable weather data, making it an excellent solution for both personal and professional weather tracking needs.
- Demo Website
- Key Features
- Libraries and Dependencies
- Components List
- Pinout
- How to Use
- Important Notes
- License
Z-Weather is more than just a weather data collector β it's an intuitive and interactive tool that brings the weather to your fingertips!
Curious about how it works? Here's a quick peek at the web interface:
- WiFi Configuration Manager: Easily configure WiFi credentials via a dedicated Web UI interface.
- mDNS Integration: Seamless device access using a local domain, e.g.,
z-weather.local
. - Persistent Settings Storage: MQTT configurations are saved to EEPROM, ensuring stability across reboots.
- Dynamic Web UI: Access to device monitoring, MQTT configuration, and resetting settings.
- Real-Time MQTT Support: Automatically sends weather data to an MQTT server for efficient integration.
The project utilizes the following libraries and their respective dependencies:
- ESP8266WiFi - Core library for ESP8266 WiFi functionality.
- WiFiManager - Simplifies WiFi network selection and credential storage.
- Dependency: ESP8266 core libraries.
- ESP8266WebServer - HTTP server for Web UI implementation.
- ESP8266mDNS - Enables mDNS for easy domain-based access.
- EEPROM - Used for storing MQTT configuration.
- PubSubClient - MQTT client library for connecting to MQTT brokers.
- DHT sensor library - Library for interacting with DHT22 temperature and humidity sensor.
- Dependency: Adafruit Unified Sensor Driver.
- ESP8266 - WiFi module to connect the device to a network and send data.
- DHT22 - Temperature and humidity sensor to measure weather data.
Hereβs the pinout for connecting the ESP8266 to the DHT22 sensor:
ESP8266 Pin | DHT22 Pin | Description |
---|---|---|
GND | GND | Ground connection |
3.3V | VCC | Power supply (3.3V) |
D4 (GPIO 2) | Data | Data pin for sensor readings |
- Connect the ESP8266 module to your computer.
- Install the ESP8266 board package in the Arduino IDE:
- Open File > Preferences and add
http://arduino.esp8266.com/stable/package_esp8266com_index.json
to the Additional Board Manager URLs. - Go to Tools > Board > Boards Manager, search for
ESP8266
, and click Install.
- Open File > Preferences and add
- Select the Generic ESP8266 Module board from the Tools > Board menu.
- Install the required libraries listed in the Libraries and Dependencies section.
- Open the project code in Arduino IDE and upload it to the ESP8266 module.
- Once uploaded, the device is ready to use.
- Power on the ESP8266 device running the Z-Weather firmware.
- The device will create a default WiFi network:
- SSID:
Z-Weather
- Password:
zweather
- SSID:
- Connect your device to the default
Z-Weather
WiFi network. - Open a browser and navigate to
192.168.4.1
to access the configuration page. - Select the desired WiFi network, enter the password if required, and save the settings.
- Upon successful connection, the default WiFi network will disappear, and the device will connect to the configured network.
- Ensure your device is on the same WiFi network as the ESP8266.
- Access the device using the domain:
z-weather.local
.
- Open the Web UI by navigating to
z-weather.local/config
. - Enter the MQTT server details, including server address, username, and password (if applicable).
- Save the configuration to start sending weather data to the MQTT server.
- Use the Web UI to monitor device status and sensor data by navigating to
z-weather.local/monitoring
. - Use the /reset page to reset configurations if necessary at
z-weather.local/reset
.
- The domain
z-weather.local
can only be accessed if your device supports mDNS and is connected to the same WiFi network as the ESP8266. - Ensure that your MQTT server is operational and ready to receive data from Z-Weather.
This project is licensed under the MIT License.
Enjoy using Z-Weather! π€οΈ If you have any questions or issues, donβt hesitate to contact us through this GitHub repository.