# MS5837 30 bar (sensor depth)

I have tried the pressure sensor MS5837 30 bar to measure the depth. I want to know if I’m going to read the actual depth of the water level. Can I use the function sensor.depth? I wrote a program using python when I run the program when the sensor is not in water reads a depth of -0.37 m. if I put it in water at a depth of 0.2 m. the sensor reads. The value is -0.14 m. Do I need to differentiate between -0.37 and -0.14 to get the true depth? It’s like having to remove the air pressure first to get the true depth. Am I right? Thanks in advance to anyone who advises me. I’m not very fluent in English. I’m sorry if there are any mistakes

Hi @kanisorn, welcome to the forum

The Bar30 is a pressure sensor - it doesn’t know when it’s wet. Since air pressure is variable, the pressure at the water’s surface needs to be used as an offset in order to get accurate depth measurements (so yes, your interpretation is correct).

Also note that accurate conversion from pressure to depth requires an accurate scaling factor, which can be set by specifying the fluid density. As an example, if you’re using/assuming fresh water density while measuring in salt water then the depth estimate will be less accurate.

Thank you @EliotBR

1 Like

@EliotBR
One more question, when I run MS5837 30 bar, the initial value is -0.2 m, and it increases until it starts to stall at -0.37 m, taking about 2 minutes. I want to know if this is normal? If it’s normal I would like to know if there is a way to make it faster in a steady-state, I would like some advice. thanks in advance

I can’t find anything about sensor steady-state timing on the datasheet, so I’ve asked internally whether this is expected.

My guess would be that the drift you’re seeing before stabilisation is likely related to temperature stabilisation, or water permeating the sensor’s gel filling. To test that, if you move the sensor to a different depth once it has stabilised initially, does it then take just as long to stabilise again, or does it change quickly and maintain the changed result?