MPX4250DP Pressure / Depth Sensor

Other than control. (Navigation, Sonar, Ect.)
Post Reply
User avatar
theinlinaung
Posts: 58
Joined: Jun 22nd, 2014, 7:48 am

MPX4250DP Pressure / Depth Sensor

Post by theinlinaung »

I am using MPX4250DP as pressure/ depth sensor in my ROV.
Pressure Sensor Data.PNG
Pressure Sensor Data.PNG (93.04 KiB) Viewed 8265 times
From datasheet.

I don't know the precision (resolution) of the sensor in terms of pressure and depth.
According to the resolution of Arduino UNO ADC (0 - 1024) and scale of sensor output (0 - 5 V) the pressure would be in step of ~0.24 kPa and depth in step of ~2.5 cm.

Are my calculations correct?
Is there any way to increase the resolution of the output?
My ROV will go to maximum depth of 10 m.

In the datasheet, there is a figure for power supply decoupling and output filtering. Is this necessary to implement?
User avatar
ArduROV
Posts: 32
Joined: Oct 17th, 2013, 5:21 am
Location: Germany
Contact:

Re: MPX4250DP Pressure / Depth Sensor

Post by ArduROV »

In my calculations it is 26mm resolution. (not bad!)

In the Datasheet you can see the the sensitivity of 18,8 mV/kPa and the full scale Span of 4705 mV.
As I unterstand the output at zero pressure is 204mV and the max output at 250kPa is 4909mV.
So the sensor span on Arduino starts at 41 and ends at 1005.

Means you can use only 964 steps of the Arduino and this means a resolution of about 26mm.

If you want to increase the resolution of your sensor you can use another reference voltage.
http://arduino.cc/en/Reference/AnalogReference
Maybe the internal 1,1 Volts?
I think this will help you to understand what I mean:
http://tronixstuff.com/2013/12/12/ardui ... -aref-pin/

But I think there is another Problem with your sensor. The sensor is a differential-pressure sensor. This means the sensor compares the pressure between the two connectors. What is your reference pressure? If you use the pressure of your electronic compartment you will never get a good measurement because the pressure will vary due temperature and bending of your hull.

In my ROV I am using a MPX5700AP. It has a span of 700kPa and it compares the pressure with a vacuum. I can measure deepths between 0 and 60m with a resolution of ~75mm.

Maybe you better buy another Sensor to solve your problem. The MPX4200AP seems to be the right one. It has a span of 200 kPa and 100kPa is usable for you because the first 100kPa is from vacuum to normal atmosphere.
With this sensor you have a resolution of about 21mm.

I hope you understand weird english... ;)
User avatar
theinlinaung
Posts: 58
Joined: Jun 22nd, 2014, 7:48 am

Re: MPX4250DP Pressure / Depth Sensor

Post by theinlinaung »

ArduROV wrote:In my calculations it is 26mm resolution. (not bad!)

In the Datasheet you can see the the sensitivity of 18,8 mV/kPa and the full scale Span of 4705 mV.
As I unterstand the output at zero pressure is 204mV and the max output at 250kPa is 4909mV.
So the sensor span on Arduino starts at 41 and ends at 1005.

Means you can use only 964 steps of the Arduino and this means a resolution of about 26mm.

If you want to increase the resolution of your sensor you can use another reference voltage.
http://arduino.cc/en/Reference/AnalogReference
Maybe the internal 1,1 Volts?
I think this will help you to understand what I mean:
http://tronixstuff.com/2013/12/12/ardui ... -aref-pin/

But I think there is another Problem with your sensor. The sensor is a differential-pressure sensor. This means the sensor compares the pressure between the two connectors. What is your reference pressure? If you use the pressure of your electronic compartment you will never get a good measurement because the pressure will vary due temperature and bending of your hull.

In my ROV I am using a MPX5700AP. It has a span of 700kPa and it compares the pressure with a vacuum. I can measure deepths between 0 and 60m with a resolution of ~75mm.

Maybe you better buy another Sensor to solve your problem. The MPX4200AP seems to be the right one. It has a span of 200 kPa and 100kPa is usable for you because the first 100kPa is from vacuum to normal atmosphere.
With this sensor you have a resolution of about 21mm.

