Remarks

Ms5611
Status
Source code GitHub
NuGet package

The MS5611 is a barometer and temperature sensor that communicates over I2C or SPI up to 20Mhz. Operating range: 10 to 1200 mbar, -40 to +85 °C.

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    public MeadowApp()
    {
        Console.WriteLine("Ms5611App");

        Ms5611I2cTest();
        //   Ms5611SpiTest();
    }

    void Ms5611I2cTest()
    {
        Console.WriteLine("MS5611 I2C Test");

        var i2c = Device.CreateI2cBus();
        var sensor = new Ms5611(i2c);

        while (true)
        {
            Thread.Sleep(1000);

            Console.WriteLine(" Reading Temp...");
            sensor.ReadTemperature();

            Console.WriteLine(" Reading Pressure...");
            sensor.ReadPressure();

            Thread.Sleep(1000);
        }
    }

    void Ms5611SpiTest()
    {
        Console.WriteLine("MS5611 SPI Test");

        var spi = Device.CreateSpiBus();
        var sensor = new Ms5611(spi, Device.Pins.D00);

        while (true)
        {
            Console.WriteLine(" Reading...");
            Thread.Sleep(2000);
        }
    }
}

Sample projects available on GitHub

Wiring Example

To wire a Ms5611 to your Meadow board, connect the following:

Ms5611 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Characteristic Locus
Inheritance System.Object > Ms5611
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.Sensors.Atmospheric
Assembly Ms5611.dll

Syntax

public class Ms5611

Constructors

Ms5611(II2cBus, Byte, Ms5611.Resolution)

Connect to the GY63 using I2C (PS must be pulled high)

Declaration
public Ms5611(II2cBus i2c, byte address = 118, Ms5611.Resolution resolution = Ms5611.Resolution.OSR_1024)

Parameters

Type Name Description
II2cBus i2c
System.Byte address

0x76 is CSB is pulled low, 0x77 if CSB is pulled high

Ms5611.Resolution resolution

Ms5611(ISpiBus, IPin, Ms5611.Resolution)

Connect to the Ms5611 using SPI (PS must be pulled low)

Declaration
public Ms5611(ISpiBus spi, IPin chipSelect, Ms5611.Resolution resolution = Ms5611.Resolution.OSR_1024)

Parameters

Type Name Description
ISpiBus spi
IPin chipSelect
Ms5611.Resolution resolution

Methods

ReadPressure()

Declaration
public int ReadPressure()

Returns

Type Description
System.Int32

ReadTemperature()

Declaration
public int ReadTemperature()

Returns

Type Description
System.Int32

Reset()

Declaration
public void Reset()