This project reads temperature, pressure, and altitude from a BMP180 sensor using an ESP32, and sends the data to InfluxDB via Wi-Fi. The data is then visualized in Grafana in real time.
- Sensor: BMP180
- Microcontroller: ESP32
- Database: InfluxDB 2.x
- Visualization: Grafana
- ESP32 connects to Wi-Fi.
- Reads sensor data (temperature, pressure, and altitude) from the BMP180.
- Formats the data using InfluxDB Line Protocol.
- Sends it via HTTP POST to your local InfluxDB instance.
- Grafana reads the data from InfluxDB and visualizes it in real time.
- ESP32
- SDA: GPIO 21
- SCL: GPIO 22
- BMP180 Sensor
- Connect to ESP32 I2C pins
- Make sure your ESP32 board is properly configured in Arduino IDE.
Install these libraries via the Arduino Library Manager:
WiFi.hHTTPClient.hWire.hAdafruit SensorAdafruit BMP085(for BMP180)
Make sure you have InfluxDB running and set up:
- Create a bucket:
weather-data - Create an organization:
dot - Generate an API Token with write access
- Replace the following placeholders in the sketch:
WIFI_NAMEWIFI_PASSWORDLAPTOP_IP(your computer’s IP running InfluxDB)iNFLUX_DB_TOKEN
- Connect Grafana to your InfluxDB 2.x instance.
- Create a dashboard using the
weather-databucket. - Use queries like:
from(bucket: "weather-data")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "weather")


