1261 字
6 分钟
MS5837 数字压力传感器
2022-09-08
无标签

前言#

需要买热风枪了,这玩意是底部贴片的元件,要不然就自己开个小板做了,赶时间,最后多花了20买了个成品的模块,心疼钱。

MS5837-02BA#

MS5837-02BA 数字压力传感器 是一款凝胶填注、超紧凑的防水型压力和温度传感器模块,针对健身跟踪器、无人机和可穿戴设备等消费类设备进行了优化。

板装式压力传感器类型: 数字压力和高度传感器模块 板装式压力传感器种类: 绝对 压力(mbar): 2000 耐压范围: 10 bar 压力(bar): 2


FEATURES#

  • Ceramic and metal package: 3.3 x 3.3 x 2.75mm
  • High resolution module: 13 cm
  • Supply voltage: 1.5 to 3.6 V
  • Low power: 0.6 µA (standby ≤ 0.1 µA at 25°C)
  • Integrated digital pressure sensor (24 bit ΔΣ ADC)
  • Operating range: 300 to 1,200 mbar, -20 to +85 °C
  • I2C interface
  • No external components (internal oscillator)
  • Water resistant sealing with 1.8 x 0.8mm O-ring
  • Shielded metal lid option

PRESSURE AND TEMPERATURE CALCULATION#

GENERAL#

The MS5837 consists of a piezo-resistive sensor and a sensor interface integrated circuit. The main function of the MS5837 is to convert the uncompensated analogue output voltage from the piezo-resistive pressure sensor to a 24-bit digital value, as well as providing a 24-bit digital value for the temperature of the sensor.

MS5837 可以采集的数据包括了 24-bit 的压力和 24-bit 的温度。

FACTORY CALIBRATION#

Every module is individually factory calibrated at two temperatures and two pressures. As a result, 6 coefficients necessary to compensate for process variations and temperature variations are calculated and stored in the 112-bit PROM of each module. These bits (partitioned into 6 coefficients) must be read by the microcontroller software and used in the program converting D1 and D2 into compensated pressure and temperature values.

压力 D1 和温度 D2 的数据补偿存储在 112-bit 的 PROM 中,在读取数据时需要额外读取并修正 D1 和 D2。

COMMUNICATION INTERFACE#

The MS5837 has been built with I2C serial interface.


PRESSURE AND TEMPERATURE CALCULATION#

Maximum values for calculation results: PMinP_{Min} = 10mbar, PMaxP_{Max} = 2000mbar TMinT_{Min} = -40°C, TMaxT_{Max} = 85°C TREFT_{REF} = 20°C

Read calibration data (factory calibrated) from PROM#

VariableDesription (Equation)Type
C1Pressure sensitivity (SENST1SENS_{T1})unsigned int
C2Pressure offset (OFFT1OFF_{T1})unsigned int
C3Temperature coefficient of pressure sensitivity (TCSTCS)unsigned int
C4Temperature coefficient of pressure offset (TCOTCO)unsigned int
C5Reference temperature (TREFT_{REF})unsigned int
C6Temperature coefficient of temperature (TEMPSENSTEMPSENS)unsigned int

Read digital pressure and temperature data#

VariableDesription (Equation)Type
D1Digital pressure valueunsigned long
D2Digital temperature valueunsigned long

Calculate temperature#

VariableDesription (Equation)Type
dTDifference between actual and reference temperature
dT=D2TREF=D2C528dT = D2 - T_{REF} = D2 - C5 * 2^8
long
TEMPActual temperature
TEMP=20TEMP = 20^{{\circ}}C+dTTEMPSENS=2000+dTC6/223+ dT * TEMPSENS = 2000 + dT * C6 / 2^{23}
long

Calculate temperature compensated pressure#

VariableDesription (Equation)Type
OFFOffset at actual temperature
OFF=OFFT1+TCOdT=C2217+(C4dT)/26OFF = OFF_{T1} + TCO * dT = C2 * 2^{17} + (C4 * dT) / 2^6
long long
SENSSensitivity at actual temperature
SENS=SENST1+TCSdT=C1216+(C3dT)/27SENS = SENS_{T1} + TCS * dT = C1 * 2^{16} + (C3 * dT) / 2^7
long long
PTemperature compensated pressure
P=D1SENSOFF=(D1SENS/221OFF)/215P = D1 * SENS - OFF = (D1 * SENS / 2^{21} - OFF) / 2^{15}
long

