MS5803 Class
- 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.
Item Index
Methods
MS5803
-
bus
-
address
-
csPin
MS5803 constructor. The default arguments inititialize I2C operation and the default I2C address.
Parameters:
-
bus
Numberi2c/spi bus to use
-
address
NumberThe address for this device if using I2C. If using SPI, supply -1 for this parameter.
-
csPin
NumberThe 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:
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_TOne 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_TOne 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:
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:
Pressure in mbar