Como usar o sensor multiuso BME680 com Arduino

How to use the BME680 multipurpose sensor with Arduino

BME680 is a multifunctional digital sensor, developed by Bosch after years of research, which can measure temperature, humidity, gases and barometric pressure. Communication with this sensor is possible via the Serial Peripheral Interface (SPI) and I2C protocols.

The accuracy of temperature and barometric pressure is +-1 and humidity is +-3. Gases are measured as volatile organic compounds (VOCs) in the air. VOCs provide a single resistance value for the output. This means that we can predict that the gas is present in the air, but we cannot distinguish whether it is ethanol, carbon monoxide or alcohol, etc.

For this project, we will interface the BME680 sensor with Arduino . The main sensor is small and compact, and external resistors and capacitors are required for proper configuration. For example, both an I2C pull-up and a VOC resistor are required when a voltage divider is required. The BME680 sensor can work at 3.3 and 5V.

Circuit Diagram
The circuit diagram for this project is quite simple. We decided to interface the sensor with the Arduino Nano using the SPI protocol. Arduino SPI pins are available on digital pins 10 to 13. The sensor is powered by the Arduino's 3.3V output.

Here is a diagram…

The code

Adafruit offers a predefined library that has almost all of the functions of this sensor available. However, the Adafruit BME sensor library first requires the Adafruit sensor as well as the Arduino SPI and I2C wire library to properly configure and start the BME680.

After importing the library, the SPI pins are declared. Pins must be passed to the BME builder for initialization.

Furthermore, to measure barometric pressure, it is necessary to specify a reference pressure. Therefore, we used typical sea level pressure as a reference for calculating barometric pressure for this project.

How it works
In the setup function, the Arduino serial monitor starts at 9600 bps. The sensor must then be probed to verify that the connection has been established successfully.

In the loop function, readings are received continuously from the sensor. If the data request is successful, the individual parameter values ​​will be displayed on the Arduino IDE's serial monitor.

Note: Gas and pressure values ​​are divided by 1000 and 100, respectively, to assign them units in kOhm and hpa.

To get more stable values ​​for the individual parameters, simply increase the sampling rate for them.

Instructions

1. bme.setTemperatureOversampling(BME680_OS_8X);
2. bme.setHumidityOversampling(BME680_OS_2X);
3. bme.setPressureOversampling(BME680_OS_4X);
4. bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
5. bme.setGasHeater(320, 150); // 320*C for 150 ms

To view the results, open the Arduino IDE serial monitor at 9600 bps. During initial startup, the sensor will take a few seconds. After a few readings, the sensor will stabilize and produce accurate values.

Where to buy the parts?

  • ArduinoNano: mouse
  • BME680 Sensor: Digi-Key

Conteúdo Relacionado

How to Troubleshoot Common ESP32-CAM Problems
ESP32-CAM is a compact camera module that combines the...
What is the role of automotive sensors in modern vehicles?
A network of sensors is embedded in every vehicle,...
How to choose an e-bike controller
The motor controller is one of the most important...
A guide to USB standards from 1.0 to USB4
A evolução dos padrões USB foi fundamental para moldar...
Schurter aprimora série de seletores de tensão com revestimento prateado
A SCHURTER anuncia um aprimoramento para sua conhecida série...
A interface serial PCI fornece conectividade confiável em ambientes extremos
A Sealevel Systems anuncia o lançamento da Interface Serial...
STMicroelectronics expande portfólio de conversão de energia com diodos Trench Schottky de 100 V
A STMicroelectronics introduziu Diodos retificadores Schottky de trincheira de...
O que são Sistemas Globais de Navegação por Satélite (GNSS) e como são usados?
Determinar uma localização precisa é necessário em várias indústrias...
O conversor GaN de 50 W da STMicroelectronics permite projetos de energia de alta eficiência
O novo VIPerGaN50 da STMicroelectronics simplifica a construção de...
Samsung e Red Hat farão parceria em software de memória de próxima geração
A Samsung Electronics, fornecedora de tecnologia de memória avançada,...
Primeiro MPU single-core com interface de câmera MIPI CSI-2 e áudio
O mercado embarcado tem uma necessidade de soluções de...
Fluency decoding in induction motor for better performance
You have probably come across the term ' drag...
Understanding Support Insulators in Electrical Systems
You probably have a support insulator if you've noticed...
Explore Stay Insulator – safety, installation and maintenance
You've probably seen stand an insulator sit on power...
More safety and efficiency with the shackle isolator
You've probably seen shackle insulators enthroned on electricity poles,...
Discover the power of latching relays for energy efficiency and more
You have probably experienced situations where controlling a circuit...
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.