How to add environmental sensing industrial IoT design using Bosch Sensortec

The ability to measure environmental parameters can be used as a basis for building mature health and safety features in factory and industrial applications as well as in smart buildings, home appliances and personal products. However, in order to provide these features that help meet regulatory requirements, developers need to find a way to effectively combine effects from multiple sensors, minimizing space, power and cost while ensuring the highest accuracy and accuracy. Degree and reliability.

To achieve this, developers can now turn to sophisticated sensor fusion algorithms that produce information about air quality, temperature, humidity, and overall comfort.

This article will show you how to use Bosch Sensortec's single device and software, especially the BME680 and its associated supporting hardware and software, to do this with minimal effort.

Regulations for driving air sensor development

Health and comfort levels are closely related to environmental factors, far beyond simple measurements of basic parameters. The human feeling of comfort temperature depends not only on temperature but also on humidity levels. Health experts combine temperature and humidity to create a “high temperature index” that alerts you to major health risks. As predicted by the heat index, people working in a specific temperature environment may face serious health risks as humidity increases (Figure 1).

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 1: Humans are affected by a combination of temperature and relative humidity, making them more useful for simultaneous measurements.

Experts in human factors further studied and defined a subjective “comfort zone” based on a new parameter of “effective temperature” that combines temperature and humidity into a single indicator. Changes in temperature or humidity can quickly lead to an environment that is typically uncomfortable for individuals (Figure 2).

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 2: Humans believe that changes in temperature and relative humidity make the comfort zone narrow, and in extreme cases lead to significant health risks including heat stroke.

As with the heat index, extreme changes in temperature, humidity, or both outside the comfort zone can quickly cause unpleasant conditions. Individuals may even be at risk of heat stroke above temperature-dependent humidity levels. The concept of a comfort zone in a work environment is so important that its operating parameters are specified in the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE) Standard 55, approved by the American National Standards Institute (ANSI).

Although significant short trips outside the comfort zone may affect health, even limited temperature changes can affect a person's performance. In a survey of experimental research on this topic, the researchers found that performance was declining outside the relatively narrow effective temperature range (Figure 3).

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 3: Researchers have consistently found that performance degrades when the effective temperature exceeds a relatively narrow range.

At the same time, temperature and humidity are by no means independent of health. Volatile organic compounds (VOCs) are caused by a variety of natural and anthropogenic sources and pose a particularly hidden threat to air quality. Because air quality is critical to health, organizations such as the US Environmental Protection Agency (EPA) have compressed various air quality parameters into a single indicator (Figure 4). The Air Quality Index (AQI) is often presented as a health indicator for cities and larger geographic areas and can be directly applied to microclimates, buildings and other high-occupancy areas. Advanced heating, ventilation, and air conditioning (HVAC) systems in large buildings often rely on some measure of air quality as part of their airflow process control design.

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 4: Environmental and health organizations use standard air quality indicators to warn local residents of air quality conditions that can lead to a range of health risks.

For engineers, the complex interrelationships between fundamental factors such as temperature, humidity and volatile organic compounds are a huge challenge for the design of health and wellness sensing systems. At the most basic level, designers must accurately measure each factor.

In the past, developers solved these types of sensing problems by combining sensors with custom signal chains to process raw voltage and current outputs. The advent of smart sensors has greatly simplified the development of sensing systems. By integrating sensors, sensor signal chains, analog-to-digital converters (ADCs) and control logic, smart sensors provide accurate temperature-compensated digital sensor data to the host MCU. Developers simply connect these devices to the MCU through an integrated SPI or I 2 C interface that is typically supported by the sensor.

Still, for derivative analysis such as comfort zones and AQI, even a single collection of smart sensors does not provide an effective solution. Moreover, the use of multiple sensors results in greater design complexity, a larger BOM, and a larger physical footprint. This reduces the ability of developers to meet their customers' needs for smaller, more efficient designs.

Perhaps worse, the use of multiple sensors, even smart sensors, is designed to meet major functional requirements. Even as important as the effective temperature, derived measurements require developers to synchronize the underlying sensor measurements for the sensor fusion algorithm. The Bosch Sensortec BME680 eliminates these design constraints, enabling developers to use a single device and associated sensor fusion library to quickly meet the needs of health and wellness applications.

