nanoFramework.Iot.Device.Bmp180 2.0.0-preview.16

Prefix Reserved
This is a prerelease version of nanoFramework.Iot.Device.Bmp180.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Bmp180 --version 2.0.0-preview.16
                    
NuGet\Install-Package nanoFramework.Iot.Device.Bmp180 -Version 2.0.0-preview.16
                    
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.Bmp180" Version="2.0.0-preview.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Bmp180" Version="2.0.0-preview.16" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Bmp180" />
                    
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.Bmp180 --version 2.0.0-preview.16
                    
#r "nuget: nanoFramework.Iot.Device.Bmp180, 2.0.0-preview.16"
                    
#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.Bmp180@2.0.0-preview.16
                    
#: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.Bmp180&version=2.0.0-preview.16&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Bmp180&version=2.0.0-preview.16&prerelease
                    
Install as a Cake Tool

BMP180 - barometer, altitude and temperature sensor

BMP180 is a device that read barometric pressure, altitude and temperature. I2C can be used to communicate with the device.

Documentation

Datasheet for the BMP180.

Usage

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.

An example on how to use this device binding is available in the samples folder.

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

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

using Bmp180 i2cBmp280 = new(i2cDevice);
// set samplings
i2cBmp280.SetSampling(Sampling.Standard);

// read values
Temperature tempValue = i2cBmp280.ReadTemperature();
Debug.WriteLine($"Temperature: {tempValue.DegreesCelsius:0.#}\u00B0C");
Pressure preValue = i2cBmp280.ReadPressure();
Debug.WriteLine($"Pressure: {preValue.Hectopascals:0.##}hPa");

// Note that if you already have the pressure value and the temperature, you could also calculate altitude by
// calling WeatherHelper.CalculateAltitude(preValue, Pressure.MeanSeaLevel, tempValue) which would be more performant.
Length altValue = i2cBmp280.ReadAltitude(WeatherHelper.MeanSeaLevel);

Debug.WriteLine($"Altitude: {altValue:0.##}m");
Thread.Sleep(1000);

// set higher sampling
i2cBmp280.SetSampling(Sampling.UltraLowPower);

// read values
tempValue = i2cBmp280.ReadTemperature();
Debug.WriteLine($"Temperature: {tempValue.DegreesCelsius:0.#}\u00B0C");
preValue = i2cBmp280.ReadPressure();
Debug.WriteLine($"Pressure: {preValue.Hectopascals:0.##}hPa");

// Note that if you already have the pressure value and the temperature, you could also calculate altitude by
// calling WeatherHelper.CalculateAltitude(preValue, Pressure.MeanSeaLevel, tempValue) which would be more performant.
altValue = i2cBmp280.ReadAltitude(WeatherHelper.MeanSeaLevel);
Debug.WriteLine($"Altitude: {altValue:0.##}m");

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

ESP32 Breadboard diagram

Product Compatible and additional computed target framework versions.
.NET Framework 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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.73 39 5/20/2026
2.0.0-preview.69 46 5/18/2026
2.0.0-preview.62 53 5/13/2026
2.0.0-preview.45 58 4/29/2026
2.0.0-preview.32 52 4/20/2026
2.0.0-preview.16 65 3/10/2026
1.2.952 125 3/4/2026
1.2.931 312 11/10/2025
1.2.907 275 10/2/2025
1.2.892 247 7/30/2025
1.2.889 252 7/28/2025
1.2.871 350 4/7/2025
1.2.869 345 4/2/2025
1.2.864 352 4/2/2025
1.2.852 381 3/11/2025
1.2.846 366 3/10/2025
1.2.822 301 2/26/2025
1.2.775 304 2/4/2025
1.2.772 267 2/4/2025
1.2.755 307 1/31/2025
Loading failed