Jump to content

Component: Air Quality (BME688) (Environmental): Difference between revisions

From Flowcode Help
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(2 intermediate revisions by the same user not shown)
Line 31: Line 31:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Initialises the I2C bus and sets up the device ready for operation. Returns 1 if the device has been found and is communicating. 
| colspan="2" | Initialises the I2C bus and sets up the device ready for operation. Returns 1 if the device has been found and is communicating. 
Line 45: Line 45:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PerformGasResistanceCycle'''
| width="90%" class="mtx-class-macrohead" | '''PerformGasResistanceCycle'''
|-
|-
| colspan="2" | 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.  
| colspan="2" | 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.  
Line 69: Line 69:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadGasResistance'''
| width="90%" class="mtx-class-macrohead" | '''ReadGasResistance'''
|-
|-
| colspan="2" | Reads the resistance of the gas in ohms from the last heating cycle. 
| colspan="2" | Reads the resistance of the gas in ohms from the last heating cycle. 
Line 83: Line 83:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadHumidity'''
| width="90%" class="mtx-class-macrohead" | '''ReadHumidity'''
|-
|-
| colspan="2" | Collects the humidity and returns as a floating point value in percent. 
| colspan="2" | Collects the humidity and returns as a floating point value in percent. 
Line 102: Line 102:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPressure'''
| width="90%" class="mtx-class-macrohead" | '''ReadPressure'''
|-
|-
| colspan="2" | Collects the pressure and returns as a floating point value in pascal. 
| colspan="2" | Collects the pressure and returns as a floating point value in pascal. 
Line 121: Line 121:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRegister'''
| width="90%" class="mtx-class-macrohead" | '''ReadRegister'''
|-
|-
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
| colspan="2" | A simple example showing a generic way to read a register using I2C. 
Line 140: Line 140:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadTemperature'''
| width="90%" class="mtx-class-macrohead" | '''ReadTemperature'''
|-
|-
| colspan="2" | Collects the temperature and returns as a floating point value in degrees C. 
| colspan="2" | Collects the temperature and returns as a floating point value in degrees C. 
Line 159: Line 159:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMode'''
| width="90%" class="mtx-class-macrohead" | '''SetMode'''
|-
|-
| colspan="2" | Sets the mode of the sensor to low power sleep, forced or parallel 
| colspan="2" | Sets the mode of the sensor to low power sleep, forced or parallel 
Line 178: Line 178:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRegister'''
| width="90%" class="mtx-class-macrohead" | '''WriteRegister'''
|-
|-
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
| colspan="2" | A simple example showing a generic way to write a register using I2C. 
Line 203: Line 203:
|-
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I2C Properties
| width="90%" class="mtx-class-propfolder" | I2C Properties
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 239: Line 239:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Options
| width="90%" class="mtx-class-propfolder" | Options
|-
|-
|-
|-
Line 263: Line 263:
| colspan="2" | Baud rate to be used 
| colspan="2" | Baud rate to be used 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-
Line 272: Line 272:
| colspan="2" |  
| colspan="2" |  
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Comms Simulation
| width="90%" class="mtx-class-propfolder" | Comms Simulation
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

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

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


PerformGasResistanceCycle

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.  
- FLOAT Temperature
Temperature in Celcius we want to reach, typically between 200 and 400�C 
- UINT Duration
Step duration in milliseconds, default 30 - Range: 1 to 4032 
- BOOL Return


ReadGasResistance

ReadGasResistance
Reads the resistance of the gas in ohms from the last heating cycle. 
- FLOAT Return


ReadHumidity

ReadHumidity
Collects the humidity and returns as a floating point value in percent. 
- BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
- FLOAT Return


ReadPressure

ReadPressure
Collects the pressure and returns as a floating point value in pascal. 
- BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
- FLOAT Return


ReadRegister

ReadRegister
A simple example showing a generic way to read a register using I2C. 
- BYTE Address
 
- BYTE Return


ReadTemperature

ReadTemperature
Collects the temperature and returns as a floating point value in degrees C. 
- BYTE Index
Forced Mode = 0 / Parallel Mode = 0-2 
- FLOAT Return


SetMode

SetMode
Sets the mode of the sensor to low power sleep, forced or parallel 
- BYTE Mode
0=Sleep, 1=Forced, 2=Parallel 
- VOID Return


WriteRegister

WriteRegister
A simple example showing a generic way to write a register using I2C. 
- BYTE Address
 
- BYTE Data
 
- VOID Return


Property reference

Properties
I2C Properties
Connections
Channel
Channel selection 
SDA
Pin used for SDA (data signal) 
SDA Remap Pin
 
SCL
Pin used for SCL (clock signal) 
SCL Remap Pin
 
Options
Device Address
 
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.  
Baud Select
Baud rate option selector 
Baud Rate
Baud rate to be used 
Simulation
Simulate Comms
 
Comms Simulation
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. 
Console Data
Selects if the console data is automatically generated or not 
Injector
Specifies the injector component on the panel to interact with to provide comms simulation.