Integrated smart sensor

The BME680 is an integrated environmental sensor that integrates temperature, humidity, pressure and gas sensors in a size of only 3 x 3 x 1 mm and is available in an 8-lead LGA package. In particular, the gas sensor of the device supports air quality measurements based on various gas measurements.

The device achieves high linearity and high accuracy while consuming only microamps (μA) during normal operation and only 0.16μA in sleep mode. During typical operation, the BME680's temperature measurement consumes only 1.0μA. For a combined measurement of humidity, pressure and temperature, the device uses only 3.7μA. For gas sensing, the nature of the sensor subsystem results in power consumption from 0.09 milliamps (mA) to 12 mA (depending on the mode of operation).

The higher power consumption of gas sensing comes from a two-stage process. The gas sensor itself is a metal oxide based device that changes its resistance when it comes into contact with a wide variety of VOCs or other environmental contaminants. However, before the sensor is running, the heater in the gas sensor subsystem raises the temperature to the level required to ensure accurate measurements. Within the gas sensor subsystem, the heater control module uses a control loop to control the output of the integrated digital-to-analog converter (DAC). In turn, the DAC output is used to adjust the amount of current injected into the resistive heater element to increase the temperature.

The BME680 provides developers with several ways to control gas induced power consumption. With three different modes of operation, developers can exchange the update rate of power consumption. For applications that require a maximum update rate, the gas sensor can operate in continuous mode that is updated once per second, consuming 12 mA.

For applications with lower update requirements, developers can choose between two different modes. In low power mode, the gas sensor updates the reading every 3 seconds, consuming 0.9 mA during this process. For applications with power limits greater than the update rate, developers can operate the gas sensor in ultra-low power mode, which consumes only 0.09 mA but is updated every 300 seconds.

These two modes differ greatly in the response time of the gas sensor except for the difference in update rate and power consumption. In low power mode, the typical response time of the gas sensor subsystem is 1.4 s. Ultra-low power modes result in significantly slower response times, typically 92 s.

Developers can also control power consumption to a certain degree by controlling the heating process. Typically, to achieve the desired temperature level, the device requires a heating time of approximately 30 ms prior to gas sensor measurement. Developers can control the heating duration and affect power consumption by programming the heating duration from 1 millisecond to 4032 milliseconds.

Sensing sequence

To avoid unnecessary power consumption, the BME680 starts up in sleep mode and waits for measurement commands. In most cases, the developer operates the device in a forced mode, allowing the device to automatically sample each sensor in turn (Figure 5).

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 5: In forced mode operation, the Bosch Sensortec BME680 heats the gas sensor before sampling and then samples its temperature, pressure and humidity sensors.

In forced mode, the device will complete the measurement of the temperature, pressure and humidity sensors before the heating required before the gas sensor measurement. During the heating phase, the heating element typically reaches a target temperature between 200 °C and 400 °C and maintains the temperature of the heating duration of the program. By performing this heating phase only after the initial sensor measurement, the device avoids any direct influence of the heating element on those sensor measurements. Finally, when the heating phase reaches the specified time, the device's ADC produces a gas sensor resistance value.

The BME680 signal chain provides developers with a way to optimize certain measurements. To reduce the measurement of RMS noise, developers can program the device to oversample its temperature, humidity, and pressure sensors. You can also choose to enable an integrated infinite impulse response (IIR) filter to reduce the effects of transient events on temperature and pressure sensor measurements. Although the internal IIR filter can reduce the bandwidth of these measurements, it increases the resolution from 16 bits to 20 bits. Please note that due to their measurement methods, this type of filtration is not required for humidity and gas sensors.

In addition to configuring the sensor's measurement process, designers can individually enable or disable individual temperature, humidity, and pressure sensor measurements. However, Bosch Sensortec recommends that developers always enable temperature measurements because the relevant software package uses temperature data to correct other sensor measurements.

Although oversampling and filtering can reduce noise and increase resolution, the final output of the BME680 will eventually take the form of uncompensated sensor values ​​generated by the device's internal ADC. Developers need to apply calibration parameters stored in the device to produce accurate results. Fortunately, the device driver contains an application programming interface (API) that handles this task.

Design and development with BME680

To help start the design, Bosch Sensortec provides a complete driver and API that simplifies software development using BME680. For basic operations such as data compensation, developers only need to call different API functions for each sensor. For example, the call parameters of the calc_gas_resistance function include the gas sensor ADC output and the BME60 data structure (Listing 1) for accessing the calibration data stored in the device.

Struct bme680_dev {

/*! Chip Id */

Uint8_t chip_id;

/*! Device Id */

Uint8_t dev_idDK;

/*! SPI/I2C interface */

Enum bme680_intf intf;

/*! Memory page used */

Uint8_t mem_page;

/*! Ambient temperature in Degree C*/

Int8_t amb_temp;

/*! Sensor calibraTIon data */

Struct bme680_calib_data calib;

/*! Sensor setTIngs */

Struct bme680_tph_sett tph_sett;

/*! Gas Sensor setTIngs */

Struct bme680_gas_sett gas_sett;

/*! Sensor power modes */

Uint8_t power_mode;

/*! New sensor fields */

Uint8_t new_fields;

/*! Store the info messages */

Uint8_t info_msg;

/*! Burst read structure */

Bme680_com_fptr_t read;

/*! Burst write structure */

Bme680_com_fptr_t write;

/*! Delay in ms */

Bme680_delay_fptr_t delay_ms;

/*! CommunicaTIon function result */

Int8_t com_rslt;

};

Listing 1: The Bosch Sensortec open source BME680 driver provides all the basic software support for interacting with the BME680 and illustrates the key software architecture with key configuration values. (Source: Bosch Sensortec)

This function returns the corrected gas sensor result based on the parameters stored in the device (Listing 2).

Static uint32_t calc_gas_resistance(uint16_t gas_res_adc, uint8_t gas_range, const struct bme680_dev *dev)