I hope you understand weird english... ;)
Thank you for your explanation.
I think I'll stick with 26mm precision.
Yes I am using compartment pressure (1 atm) as reference pressure as I assume there is no bending of the walls according to my calculations and I have a metal sheet on top of the compartment as a heat sink.
User avatar
ArduROV
Posts: 32
Joined: Oct 17th, 2013, 5:21 am
Location: Germany
Contact:

Re: MPX4250DP Pressure / Depth Sensor

Post by ArduROV »

Just a small example for you:

Its a nice and warm day. You close your ROV on the pier. Air temperature is 30°C then you dive to the bottom of a lake and the Water is 10 °C at 10m.
The outside air pressure is lets say 100kPa.
The pressure in the ROV after cooling down:

P2 = (V2*P1*T2)/(V1*T1)

V1 = V2 (volume)
T1 = 303 Kelvin
T2 = 283 Kelvin
P1 = 100kPa
P2 = ?

P2 = (100kPa*283K)/(303K)

P2 = 93,4 kPa

Your ROV reached 10 m but your sensor value is 10,66 m because your reference pressure is wrong. ;)
User avatar
theinlinaung
Posts: 58
Joined: Jun 22nd, 2014, 7:48 am

Re: MPX4250DP Pressure / Depth Sensor

Post by theinlinaung »

ArduROV wrote:Just a small example for you:

Its a nice and warm day. You close your ROV on the pier. Air temperature is 30°C then you dive to the bottom of a lake and the Water is 10 °C at 10m.
The outside air pressure is lets say 100kPa.
The pressure in the ROV after cooling down:

P2 = (V2*P1*T2)/(V1*T1)

V1 = V2 (volume)
T1 = 303 Kelvin
T2 = 283 Kelvin
P1 = 100kPa
P2 = ?

P2 = (100kPa*283K)/(303K)

P2 = 93,4 kPa

Your ROV reached 10 m but your sensor value is 10,66 m because your reference pressure is wrong. ;)
Well, I should've thought of that before I bought the sensor. It's just not budget friendly to buy a new sensor. Can I put some epoxy on the reference pressure port to reduce the effect?
How about the decoupling and filtering circuit? Is it necessary?

Not that important, I think V1 and V2 in the equation are misplaced ;) .
User avatar
bigbadbob
Posts: 272
Joined: Nov 28th, 2011, 10:24 am

Re: MPX4250DP Pressure / Depth Sensor

Post by bigbadbob »

I use an automotive 5 Bar pressure sensor.
It outputs between 0.5 and 4.5v so I null out the 0.5v in code on the surface.
I also use an infra red remote control to zero the depth reading and correct for temperature before diving, if I want good depth accuracy I sit the rov in the water for a while to let the temperature stabilise before zeroing it.
In this climate the temperature doesn't vary much between surface and 100ft down.
Working with underwater vehicles in my day job gives me access to seawater temperature, salinity and water desnity profiles for local waters. :P

heres my arduino depth sensor code-

Code: Select all

//depth sensor
  analogReference(EXTERNAL);// Aref pin is tied to 5v
  depthValue=analogRead(depthpin);//remember to define depthpin in setup.
  if (results.value == 0x9716BE3F)// button code from remote control function. press button to zero depth.
  {
   Offset=depthValue;//Offset is defined in setup with a default value of 120 and updated if remote button pressed.
   OSD.setCursor( 1, 1);//osd is "on screen display".
   OSD.print(Offset);//briefly displays offset value so you know it's done it.
   delay(1000);
   blank(); //refers to a function that clears the osd.
  }
  float depth = (((depthValue-Offset)*(5.0/1024.0))*10.0);// depth in meters using a 5 bar 5v sensor, span 0.5v-4.5v
  OSD.setCursor( 1, 0 );
  if(depth<10) {OSD.print("0");}//print leading zeros.
  if(depth>=0) {
    OSD.print(depth, 1);//to one decimal place. display xx.xm
  OSD.print("m");}
  else OSD.print("0.-");//if depth is nagative display a default, this avoids multiple "m"s appearing on the screen.
Post Reply