Skip to content

ESP32 module with BME280 sensor connected to the MQTT broker

Notifications You must be signed in to change notification settings

tpaphysics/esp32-bme280-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

made-for-VSCode Build with PlatformIO



💻 Project

layout

In this project we use an ESP32 microcontroller model devkit v1 together with a BME280 I2C sensor as shown in the image above. Thus, the ESP32 captures the temperature, pressure, humidity and altitude measurements through the BME280 sensor and sends them to an mqtt broker. The project was built using the platformio extension for VScode.

tree

The ESP32 can be connected to the wi-fi network, the device containing the mqtt broker can be on the web or on the local network.

🚀 Get Started

Open the integrated terminal by clicking on the PlatformIO: New Terminal icon and typing:

pio lib install

Now rename the env.example folder that is inside the include folder to env. Now edit the files:

env.wifi.h

// your wifi network credentials
const char *WIFI_SSID = "YOUR_SSID";
const char *WIFI_PASS = "YOUR_PASSWORD";

env.mqtt.h

const char *MQTT_SERVER = "YOUR_SERVER_DNS_OR_IP";
const int MQTT_PORT = 1883;
const char *MQTT_USER = "mosquitto";
const char *MQTT_PASS = "mosquitto";
const char *MQTT_TOPIC = "esp32/bme280";

Now upload the firmware to the ESP32 by clicking on the Platformio:Upload icon. Logically the ESP32 must be plugged into your computer's USB.

👨‍🚀 Author

👋 My contacts!

Linkedin Badge Gmail Badge

Releases

No releases published

Packages

No packages published