# Pressure sensor for depth control of underwater vehicle

Hi,
Can anyone suggest me a pressure sensor for depth control of AUV for a maximum of 4-meter depth? The type of pressure sensor will be gauge/absolute, ratiometric?
Moreover, I have already purchased a pressure sensor (Honeywell PX2EF1XX050PAAAX) for the same depth but it is showing a constant value 0f 1.633 V and is not changing when I blow high pressure in its tip.

Best regards

The pressure sensor you have will work well (but the 015P would be better), if you can figure out how to use it. Consult the data sheet.

It seems you have the ratiometric version (AA) that outputs 10% of VCC at zero pressure and 90% of VCC at full pressure (is ~80% of the A/D range of 1024).
So you SHOULD have 0.5volt at the output of the sensor without pressure, when powered with 5volt.
Span of this 50psi sensor is ~34.5meter of water.
That, with the Arduino A/D will give you a low resolution of 820/34.5 = ~25cm per A/D value.
Leo..

Dear Leo
Thank you for your reply. I am getting errors due to that ratiometric sensor. So, In order to increase the resolution of the sensor and for the sake of simplicity, what type of sensor will you recommend for measurement of the maximum of 4 to 5 meters depth of water? gauge/absolute type of pressure sensor? right now, the voltage reading is not increasing even when I apply high pressure as well.
Best regards

As said, you should get about 0.5volt without pressure.
Maybe you have connected it wrong.
Post a picture of the setup.

Gauge is what you need. Starts from atmospheric pressure.
Absolute starts from vacuum.

Ratiometric is good. 0-50psi (0-34.5meters depth) is not so good if you only go 5meters deep.
As said, it spreads the ~820 available steps from the Aduino A/D across 34.5meters.
A 0-10psi sensor would spread those 820 steps across ~7meters.
Leo..

The OP does have the absolute version (the first A in the AAA), so 14.7 psia should result in 1.676 v output.

OP - what is "high pressure" and how are you applying it?

DaveEvans:
The OP does have the absolute version (the first A in the AAA), so 14.7 psia should result in 1.676 v output.

Ahhh, tried to make sense of the codes, but obviously failed.

So even fewer A/D values to play with.
Leo..

You can use the gauge you have and extend the resolution of the ADC by oversampling and averaging many samples.

For example, to get 12 bits of resolution, sum up 64 samples and divide by the sum by 16 (instead of 64).

That will give you 4096 effective ADC steps over the full scale range 0-5V.

For an absolute pressure change of 15 to 30 psi underwater (0 to about 10 m depth), that corresponds to a change of about 1.7V or 480 effective ADC steps, leading to depth resolution of about 2 cm.

The method relies on random noise in the sensor output, but I've been doing this for years with Omega pressure gauges and it works very well.

+1 for the oversampling/averaging, but I don't see why the intermediate step to 12-bit is needed.
I always go directly from 64samples (16-bit) to pressure, with offset and one multiplication factor.
Leo..

I always go directly from 64samples

I throw away the bottom 4 bits of the sum, because in my case they are just noise.

I throw the decimal places that contain the noise away after calulating with the big numbers.
I don't think it's any better, but for me it's more locigal.

How many decimal places also depends on what I want to display.
Sometimes I accept a jumping last digit.
Leo..

Amtel's AVR121 app note:

• Normal averaging (e.g., sum 64 samples and divide by 64) will minimize the consequences of random noise,

• ‘Oversampling and decimation’ (sum 4^n samples and right-shift by n) will utilize noise to enhance the resolution

Where n = the desired number of extra bits of resolution...subject to some limitations (see Amtel's note or the link in post #7)

But, if the OP can't get the sensor to give anything other than 1.633 volts.......

Wawa:
As said, you should get about 0.5volt without pressure.
Maybe you have connected it wrong.
Post a picture of the setup.

Gauge is what you need. Starts from atmospheric pressure.
Absolute starts from vacuum.

Ratiometric is good. 0-50psi (0-34.5meters depth) is not so good if you only go 5meters deep.
As said, it spreads the ~820 available steps from the Aduino A/D across 34.5meters.
A 0-10psi sensor would spread those 820 steps across ~7meters.
Leo..

Thank you all, the pressure sensor is working now but with some proportional error. i.e after each meter depth, the error is increasing. for example. at zero depth the reading is 0.05 m after converting the voltage to depth in the meter. at 1 meter depth, the Arduino shows 0.75 m. At 2 meters depth, the arduino shows 1.6 m at 3 meters depth , the arduino shows 2.40 meters

Are the voltages (measured with your DMM) correct? If so, then your code, which you haven’t shown us, is probably at fault. If you do decide to post your code, please put it between code tags (see the little </> button?)

The maths line that converts the returned A/D value into depth should have two variables.
An offset variable (zero depth) and a span variable (max depth).
You must calibrate those two experimentally, to compensate for sensor and Arduino errors.
Leo..

Good tutorial on sensor calibration: Why Calibrate? | Calibrating Sensors | Adafruit Learning System.