Home        Store        Docs        Blog

Bar30 Pressure Sensor, resolution and measurement noise


(Lam Hung NGUYEN) #1

Hi all,

I am working on a project that we would like to modify PX4 open-source code for adapting to AUV control.

I wrote a driver for MS5837-BA30 pressure sensor. This is basically based on the driver (included in PX4) of on-board MS5611 sensor of Pixhawk.

The new driver works. However, values of Pressure [in mBar] is so noisy. For case when the sensor is on the air, with reading frequency of about 18Hz, P max = 1032.5, P min =1030.2. Then one calculates delta P = 2.3 mBar, if underwater should be 2.3 cm of depth change.

I read on the Bluerobotics website that the resoluion is 0.2 mBar.

If there anyone have the same problem of noise when reading data from the pressure sensor, in PX4 opensoure or Ardusub? Is the resolution value right?

Here in the below are value read from screen /dev/ttyUSB0 57600

INFO [raw_pressure] Pressure: 1030.7001 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.1000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1032.2001 Temperature: 27.8100
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.1000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.3000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1033.0000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1030.2001 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1030.3000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1032.3000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1032.1000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.1000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1032.3000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.3000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.1000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.3000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1030.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.3000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1032.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1032.3000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1030.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1030.9000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1031.5000 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1031.7001 Temperature: 27.8300
INFO [raw_pressure] Pressure: 1030.9000 Temperature: 27.8200
INFO [raw_pressure] Pressure: 1032.3000 Temperature: 27.8200


(TCIII) #2

@lamhung81,
Since the pressure sensor is using I2C for communication with the processor, it will be subject to electrical noise in its surrounding environment. I suggest twisting the I2C cable so that there is a full twist every two cm or so to see if that helps.
Regards,
TCIII AVD


(Rusty) #3

Hi Lam,

The sensor does have a resolution of 0.2 mBar, however it’s accuracy is not quite that tight. That means that for a given depth, you can see small changes, but the measurement can move around a bit. You can see the Bar30 documentation for more details on the accuracy.

I think for AUV use you could add a low pass filter or something more sophisticated. For example, in ArduSub, this value is fed into a Kalman filter that estimates depth from the pressure sensor and accelerometers with an appropriate amount of filtering. 18 Hz is really fast for an AUV.

-Rusty