AirQuality
Monitor your AirQuality with an ESP8266 and a BME680. The BME680 sensor measures temperature, humitidy, air pressure, and gas concentration. The ESP8266 serves this sensor data as a website and keeps the data up-to-date over a websocket. The sensor data is also sent inside a UDP packet to a configured server in a given time interval. The current time is fetched using the Network Time Protocol (NTP) and is shown in UTC.
Requirements
Hardware
- ESP8266
- BME680
Software
- Arduino IDE or Arduino CLI
- Arduino library: WebSocket Server and Client
- Arduino library: ArduinoJson for MessagePack support
xxd
to create C-files from static data- Optional: screen to show serial output
Usage
- Connect the ESP8266 with the BME680 over I2C. You can set SDA and SCL pins in
AirQuality.ino
with the definesI2C_SDA
andI2C_CLK
. - Set your WIFI credentials in
wifi_credentials.h
. - Optional: Disable
UDP_ENABLE
if you do now want sensor data being sent over UDP (see AirQLogger below). - Flash the firmware to the ESP8266 using
make.sh
. - Enter the IP of your ESP8266 in your mobile or desktop browser.
AirQLogger
If UDP_ENABLE
in AirQuality.ino
is enabled, the sensor data is sent in a specified interval to a server.
The data is serialized using MessagePack and sent as a UDP packet.
The folder AirQLogger
contains a Python 3 example implementing a server that logs this data to a file.
This can be useful to record the BME8266 data over a longer time span for offline analysis.
Licenses
AirQuality.ino
,ESP8266NTP.[h/cpp]
,static/index.html
, andstatic/manifest.webmanifest
are licensed under the ISC license.bme680_defs.h
andbme680.[c/h]
from Bosch Sensortec GmbH include their license in their header.Adafruit_BME680.[h/cpp]
from Adafruit Industries are licensed under the BSD license.Adafruit_Sensor.h
from Adafruit Industries is licensed under the Apache license 2.0.