Bar30 Depth sensor problems

Has anyone actually got one of these Bar30 working?
I translated the software for a PIC and read and computed everything that used 32 bit. However the PIC16F series will not handle 64 bit and upgrading to one that does is $400 Cdn for the compiler.
I then tried an Arduino Uno but it seems it will not print a 64 bit number so I don’t know if the calculations work. A search on 64 bit printing said it could not be done (without writing a lot of extra software).
My HP48 calculator says the sensor works, maybe.
The equation for depth:
depth=((P100)-101300)/(9979.80665) needs P in mbar I assume so calculated P should be divided by 10, or the equation should be P*10…etc. Otherwise I calculate the example to be 398m which is outside the range of the sensor. Does anyone get 39.8m depth using the example readings?
On the bench I get a calculation of -0.29m. Does this sound reasonable? I am doing the final (64bit) calculations with an HP calculator.
So if the Arduino code works how does one get it into the Arduino compiler? I see the code that would go into the setup() part, I see the code that would go in the loop() section, and I see the .h file to include, but what am I supposed to do with the .cpp file? It won’t run without these functions. Sorry for being dumb but I am a complete novice at Arduino and I get the impression it won’t run the code any way. Hence my question on the first line.

Yes, we have installed these sensors on hundreds of ROVs. They also work with an Arduino or Rasberry Pi using our example libraries.

To use the sensor with an Arduino, you should install our library using the library manager in Arduino. Then you will just need to #include the library. You will also find an example application to run the sensor in the File menu.

Regarding the calculation and example readings, where are you getting this equation and example readings? That equation looks like it is pressure in pascal, MSL pressure is 101300 Pa.

