Embeddronics

Back to blog

Sensor Telemetry

Calibrating MS5837 Depth Sensor

Technical reference from the Embeddronics engineering team.

The TE Connectivity MS5837-30BA is a high-resolution pressure and temperature sensor designed for underwater depth measurements down to 300 meters. With a resolution equivalent to 0.2 cm of water, it is widely used in Remotely Operated Vehicles (ROVs), subsea telemetry nodes, and dive computers.

I2C Data Transactions and Factory Coefficients

The MS5837 sensor does not output pre-calibrated pressure or temperature values. Instead, it contains an internal PROM containing 6 factory calibration coefficients (C1 to C6). During startup, these coefficients must be read via I2C. During operation, you read the raw digital pressure (D1) and raw digital temperature (D2) values:

// Read PROM Coefficients
uint16_t C[8];
for (uint8_t i = 0; i < 7; i++) {
    I2C_Write(0x76, 0xA0 + (i * 2)); // Send PROM Read command
    C[i] = I2C_Read_Word(0x76);
}

Fluid Density and Temperature Compensation

To convert compensated pressure (P, in millibars) into actual depth (D, in meters), you must compensate for the density of the fluid (freshwater vs. saltwater) and gravity:

Depth (m) = (Compensated_Pressure - Atmospheric_Pressure) / (Fluid_Density * Gravity)

  • Freshwater Density: ~997 kg/m³
  • Saltwater Density: ~1029 kg/m³
  • Standard Gravity: 9.80665 m/s²

Open-Source Repository

Download our Arduino library, supporting conversion utilities and examples on GitHub: MS5837_30BA_Library.

Need help with MS5837 depth sensor calibration? Contact our engineering team.

Bring this engineering problem to your product roadmap.

Embeddronics

Production-minded embedded systems engineering for teams building reliable hardware, firmware, connected devices, and manufacturable electronics.

© 2026 Embeddronics Ltd. All rights reserved.

Contact

Islamabad, Pakistan
[email protected]

Start a Scope Review