# MS5837 for measuring the draft of the boat?

Greetings! I have several boats with autopilot. One of them is like in the picture, quite large. I use one for transportation.

I have MS5837-30BA sensors (Bluerobotics Bar30 is made on its basis, only much cheaper). With a couple of these sensors, I measure the draft of the vessel, and monitor the loading of the boat. All this is done separately from the autopilot. I saw that this sensor is supported in ArduSub.

Is it possible to add support in the version for boats (Arduover)?

Sensor https://ali.ski/vG_MR
i2c 5-3v https://ali.ski/N3CqO

2 Likes

Hi @McKey,

It would be relatively easy to enable the barometer, the only potential issue that I see is that the EKF would start trying to use it as well so it would affect the altitude estimate. I suspect that doesnâ€™t matter much.

Can you explain how you measure the draft (how deep in the water the boat is) with one or two of these? I can imagine that with two you could measure the water pressure differenceâ€¦ one would be attached low on the underside of the hull and the other would be floating at the water line?

Hi @rmackay9 ,
I use two sensors. One is located on the bow, and the second on the stern(both on bottom).

From the picture I think it is clear how you can understand how I use. For my model, I made hydrostatic curves that help me to load the boat.

After the sensors are initialized, the atmospheric pressure is taken as zero, after the launch of the boat takes place (it was once, the sensors are powered separately and permanently, everything is easier for small boats). Then the pressure is recalculated from the â€śnew zeroâ€ť and transferred to the depth.

Part of the code for the calculation
// we calculate the absolute pressure readings
atT = mBAR * 0.001019716212978;
cmH2O = mBAR * 1.019744288922;
} else {
// we calculate the value of the relative pressure
atT = (mBAR - deltamBAR) * 0.001019716212978;
cmH2O = (mBAR - deltamBAR) * 1.019744288922;
}

2 Likes

I think your best option for this would be to do it on an arduino then send the draft to ardupilot as a rangefinder, either i2c or mavlink, you could use the up orientation so that its separate from the depth rangefinder that is using the down orientation. you can use lua to send it back to mission planner as rangefinder orientation 24.

I want to use the same sensor in the submarine Iâ€™m building. @rmackay9 , what wold be involved in adding the driver to Rover? Does it have to go in `hwdef.dat`? Does it have to do with `AP_BARO_MS56XX_ENABLED`? I have only one of these sensors.

1 Like

For submarines , this sensor is supported initially.

With the help of these sensors, you can measure the speed relative to the water. I use them.

@McKey, the boat im building is a traditional submarine with a single propeller, a rudder and dive planes. I do not believe ArduSub supports this configuration. I put more details about my build here: Conventional Submarines - ArduRover - #11 by iter

3 Likes

There is really no support of this type. And so of course it would be good to add this sensor / blueRob.

2 Likes

I have been looking to replicate this for a sub to use for depth control, the 5837 would be ideal but itâ€™s expensive so I have ordered some i2c barometric pressure modules that Iâ€™m going to convert into a depth sensor by attaching an external tube then sealing the whole sensor in epoxy. I have ordered a BMP280 module, bmp180 module, ms5611 module and bmp388l module to test.

Iâ€™ve given up on all these sensors because the tube nozzles are constantly clogged. A large tube is inconvenient on my scale. I switched to a different type (I wrote a post, there is a link on Github). But this type is not suitable for underwater vessels.