VOOZH about

URL: https://www.nuget.org/packages/nanoFramework.Iot.Device.Bmxx80/

⇱ NuGet Gallery | nanoFramework.Iot.Device.Bmxx80 1.2.952




👁 Image
nanoFramework.Iot.Device.Bmxx80 1.2.952

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Bmxx80 --version 1.2.952
 
 
NuGet\Install-Package nanoFramework.Iot.Device.Bmxx80 -Version 1.2.952
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Bmxx80" Version="1.2.952" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Bmxx80" Version="1.2.952" />
 
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Bmxx80" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Bmxx80 --version 1.2.952
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: nanoFramework.Iot.Device.Bmxx80, 1.2.952"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Bmxx80@1.2.952
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Bmxx80&version=1.2.952
 
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Bmxx80&version=1.2.952
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

BMP280/BME280/BME680 Device Family

BMxx80 is a device family that senses temperature, barometric pressure, altitude, humidity and VOC gas.

SPI and I2C can be used to communicate with the device (only I2C implemented so far).

Documentation

The implementation supports the following devices:

  • BMP280 temperature and barometric pressure sensor (Datasheet)
  • BME280 temperature, barometric pressure and humidity sensor (Datasheet)
  • BME680 temperature, barometric pressure, humidity and VOC gas sensor (Datasheet)

Usage

BME280

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.

// bus id on the MCU
const int busId = 1;
I2cConnectionSettings i2cSettings = new(busId, Bme280.DefaultI2cAddress);
using I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
using Bme280 bme80 = new Bme280(i2cDevice)
{
 // set higher sampling
 TemperatureSampling = Sampling.LowPower,
 PressureSampling = Sampling.UltraHighResolution,
 HumiditySampling = Sampling.Standard,

};

// Perform a synchronous measurement
var readResult = bme80.Read();

// Note that if you already have the pressure value and the temperature, you could also calculate altitude by using
// var altValue = WeatherHelper.CalculateAltitude(preValue, defaultSeaLevelPressure, tempValue) which would be more performant.
bme80.TryReadAltitude(defaultSeaLevelPressure, out var altValue);

Debug.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Debug.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Debug.WriteLine($"Altitude: {altValue.Meters:0.##}m");
Debug.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");

BMP680

// The I2C bus ID on the MCU
const int busId = 1;

I2cConnectionSettings i2cSettings = new(busId, Bme680.DefaultI2cAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);

using Bme680 bme680 = new Bme680(i2cDevice, Temperature.FromDegreesCelsius(20.0));

// reset will change settings back to default
bme680.Reset();

// Perform a synchronous measurement
var readResult = bme680.Read();

// Print out the measured data
Debug.WriteLine($"Gas resistance: {readResult.GasResistance?.Ohms:0.##}Ohm");
Debug.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Debug.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");
Debug.WriteLine($"Relative humidity: {readResult.Humidity?.Percent:0.#}%");

BMP280

// bus id on the MCU
const int busId = 1;

I2cConnectionSettings i2cSettings = new(busId, Bmp280.DefaultI2cAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
using var i2CBmp280 = new Bmp280(i2cDevice);

// set higher sampling
i2CBmp280.TemperatureSampling = Sampling.LowPower;
i2CBmp280.PressureSampling = Sampling.UltraHighResolution;

// Perform a synchronous measurement
var readResult = i2CBmp280.Read();

// Print out the measured data
Debug.WriteLine($"Temperature: {readResult.Temperature?.DegreesCelsius:0.#}\u00B0C");
Debug.WriteLine($"Pressure: {readResult.Pressure?.Hectopascals:0.##}hPa");

You also have 3 examples on how to use this device binding are available in the folder.

The following fritzing diagram illustrates one way to wire up the BMP280 with an MCU like ESP32 using I2C:

General:

Bmp280 MCU
Vin Power pin
GND Ground

I2C:

Bmp280 MCU
SCK I2C clock pin
SDI I2C data pin

Connection Type

The following connection types are supported by this binding.

  • I2C
  • SPI
Product Versions Compatible and additional computed target framework versions.
.NET Framework net net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on nanoFramework.Iot.Device.Bmxx80:

Repository Stars
dotnet/samples
Sample code referenced by the .NET documentation
nanoframework/Samples
🍬 Code samples from the nanoFramework team used in testing, proof of concepts and other explorational endeavours
Version Downloads Last Updated
2.0.0-preview.85 48 6/1/2026
2.0.0-preview.80 57 5/27/2026
2.0.0-preview.73 52 5/20/2026
2.0.0-preview.69 56 5/18/2026
2.0.0-preview.62 58 5/13/2026
2.0.0-preview.58 55 5/12/2026
2.0.0-preview.45 59 4/29/2026
2.0.0-preview.32 61 4/20/2026
2.0.0-preview.16 71 3/10/2026
1.2.952 233 3/4/2026
1.2.931 449 11/10/2025
1.2.907 293 10/2/2025
1.2.892 288 7/30/2025
1.2.889 261 7/28/2025
1.2.869 521 4/2/2025
1.2.864 334 4/2/2025
1.2.852 411 3/11/2025
1.2.846 348 3/10/2025
1.2.822 350 2/26/2025
1.2.775 401 2/4/2025
Loading failed