What is the BME680 Sensor?
The BME680 is a gas sensor that combines high-accuracy pressure, humidity, and temperature sensors. It is invented by BOSCH, particularly designed for wearables and mobile applications where small size and low battery consumption are essential criteria. Depending on the particular working mode, the BME680 ensures optimum consumption, long-term stability, and strong EMC resilience. A wide variety of gases, such as volatile organic compounds, can be detected by the gas sensor built into the BME680 to assess air quality for personal well-being.
It has a tiny MOx (metal-oxide) sensor in it. It can be used to monitor air quality and identify gases and alcohols including ethanol, alcohol, and carbon monoxide because the heated metal oxide changes resistance based on VOCs in the air. So the BME680 can function as a completely independent environmental sensor.
Features:
- A sensor can sense pressure, humidity, and VOC gases.
- Additionally, it is capable of measuring temperature with a 1.0-degree celsius accuracy, barometric pressure with an absolute accuracy of 1% hPa, and humidity with a 3% accuracy.
- To detect gases and alcohols like ethanol and carbon monoxide and assess the quality of the air, heated metal oxide changes resistance dependent on the volatile organic compounds (VOC) in the air.
BME680 Operation Range
- Operating range of Temperature: -40~+85℃
- Operating range of Humidity: 0-100% r.H.
- Operating range of Pressure: 300-1100hPa
How Accurate is BME680
The BME680 sensor can sense pressure, humidity, and VOC gases. Additionally, it is capable of measuring temperature with a 1.0-degree celsius accuracy, barometric pressure with an absolute accuracy of 1% hPa, and humidity with a 3% accuracy. To detect gases and alcohols like ethanol and carbon monoxide and assess the quality of the air, heated metal oxide changes resistance dependent on the volatile organic compounds (VOC) in the air.
The gas sensor provides you with a qualitative understanding of the presence of VOC gases in the air. As a result, you may compare your data, identify patterns, and determine whether the air quality is improving or declining. Must calibrate the sensor against reliable sources and create a calibration curve to obtain accurate readings.
BME680 Pinout
Pin |
Purpose |
VCC |
Powers the sensor |
GND |
Common GND |
SCL |
SCL pin for I2C communication SCK pin for SPI communication |
SDA |
SDA pin for I2C communication (MOSI) pin for SPI communication |
SDO |
SDO (MISO) pin for SPI communication |
CS |
Chip select pin for SPI communication |
How to use the BME680 Sensor?
Any microcontroller can be interfaced with the BME680 using SPI or I2C protocols to sense and transmit sensor data. Here's a brief guide to working with Arduino.
Connection for SPI protocol:
#define SCK pin_no;
#define MISO pin_no;
#define MOSI pin_no;
#define CS pin_no;
Above commands for SPI data communications but I2C default connection with A4 and A5(A4 - SDA, A5 - SCL).
Circuit Diagram
Here I am going to connect with the I2C protocol. You can follow the SPI protocol as well by initializing mentioned above pin description.
To use the library first, download and install the BME680 into the Arduino IDE. After installation, include the library to sketch the code, also follow this way to get code from the library by clicking Files> Examples> BME680>DemoI2C or you can also copy the below code to your IDE.
Code
#include "Zanshin_BME680.h"
BME680_Class BME680;
float altitude(const int32_t prs, const float seadepth = 1013.25);
float altitude(const int32_t prs, const float seadepth) {
static float Altitude;
Altitude =
44330.0 * (1.0 - pow(((float)prs / 100.0) / seadepth, 0.1903));
return (Altitude);
}
void setup() {
Serial.begin(9600);
#ifdef __AVR_ATmega32U4__
delay(3000);
#endif
Serial.print(F("Starting I2CDemo example program for BME680\n"));
Serial.print(F("- Initializing BME680 sensor\n"));
while (!BME680.begin(I2C_STANDARD_MODE)) {
Serial.print(F("- Unable to find BME680. Trying again in 5 seconds.\n"));
delay(5000);
}
Serial.print(F("- setting 16x\n"));
BME680.setOversampling(TemperatureSensor, Oversample16);
BME680.setOversampling(HumiditySensor, Oversample16);
BME680.setOversampling(PressureSensor, Oversample16);
Serial.print(F("- with four sample setting filters\n"));
BME680.setIIRFilter(IIR4);
Serial.print(F("- Setting gas measurement to 320\xC2\xB0\x43 for 150ms\n")); // "�C" symbols
BME680.setGas(320, 150);
}
void loop() {
static int32_t temp, humidity, pressure, gas;
static char buf[16];
static float alt;
static uint16_t loopCounter = 0;
if (loopCounter % 25 == 0) {
Serial.print(F("\nLoop Temp\xC2\xB0\x43 Humid% Press hPa Alt m Air m"));
Serial.print(F("\xE2\x84\xA6\n==== ====== ====== ========= ======= ======\n"));
}
BME680.getSensorData(temp, humidity, pressure, gas);
if (loopCounter++ != 0) {
sprintf(buf, "%4d %3d.%02d", (loopCounter - 1) % 9999,
(int8_t)(temp / 100), (uint8_t)(temp % 100));
Serial.print(buf);
sprintf(buf, "%3d.%03d", (int8_t)(humidity / 1000),
(uint16_t)(humidity % 1000));
Serial.print(buf);
sprintf(buf, "%7d.%02d", (int16_t)(pressure / 100),
(uint8_t)(pressure % 100));
Serial.print(buf);
alti_tude = altitude(pressure);
sprintf(buf, "%5d.%02d", (int16_t)(alti_tude), ((uint8_t)(alti_tude * 100) % 100));
Serial.print(buf);
sprintf(buf, "%4d.%02d\n", (int16_t)(gas / 100), (uint8_t)(gas % 100));
Serial.print(buf);
delay(10000);
}
}
Conclusion
In this blog post, we have learned that The advent of the BME680 Sensor has upended the landscape of environmental sensing with its unparalleled abilities to measure temperature, humidity, pressure, and air quality with an unparalleled level of precision. The BME680 operates within an expansive range and offers readings of an accuracy that's unmatched, rendering it a revolutionary tool for an array of applications. So, why linger in ignorance? Unleash the full potential of the BME680 and embark on an exploratory journey today!
If you appreciate our work don't forget to share this post and leave your opinion in the comment box.
Please do check out other blog posts about Popular electronics
Make sure you check out our wide range of products and collections (we offer some exciting deals!)