I copied ‘BlueRobitics_MS5837_Library_Master’ to C:\Program Files(x86)\Arduino\Libraries (despite the ‘Arduino Libraries’ instructions to copy to ‘ARDUINO/hardware/libraries’.
I managed to get two tabs in the Arduion IDE, one MS5837_Example_1 and the other MS5837.h but I doubt if I could repeat the sequence.
I selected Sketch>Include Library>BlueRobotics MS5837 Library.
I cannot fathom how MS5837.cpp gets linked in, there is no include statement to do this.
I was able to compile the program.
Upload was tried a few times and eventually was successful and I get the message that the Init failed (because the sensor is not yet connected). The software appears to be working.
Next I connected the sensor wiring with SDA to A4, SCL to A5, 5v and Gnd to the I2c translator, check for 3.3v on the output 3v3 and SDA and SCL are 3.3v. Re-check wiring, white to SDA (A4). OK.
OK to connect the sensor so turn off and connect it. I get nothing on the serial screen, try reset, nothing. I eventually unplugged USB and restarted the Arduino program then plugged in the USB and selected the monitor. It is now working and I get:

Temperature 22.94 deg C
Depth -0.18 m
Altitude 152.97 m above mean sea level
Pressure 995.00 mbar

This looks to be correct however I am left with a lot of questions:
When I unplug the USB the serial monitor stops working with the error message “Board at COM7 is not available”. There is no way to make this go away and it appears that once the software looses connections with the Arduino it does not reconnect. Is there no reset or auto connect? The Arduino reset does not fix this, I have to re-start the program.
The Arduino programming is a bit flakey. Does anyone else see this behavior?
I went through all 250 pages of “Beginning Arduino Programming” and no where does it explain setting up the library and using it.
I understand the Main Function which often has a loop (While(1)). I understand .h files and function libraries which need to be included. I don’t understand the Arduino program or how to use it.
I assume MS5837.cpp is a group of functions but how is it ‘included’.
How am I supposed to load the 3 programs into the IDE? Step by step please, I am used to programming PICs in MPLAB and have no experience with the Arduino.
How am I supposed to edit the MS5837.cpp if I have to bury it in the Libraries. It does not appear to be available but is obviously being used.
I got the equations from the data sheet and from the Arduino program.

Evidently the IDE does not like to have the USB and Arduino disconnected. The Arduino programs reliably.
I studied the library for the Arduino then tried a new project from scratch. It compiled and programmed the Arduino OK but the results are way off. The depth now shows as -2.58m (ten times too high) and the altitude is 2500 m which is ten times too high. I think there are bad versions of the software on this site and I will have to find the original version that works.
Edit: There was a slight difference in the programs, one does not have the check and warning for switched SDA/SCL but the rest is the same. What I am seeing is different readings each time I turn on. I noticed this before but put it down to my programming. I also noticed drifting over an hour. Today I see pressure is 903mBar but our two barometers show 1035 and 1030 and the weather channel shows 1040. Actually 903 is off scale on the barometers. I don’t think there is anything wrong with the software. I know the specs say absolute accuracy is .5m depth and 1.5 deg temp but I am seeing way worse than this.
Does anyone else have positive experiences with the Bar30 that they can share? I am not getting replies from users.

I replied to the forum but have got no replies.
I am now suspecting the Bar30 is not working properly. It has not been
abused, the 3.3v is stable and was checked before connecting and several
times since.
My PIC program was giving me readings I did not trust so I ran the Arduino
program with the same results.
Every time I turn it on I get readings from believable to unreasonable. Our
altitude is about 600ft, not 3000+, the pressure is 1040 not 903 as the
present readings are showing. The temperature is sometimes off by more than
4 degrees. the depth on the bench varies from +/-0.2 to several meters. At
present -1.11m depth.
The equations came from the Arduino program and checked against the data
sheet and confirmed with a calculator.
Any suggestions? Am I expecting too much? It should be close to the

What are you using for your reference measurements? We would need to know the specification of those instruments as well to make a determination of what the problem is. As long as the uncertainties of both measurements overlap, the sensor is within spec. In order to narrow down the problem, please run our example arduino program while troubleshooting/verifying this issue.

The sensor is designed to measure the pressure of liquids, not atmospheric pressure. The pressure reading will drift around a few mbar which makes a big difference in an atmospheric calculation, but is not very significant in a depth calculation. It does sound like your drift may be outside of the specified ratings, but this number you are reporting depends on the ‘fluid density’ used in the calculation, so again, it will be best to use our default example so that we can know exactly what is going on in your tests.

Our approach on our ROVs is to ‘zero’ the depth at the surface before diving. This will account for variations in atmospheric pressure and any offset in the sensor reading.

If you are convinced that the sensor is at fault, please contact and request a refund or replacement.

Also note that there is a bit of self-heating in the sensor, so the temperature of the sensor may be a bit warmer than ambient temperature especially in air.

I have two aneroid barometers which agree within 5mBar of each other (1032
& 1036) and are close to the local TV weather (1040) which gets its info
from the airforce base.
I have been running a test for a few hours using the Arduino program. I am
allowing for adjustment time. Yes there is self heating and I was curious
about the air density. However I see a steady drift that has been getting
worse every time I power it up. I tried it in an inch of water a week ago
expecting it to eliminate the density factor but it made no difference.
There were no instructions with it and I don’t know where to find them. How
would I zero it? This is the first I have heard of zeroing but it makes
Do I just add a negative offset equal to the initial depth to all depth
Last week the depth was positive then went to -0.23m but now is at -2.5m
in water, -3.1m in air.
Is running in air doing damage? I will put it back in an inch of water to
follow it.

28 Dec 2017

Start a run to see what happens. Room at 22⁰C

Barometer Time Temp⁰C Pressure mBar Depth m Altitude m
1035 11:45 23.67 896 -1.20 1043
Not checked 12:00 23.77 882 -1.34 1154
Not checked 13:00 24.59 855 -1.61 1408
Not checked 13:15 24.74 841 -1.76 1543
1036 13:30 25.01 832 -1.86 1641

Place in 1” water, at 13⁰C after 5 min, lab mercury thermometer (-20 to +110)
13⁰C 1345 18.44 795 -2.23 1999
14⁰C 1353 19.57 787 -2.31 2080
15⁰C 1355 20.1 782 -2.36 2121

Place in 1” water, at 32⁰C after 5 min
32⁰C 14:00 39.01 769 -2.51 2276
31.5⁰C 14:02 38.43 765 -2.55 2318
31⁰C 14:04 37.86 758 -2.61 2381

Remove and allow to come up to room temperature
Barometer Time Temp⁰C Pressure mBar Depth m Altitude m
1035 14:41 29.49 710 -3.10 2899

That drift looks terrible. Are you using the arduino or pic?

The sensor should run indefinitely in air without issue. To ‘zero’, we just take the offset in air, then subtract the offset in software.

Yes, the Arduino.
I assume that I installed the software correctly but had no instructions
and had to do a bit of digging.
My PIC worked right away getting the Cal constants then I had a few
problems with the 64bit math and had to use floating point which worked but
I kept seeing drift and needed a reference to see that my program was
working. I switched to an Arduino but the drift just keeps getting worse.
It has been off for awhile so I will add the last runs and a new one after
several hours rest. It seemed to recover but needs more like days to do so.
Notice the pressure drift has accelerated even though there was no power on
it (or the Arduino) for several hours. Notice the time column and notes on
what was done. The sensor was in about an inch of water the whole time.

Remove and allow to come up to room temperature

Barometer Time Temp⁰C Pressure mBar Depth m Altitude m
1035 14:41 29.49 710 -3.10 2899

Place in 25⁰C water at 14:48.
1035 14:50 30.49 699 -3.22 3022
Water 23⁰C 14:55 30.03 692 -3.27 3101
1035, 21⁰C 15:21 28.86 672 -3.48 3330
1035, 21⁰C 15:30 28.94 658 -3.62 3494
1035, 21⁰C 15:55 29.09 632 -3.90 3818

Unplug Arduino for cold restart

1035, 21⁰C 16:00 29.12 629 -3.92 3843

Unplug Arduino for several hours

1035, 21⁰C 19:25 28.58 601.00 -4.21 4179

The Bar30 and Arduino were unplugged overnight. This morning I turned it on
briefly and as I expected from previous experience it had improved.
If I wait another few days it may even get back to a realistic reading.
Here are the last measurement from yesterday and the one this morning:

Unplug Arduino for several hours

7:25 pm yesterday, Barometer reads 1035 mBar, temperature 28.58 deg C,
pressure 601.00 mBar, depth -4.21 m, altitude 4179 m

8:30 am next day, Barometer reads 1029 mBar, temperature 25.51 deg C,
pressure 736.00 mBar, depth -2.82 m, altitude 2604 m

I will leave it unpowered and report back in a few days.

The sensor uses 3.3V logic, are you using a logic level converter, or connecting it directly to the microcontrollers? If you are connecting it directly to the microcontrollers the sensor may be damaged.

See above 9 Dec, quote:
“Next I connected the sensor wiring with SDA to A4, SCL to A5, 5v and Gnd to the I2c translator, check for 3.3v on the output 3v3 and SDA and SCL are 3.3v. Re-check wiring, white to SDA (A4). OK.
OK to connect the sensor so turn off and connect it.”
Yes, I am very aware of the requirements. I have other expensive 3.3v devices that I have no problems with. The level translator was the first thing I checked when I noticed the drift. The Bar30 has never been powered without the translator.

Ok, sounds like a defective unit. Please contact to receive a replacement at no cost or refund.