pyupm_ms5803 module

class pyupm_ms5803.MS5803(bus, address=118, csPin=-1)[source]

Bases: object

UPM API for the MS5803 Pressure and Temperature sensor.

ID: ms5803

Name: I2C Barometric Pressure and Temperature Sensor

Category: temperature pressure

Manufacturer: sparkfun

Connection: i2c spi

Link:https://www.sparkfun.com/products/12909 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.

C++ includes: ms5803.hpp

getPressure()[source]

float getPressure()

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

Pressure in mbar

getTemperature()[source]

float getTemperature()

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

Temperature in degrees C

reset()[source]

void reset()

Reset the device.

setPressureOSR(osr)[source]

void setPressureOSR(MS5803_OSR_T 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

osr: One of the MS5803_OSR_T values.

setTemperatureOSR(osr)[source]

void setTemperatureOSR(MS5803_OSR_T 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

osr: One of the MS5803_OSR_T values.

update()[source]

void 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().