SECOND ORDER TEMPERATURE COMPENSATION#

  1. TEMP < 20
    • Low temperature
    • Ti=11dT2/235Ti = 11 \cdot dT^2 / 2^{35}
    • OFFi=31(TEMP2000)2/23OFFi = 31 \cdot (TEMP - 2000)^2 / 2^3
    • SENSi=63(TEMP2000)2/25SENSi = 63 \cdot (TEMP - 2000)^2 / 2^5
  2. Calculate pressure and temperature 2nd order
    • OFF2=OFFOFFiOFF2 = OFF - OFFi
    • SENS2=SENSSENSiSENS2 = SENS - SENSi
    • TEMP2=(TEMPTi)/100TEMP2 = (TEMP - Ti) / 100
    • P2=((D1SENS2/221OFF2)/215)/100P2 = ((D1 * SENS2 / 2^{21} - OFF2) / 2^{15}) / 100

I2C INTERFACE#

COMMANDS#

The MS5837 has only five basic commands:

  1. Reset
  2. Read PROM (112 bit of calibration words)
  3. D1 conversion
  4. D2 conversion
  5. Read ADC result (24 bit pressure / temperature)

Each I2C communication message starts with the start condition and it is ended with the stop condition. The MS5837 address is 1110110x (write: x=0, read: x=1).

Size of each command is 1 byte (8 bits) as described in the table below. After ADC read commands, the device will return 24 bit result and after the PROM read 16 bit results. The address of the PROM is embedded inside of the PROM read command using the a2, a1 and a0 bits.

| Bit number | 0 1 2 3 4 5 6 7 | | Bit name | PROM - CONV - NULL - Typ - Ad2/Os2 - Ad1/Os1 - Ad0/Os0 - Stop |

| Command Name | hex value | | :--- | :---- | :---- | | Reset | 0x1E (0b00011110) | | Convert D1 (OSR=256) | 0x40 (0b01000000) |
| Convert D1 (OSR=512) | 0x42 (0b01000010) | | Convert D1 (OSR=1024) | 0x44 (0b01000100) | | Convert D1 (OSR=2048) | 0x46 (0b01000110) | | Convert D1 (OSR=4096) | 0x48 (0b01001000) | | Convert D1 (OSR=8192) | 0x4A (0b01001010) | | Convert D2 (OSR=256) | 0x50 (0b01010000) | | Convert D2 (OSR=512) | 0x52 (0b01010010) | | Convert D2 (OSR=1024) | 0x54 (0b01010100) | | Convert D2 (OSR=2048) | 0x56 (0b01010110) | | Convert D2 (OSR=4096) | 0x58 (0b01011000)| | Convert D2 (OSR=8192) | 0x5A (01011010) | | ADC Read | 0x00 (0b00000000) |
| PROM Read | 0xA0 to 0xAE (0b1010-Ad2-Ad1-Ad0-0) |

RESET SEQUENCE#

The Reset sequence shall be sent once after power-on to make sure that the calibration PROM gets loaded into the internal register. It can be also used to reset the device PROM from an unknown condition. The reset can be sent at any time. In the event that there is not a successful power on reset this may be caused by the SDA being blocked by the module in the acknowledge state. The only way to get the MS5837 to function is to send several SCLs followed by a reset sequence or to repeat power on reset.

PROM READ SEQUENCE#

The read command for PROM shall be executed once after reset by the user to read the content of the calibration PROM and to calculate the calibration coefficients. There are in total 7 addresses resulting in a total memory of 112 bit. Addresses contain factory data and the setup, calibration coefficients, the serial code and CRC. The command sequence is 8 bits long with a 16 bit result which is clocked with the MSB first. The PROM Read command consists of two parts. First command sets up the system into PROM read mode. The second part gets the data from the system.

CONVERSION SEQUENCE#

The conversion command is used to initiate uncompensated pressure (D1) or uncompensated temperature (D2) conversion. After the conversion, using ADC read command the result is clocked out with the MSB first. If the conversion is not executed before the ADC read command, or the ADC read command is repeated, it will give 0 as the output result. If the ADC read command is sent during conversion the result will be 0, the conversion will not stop and the final result will be wrong. Conversion sequence sent during the already started conversion process will yield incorrect result as well. A conversion can be started by sending the command to MS5837. When command is sent to the system it stays busy until conversion is done. When conversion is finished the data can be accessed by sending a Read command, when an acknowledge is sent from the MS5837, 24 SCL cycles may be sent to receive all result bits. Every 8 bits the system waits for an acknowledge signal.

Version PROM Word 0 programming#

MS5837 数字压力传感器
https://fuwari.vercel.app/posts/嵌入式/其他/ms5837-数字压力传感器/
作者
Asuwee
发布于
2022-09-08
许可协议
CC BY-NC-SA 4.0