UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

MS5803 Class

Module: ms5803

The MS5803-14BA is a new generation of high resolution pressure sensors with SPI and I2C bus interface. It is optimized for depth measurement systems with a water depth resolution of 1cm and below. The sensor module includes a high linear pressure sensor and an ultra low power 24 bit delta-sigma ADC with internal factory calibrated coefficients. It provides a precise digital 24 bit pressure and temperature value and different operation modes that allow the user to optimize for conversion speed and current consumption. A high resolution temperature output allows the implementation of a depth measurement systems and thermometer function without any additional sensor.
The device is driven at 3.3vdc, and has a pressure range of between 0 and 14 Bar, and a temperature range of between -40 and +85C.

Methods

MS5803

(
  • bus
  • address
  • csPin
)
Number

MS5803 constructor. The default arguments inititialize I2C operation and the default I2C address.

Parameters:

  • bus Number

    i2c/spi bus to use

  • address Number

    The address for this device if using I2C. If using SPI, supply -1 for this parameter.

  • csPin Number

    The GPIO pin to use for Chip Select (CS). This is only needed for SPI, and only if your SPI implementation requires it. Otherwise, just pass -1 if not using SPI, or your CS is handled automatically by your SPI implementation.

Returns:

Number:

reset

()

Reset the device.

update

()

Take a measurement and store the current sensor values internally. This function must be called prior to retrieving any sensor values, for example getTemperature() .

setTemperatureOSR

(
  • osr
)

Set the output sampling resolution of the temperature measurement. Higher values provide a more precise value. In addition, more precise values require more time to measure. The default set at device intialization is the highest precision supported: MS5803_OSR_4096

Parameters:

  • osr MS5803_OSR_T

    One of the MS5803_OSR_T values.

setPressureOSR

(
  • osr
)

Set the output sampling resolution of the pressure measurement. Higher values provide a more precise value. In addition, more precise values require more time to measure. The default set at device intialization is the highest precision supported: MS5803_OSR_4096

Parameters:

  • osr MS5803_OSR_T

    One of the MS5803_OSR_T values.

getTemperature

() Number

Return the latest measured temperature. update() must have been called prior to calling this function. The returned value is in degrees Celsius.

Returns:

Number:

Temperature in degrees C

getPressure

() Number

Return the latest measured pressure. update() must have been called prior to calling this function. The returned value is in millibars.

Returns:

Number:

Pressure in mbar