BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

BME680 Indoor AIR Quality Monitor

Hi guys. I want to share my BME680 Indoor AIR Quality monitoring project with yours.

How sensing solutions help to fight against the spread of COVID-19

Parts you need:

  • BME680 Module
  • ESP8266 Nodemcu or D1 Mini

Arduino Library’s you need:

https://github.com/adafruit/Adafruit_BME680

https://github.com/adafruit/Adafruit_Sensor

Wiring:

The Sketch: ( always I build my blynk sketch with local server )

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME680 bme;

BlynkTimer timer;

char auth[] = "1ba32e9c834340ed83a795c083c03c4a";
char ssid[] = "MikroTik Tesla";
char pass[] = "12345678";
char server[] = "10.5.51.5";

void setup()
{
  Blynk.begin(auth, ssid, pass, server, 8080);
  bme.begin();
  bme.setTemperatureOversampling(BME680_OS_8X);
  bme.setHumidityOversampling(BME680_OS_2X);
  bme.setPressureOversampling(BME680_OS_4X);
  bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
  bme.setGasHeater(320, 150); // 320*C for 150 ms
  timer.setInterval(2000L, bme680);
}

void bme680()
{
  float Temperature = (bme.temperature);
  Blynk.virtualWrite(V1, Temperature);

  float Humidity = (bme.humidity);
  Blynk.virtualWrite(V2, Humidity);

  float Pressure = (bme.pressure / 100.0);
  Blynk.virtualWrite(V3, Pressure);

  float Altitude = (bme.readAltitude(SEALEVELPRESSURE_HPA));
  Blynk.virtualWrite(V4, Altitude);

  float Gas = (bme.gas_resistance / 1000.0);
  Blynk.virtualWrite(V5, Gas);

  if ((Gas > 0)  && (Gas  <= 50)) {
    Blynk.virtualWrite(V6, "IAQ GOOD");
  }
  if ((Gas > 51)  && (Gas  <= 100)) {
    Blynk.virtualWrite(V6, "IAQ Average");
  }
  if ((Gas > 101)  && (Gas  <= 150)) {
    Blynk.virtualWrite(V6, "IAQ Little Bad");
  }
  if ((Gas > 151)  && (Gas  <= 200)) {
    Blynk.virtualWrite(V6, "IAQ Bad");
  }
  if ((Gas > 201)  && (Gas  <= 300)) {
    Blynk.virtualWrite(V6, "IAQ Worse");
  }
  if ((Gas > 301)  && (Gas  <= 500)) {
    Blynk.virtualWrite(V6, "IAQ Very Bad");
  }
}

void loop()
{
  Blynk.run();
  timer.run();
}

Screenshot:

Here the IAQ value table:

2 Likes

Woah you’re 1541 M above sea!

:grinning: