Component: Air Quality (BME688) (Environmental)

From Flowcode Help
Jump to navigationJump to search
Author MatrixTSL
Version 1.0
Category Environmental


Air Quality (BME688) component

An air quality sensor connected using a standard I2C bus. Capable of detecting indoor and outdoor air quality including CO2 H2 VOCs and VSCs.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_BME688_AirQualitySensor.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_BME688_AirQualitySensor.fcfx

Detailed description

Examples

Macro reference

Initialise

Fc9-comp-macro.png Initialise
Initialises the I2C bus and sets up the device ready for operation. Returns 1 if the device has been found and is communicating. 
Fc9-bool-icon.png - BOOL Return


PerformGasResistanceCycle

Fc9-comp-macro.png PerformGasResistanceCycle
Performs a forced heating cycle. Returns 1 for a successful cycle. Returns 0 if the heating time was not enough or the temperature was too high to reach.  
Fc9-f32-icon.png - FLOAT Temperature
Temperature in Celcius we want to reach, typically between 200 and 400�C 
Fc9-u16-icon.png - UINT Duration
Step duration in milliseconds, default 30 - Range: 1 to 4032 
Fc9-bool-icon.png - BOOL Return


ReadGasResistance

Fc9-comp-macro.png ReadGasResistance
Reads the resistance of the gas in ohms from the last heating cycle. 
Fc9-f32-icon.png - FLOAT Return


ReadHumidity

Fc9-comp-macro.png ReadHumidity
Collects the humidity and returns as a floating point value in percent. 
Fc9-u8-icon.png - BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
Fc9-f32-icon.png - FLOAT Return


ReadPressure

Fc9-comp-macro.png ReadPressure
Collects the pressure and returns as a floating point value in pascal. 
Fc9-u8-icon.png - BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
Fc9-f32-icon.png - FLOAT Return


ReadRegister

Fc9-comp-macro.png ReadRegister
A simple example showing a generic way to read a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Return


ReadTemperature

Fc9-comp-macro.png ReadTemperature
Collects the temperature and returns as a floating point value in degrees C. 
Fc9-u8-icon.png - BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
Fc9-f32-icon.png - FLOAT Return


SetMode

Fc9-comp-macro.png SetMode
Sets the mode of the sensor to low power sleep, forced or parallel 
Fc9-u8-icon.png - BYTE Mode
0=Sleep, 1=Forced, 2=Parallel 
Fc9-void-icon.png - VOID Return


WriteRegister

Fc9-comp-macro.png WriteRegister
A simple example showing a generic way to write a register using I2C. 
Fc9-u8-icon.png - BYTE Address
 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I2C Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
Fc9-conn-icon.png Options
Fc9-type-16-icon.png Device Address
 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms
 
Fc9-conn-icon.png Comms Simulation
Fc9-type-7-icon.png Scope Traces
Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png Injector
Specifies the injector component on the panel to interact with to provide comms simulation.