BME680 Environmental Sensor
This documentation includes installation guidelines and sample code for your hardware.
Windows 10 IoT Core Library
BME680Sensor library is responsible for communicating with the BME680 sensor.
To use the library, add the following using statement to the top of your C# code.
Then, create an instance of the BME680Sensor class.
Now you're ready to access the library by calling the bme instance.
Initialization
BME680Sensor
Initiates the BME680 sensor to get temperature, humidity, pressure, altitude, and gas resistance.
Parameters
None
Basic Members
Read Temperature
Reads the temperature in Celcius.
Parameters
None
Returns
Double: Temperature in Celcius.
Read Humidity
Reads the relative humidity.
Parameters
None
Returns
Double: Relative humidity.
Read Pressure
Reads the pressure in Pa.
Parameters
None
Returns
Double: Pressure in Pa.
Calculate Altitude
Reads the altitude from the sea level in meters.
Parameters
Double meanSeaLevelPressureInBar: Mean sea level pressure in bar.
Returns
Double: Altitude from the sea level in meters.
Read Gas Resistance
Reads the gas resistance.
Parameters
None
Returns
Double: Gas resistance in Ohms.
Read Temperature, Pressure and RH
Reads temperature, pressure and relative humidity.
Parameters
None
Returns
Double[]: Temperature in Celcius, pressure in Pa and relative humidity respectively.
Disposal
To clean up the resources used by the class, call the Dispose() method it when the application is closing.
This method cleans the resources used by the class.
Samples
You can copy the example code from https://github.com/Turta-io/IoTHAT/tree/master/Samples/Windows10IoTCore address. There is one example of this library.
BME680 Sample App
This application demonstrates reading environmental data from the sensor.
To run the example:
Open the sample project you downloaded.
Make sure "ARM" is selected from the solution platforms selection.
Deploy the sample to the Raspberry Pi using the "F5" key.
Sample Code
Result
When you run the sample, it prints the environmental data to the Visual Studio Output / Immediate Window.
To stop the application, use the "Stop" button on the Visual Studio.
Last updated