ESP32 microcontroller that feeds weather data via MQTT to a MQTT Broker
Install node libraries with:
npm install
Using dotenv library, we can store environment variables within a .env
file. Create a .env
file and add the necessary environment variables:
Environment Variable | Value |
---|---|
MQTT_SERVER | Address of the MQTT broker |
MQTT_PORT | Port of the MQTT broker |
MQTT_USERNAME | Username to use MQTT broker with |
MQTT_PASSWORD | Password for the username |
- ESP32 DEVKIT
- DHT22 Sensor (AM2302)
If you want to use the Arduino IDE to setup the ESP32 microcontroller, you will need to download the library here.
You will also need to download libraries using the Library Manager. Tools > Manage Libraries...
- DHT sensor library by Adafruit
- PubSubClient by Nick O'Leary
Edit the sketch for the ESP32 to the correct Network SSID and password. Make sure you point to the correct IP address for the MQTT broker.
The ESP32 module used for this sketch was the ESP32 TTGO T-Display. This module has an built-in 1.14" display. Installation and pinouts for this module can be found here.
- TFT_eSPI
- Please follow the instructions in this repo on installation.
- DHT sensor library by Adafruit
- Adafruit BMP280 library by Adafruit
- Complete real-time dashboard (Can only see data from past 5 minutes or so)
- Complete historical data viewer
- Add winston logging
- Add travisCI
- Integrate MongoDB to store data
- LED to display unsuccessful connection to MQTT Broker
- Hovering over circles show data value
- Circuit diagram of microcontroller and associated sensors/output