{

Int64_t var1;

Uint64_t var2;

Int64_t var3;

Uint32_t calc_gas_res;

Var1 = (int64_t) ((1340 + (5 * (int64_t) dev-"calib.range_sw_err)) *

((int64_t) lookupTable1[gas_range])) 》》 16;

Var2 = (((int64_t) ((int64_t) gas_res_adc" "15) - (int64_t) (16777216)) + var1);

Var3 = (((int64_t) lookupTable2[gas_range] * (int64_t) var1) 》》 9);

Calc_gas_res = (uint32_t) ((var3 + ((int64_t) var2 》 1)) / (int64_t) var2);

Return calc_gas_res;

}

Listing 2: The BME680 driver contains sensor-specific routines, such as this feature, which converts raw gas sensor data into calibration readings using sensor calibration data stored in the device. (Source: Bosch Sensortec)

However, as previously mentioned, more useful quantities are derived from raw temperature, humidity and gas sensor data algorithms, such as effective temperature, comfort and air quality. For example, air quality depends not only on the VOC readings from the gas sensors, but also on the effective temperature, depending on the temperature and humidity results of these sensors. In addition to the complexity of this algorithm, the natural drift of the sensor requires regular calibration methods to maintain accurate results. The Bosch Software Environment Cluster (Black Sea Economic Cooperation) package addresses these issues, enabling developers to easily generate the complex information needed for health and wellness applications.

Based on the open source BME680 driver set, BSEC is a closed binary package that implements the algorithms required for sensor fusion. For example, using the BME680 sensor readings, the BSEC algorithm generates an indoor air quality indicator that reflects the standard air quality indicators shown in Figure 4.

Bosch Sensors provides the Black Sea Economic Cooperation as the main instruction set architecture, including the ARM binary distribution® Cortex®-M, the Espressif system ESP8266 and the Renesas RL78 MCU. The BESC distribution also includes a C language header file for the BESC API and sample software that illustrates the use of the BSEC Sensor Fusion API. For example, the sample main program (Listing 3) demonstrates a complete sensor program that uses only two functions to initialize the device and periodically sample the BME680 sensor.

Int main()

{

/* Call to the function which initializes the BSEC library

* Switch on low-power mode and provide no temperature offset */

Bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0f, bus_write, bus_read, sleep);

/* Call to endless loop function which reads and processes data based on sensor settings */

Bsec_iot_loop(sleep, get_timestamp_us, output_ready);

Return 0;

}

Listing 3: The Bosch Software Environment Cluster (BSEC) software distribution includes sample software, such as the main program that describes device initialization and sensor sampling. (Source: Bosch Sensortec)

Developers use the bsec_iot_init function to specify the sample rate, temperature offset, and sleep time between samples. Two additional parameters, bus_write, bus_read, allow developers to exchange different bus access methods to read and write to the BME680 registers.

As part of the system configuration, developers can specify their own software routines for bus writes and reads. For example, they can use the Arduino Wire Library for bus I/O (Listing 4) to easily run drivers or BESC packages on the Arduino platform. The driver and BESC each use a device structure that contains pointers to these custom I/O routines. During program execution, the work code performs bus operations using software I/O routines referenced by pointers in the device structure.

#include "Wire.h"

Int8_t bus_write(uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data_ptr, uint8_t data_len)

{

Wire.beginTransmission(dev_addr);

Wire.write(reg_addr); /* Set register address to start writing to */

/* Write the data */

For (int index = 0; index " data_len; index++) {

Wire.write(reg_data_ptr[index]);

}

Return (int8_t)Wire.endTransmission();

}

Listing 4: Using the Bosch Sensortec BME680 driver and the BESC package, developers can use their platform-specific bus I/O software routines, such as this bus write routine, which uses Arduino Wire libraries in Arduino-compatible Operate on the hardware platform. (Source: Bosch Sensortec)

For the development platform itself, users can use the Arduino-compatible evaluation board and the boards provided by Bosch Sensortec. The company's BME680 shuttle board simply presents the V DD analog power supply for the BME680 device, ground, V DDIO digital power, ground and serial interfaces (chip select, serial data input, serial data output, serial clock input). Developers can use the shuttle board in their own custom MCU-based designs or insert the shuttle board into Bosch Sensortec's own application board.

For Arduino developers, the MikroElektronika MIKROE-2467 MikroBUS click board provides an easy choice for connecting compatible development boards. With the BME680, click on the board to add a USB interface and power regulator. Developers can use the clickpad alone or plug it into MikroBUS compatible hardware such as the MikroElektronika MIKROE-2340 development board (Figure 6).

How to add environmental sensing industrial IoT design using Bosch Sensortec

Figure 6: By inserting the MikroElektronika MIKROE-2467 MikroBUS click board into the MikroElektronika MIKROE-2340 development board, developers can quickly start developing BME680-based applications that provide MikroBUS connectors on one side of the board and on the other side. Arduino connector. (Source: MikroElektronika)

The board includes the Microchip Technology 32-bit PIC32MZ2048EFH100 MCU, which features a high-performance MIPS32 M-class processor core, floating-point unit, 2 MB flash, 512 KB SRAM, rich analog peripherals and standard digital interfaces. In addition to standard connectors, the MIKROE-2340 board also comes with a development port and LED indicators for simple user notification.

The board's unique feature is support for MikroBus and Arduino connectors, which can be used on either side of the double-sided board. For software design, the board supports chipKIT, an open source embedded development environment compatible with Arduino. Using the familiar Arduino environment, designers can quickly implement environmental sensing systems using the extensive Arduino ecosystem.

in conclusion

The Bosch Sensortec BME680, combined with Bosch software environment clusters and drivers, greatly reduces the complexity, cost and floor space of environmental sensing hardware and software design.

This combination provides a numerical assessment of air quality, effective temperature and comfort, enabling developers to create more complex designs to meet health-related health and safety requirements in industrial, urban and home applications.

Others Patent Vape

Others Patent Vape,Air Bars Disposable,Disposable Vapor Pen,Disposable E-Cigarette

Guangzhou Yunge Tianhong Electronic Technology Co., Ltd , https://www.e-cigarettesfactory.com