# Bar30 Pressure Sensor and I2C Troubleshooting

**URL:** <https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361>\
**Category:** Build/Make\
**Created:** [August 6, 2017, 3:01pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361 "2017-08-06T15:01:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 6, 2017, 3:01pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/1 "2017-08-06T15:01:24Z")

</div>

I am a high school teacher in Denver, and I am hoping that the two ROVs which I am building will be a major part of my Robotics course this year.

I am having perhaps a simple issue connecting the Bar30 Pressure sensor through to QGroundControl.

I snipped the Molex connector on the Bar30 Pressure Sensor and replaced it with a JST connector suitable for the I2C 2 connector on my PixHawk 2.1 (pictured)

The PixHawk is connected through a Raspberry Pi (image supplied by BlueRobotics) to QGroundControl. QGroundControl correctly readis Pixhawk compass direction, Pixhawk level, etc. data from the PixHawk (pictured). I verified that the GND\_EXT\_BUS parameter has been set correctly to “Bus1.”

The Accelerometer and Compass calibrated on QGroundControl without incident. When I attempt to “Calibrate Pressure” (i.e., the Bar 30 Pressure), however, I get the following message: “Calibration command failed.” I also do not get any temperature reading. QGroundControl is also reporting the following “Vehicle Health” warning “Absolute pressure.”

Is there any way I can troubleshoot the I2C connection to determine if the issue is related to QGroundControl, the Bar 30 Pressure Sensor, my JST rewiring, Mavproxy, etc.?

Thanks…

 ![IMG_8406](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/d/d8f82150917ef8f213ff2c48618739b22e301dd6.JPG)

 ![IMG_4063](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/6/6b0974203e6e9cad57f9f779417c8a7b64581ed0.JPG)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 6, 2017, 3:57pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/2 "2017-08-06T15:57:04Z")

</div>

For Pixhawk 2 set gnd\_ext\_bus to 2/second bus and reboot. Let me know if that works.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 6, 2017, 5:39pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/3 "2017-08-06T17:39:59Z")

</div>

Thank you for your reply.

On QGroundControl’s GND\_EXT\_BUS, there are three options: 1) Disabled, 2) Bus 0, and 3) Bus 1. Previously, I had the parameter set to Bus 1. There was not an option for Bus 2, so I manually entered a 2, as you suggested.

Unfortunately, this did not change the sensor calibration response.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 6, 2017, 6:02pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/4 "2017-08-06T18:02:57Z")

</div>

I also tried all nine combinations of GND\_EXT\_BUS (Disabled, Bus0, and Bus1) and GND\_PRIMARY (FirstBaro, 2ndBaro, and 3Baro) resets, again, without success.

 ![IMG_4062](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/3235694d9e4135f3522bdf4d8b4b092192b02b38.JPG)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 10, 2017, 5:23pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/5 "2017-08-10T17:23:02Z")

</div>

Hi @gallopsean, I am away from my pixhawk2 till monday, then I will have another go. Can you verify that you have ArduSub firmware on your pixhawk, and not ArduCopter or ArduPilot? You should see an ‘ArduSub’ logo in the upper right of the QGC window when it is connected to an ArduSub vehicle.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 10, 2017, 8:11pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/6 "2017-08-10T20:11:59Z")

</div>

Hi Jacob, thank you for your reply. I do indeed have ArduSub running on the PixHawk 2.1, and the ArduSub logo is indeed in the upper right hand corner of my QGC (see previous photo).

Re previous post: [Read data of Depth/Pressure Sensor - #4 by tciii](http://discuss.bluerobotics.com/t/read-data-of-depth-pressure-sensor/436/4)

I verified using the QGC Inspector widget that the SCALED\_PRESSUR2 and SCALED\_PRESSUR items contain values, and those values appear to update about once a second. The odd thing is that both items contain the same set of values, and both items report values whether I have the PixHawk I2C connector attached or not.

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 10, 2017, 8:52pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/7 "2017-08-10T20:52:47Z")

</div>

In the Summary tab of the Vehicle Setup page, can you look in the Frame section and tell me what version number it says? Can you tell if the number in scaled\_pressure2 field changes when you push your thumb on the pressure sensor opening? And last thing, can you save and post a list of parameters by clicking Tools on the parameter page?

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 10, 2017, 10:55pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/8 "2017-08-10T22:55:48Z")

</div>

Thanks for the reply Jacob.

Frame version: SimpleROV-3

My scaled\_pressure2 field appears to have disappeared, and I am struggling to reestablish it.

Here’s my list of parameters as requested.

[parameters.params](https://discuss.bluerobotics.com/uploads/short-url/185tLavmH5Gai2R0JnZRQm8zFbr.params) (19.5 KB)

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 10, 2017, 11:29pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/9 "2017-08-10T23:29:28Z")

</div>

Scaled\_pressure2 field is back…it reads on top 0Hz #137  
The four values contained inside of Scales\_pressure2 are not changing and do not respond to placing my finger over the 30 BAR pressure sensor.

The following two parameters are now set:  
GND\_EXT\_BUS: Bus1  
GND\_PRIMARY: FirstBaro

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 11, 2017, 12:00am UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/10 "2017-08-11T00:00:57Z")

</div>

I mean the firmware version listed on the summary page. It should say 3.5.0.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 11, 2017, 5:49am UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/11 "2017-08-11T05:49:03Z")

</div>

That is what it says…3.5.0

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 12, 2017, 4:02am UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/12 "2017-08-12T04:02:24Z")

</div>

Ok Sean, I’m sorry I can’t find out for sure what the settings should be until Monday, but I think it should work on Bus0. The selection of the GND\_PRIMARY does not matter here, it will be auto-selected at boot depending on whether or not the external sensor has been detected with a successful communication/initialization sequence.

If you are seeing the scaled\_pressure2 message, but it is not updating, that sounds like it has seen the sensor at least once, and the sensor has subsequently malfunctioned. Did you solder the spliced wires or just twist them together? I am beginning to suspect those connections.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 13, 2017, 1:31pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/13 "2017-08-13T13:31:49Z")

</div>

Great Jacob, thanks for the reply. I had a few issues with the PixHawk, but they now appear to be mostly resolved.

With regard to scaled pressure2, I am getting a reading and it updates regularly. I don’t know if it matters, but (see attached photo), scaled\_pressure and scaled\_pressure2 are showing the same reading and they update in lockstep. With regard to calibration, I continue to get an “Absolute pressure” Vehicle Health warning, and the “Calibrate Pressure” mechanism fails.

 ![38 AM](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/e/e0efdfefb2fa51acc38228fa1b8abe801b85bde8.png)

With regard to the spliced wires on the Bar30 Pressure Sensor, I soldered them. It was difficult however to discern the pinout connections for the green and white wires into the PixHawk 2.1 JST connector. I was careful, and I think that I soldered and aligned the wires correctly.

Thanks again for your assistance.

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 13, 2017, 2:16pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/14 "2017-08-13T14:16:12Z")

</div>

Ok, it looks like it’s working correctly. The pressure sensors are both reading the same air pressure (slightly different), and different temperatures.

Re the pressure warning, not sure what’s up here. Is it always there or intermittent? Is it present immediately after booting the rov or does it show up some time after?

What is your depth reading? Calibration will fail if it’s armed or if it thinks it’s deeper than 1m.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 13, 2017, 3:37pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/15 "2017-08-13T15:37:37Z")

</div>

Absolute pressure warning is constant; it never goes away. Also, the warning is present immediately after booting (see first photo attached)

Thank you for the quick reply and the info on the Calibration. My depth is +4 feet (see second photo attached), and the pressure calibration still fails (see third photo also attached).

Separately, can you tell me why the Temperature (see second photograph) is reading so high? I am assembling the ROV in my living room, and the ambient temperature is no higher than 22 degrees celsius. I have not adjusted the parameters, GND\_SPEC\_GRAV and GND\_TEMP beyond their default settings. Perhaps, I have should have done so?

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/5/5d483a9daa991efbe06e5f06097f5faea57ed4af.jpg)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/6/6dcc24833d6bbd6ba486aa2c9d45704b0e413d30.jpg)

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/f/f3b68824a7ade3b929134f4c9979e1520f0214cd.png)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 13, 2017, 8:21pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/16 "2017-08-13T20:21:12Z")

</div>

Hi, just got a chance to play with it, and it turns out the Bar30 will show up under SCALED\_PRESSURE3. This is because there are two on-board barometers on the Pixhawk2. This is also why the temperatures are reading so high, because they are inside the electronics housing which gets pretty warm.

The only change that needs to be made from defaults is to change GND\_EXT\_BUS to 0. Because you are having failure calibrating the sensor and with the health warning, this indicates that the pixhawk is unable to read the pressure sensor.

Do you see a SCALED\_PRESSURE3 message?

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 13, 2017, 9:37pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/17 "2017-08-13T21:37:39Z")

</div>

Jacob…thank you so much for your assistance!

With GND\_EXT\_BUS set to 0, the SCALED\_PRESSURE3 value appears (second photo attached). Likewise, I was finally able to calibrate the Bar30 Pressure Sensor without further incident (first photo attached).

I would not have been able to figure this issue out without your help.

PS: One last question, what is the effective length of Cat 5 cable that one can use into the Raspberry Pi without losing video. At 100feet, I get a connect signal, but no video. At 10 feet, I get a connect signal and plenty of video. I’m guessing, the right number is somewhere around 50 feet.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/7/7e5ebfdc03e71de80ce91a2c8132f312043d14e3.png) ![23 PM](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/39831d051ab10ba7b91157ee70eb87f891373014.png)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 14, 2017, 1:54pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/18 "2017-08-14T13:54:31Z")

</div>

I think cat5 is rated to 100 meters, and I think you should be able to get video through at least 50’, but I’m not sure. There is a tool called iperf3 that you can use to test the network connection bandwidth and latency.

---

<div class="post-metadata">

**Author:** ![gallopsean](https://avatars.discourse-cdn.com/v4/letter/g/53a042/32.png) [@gallopsean](https://discuss.bluerobotics.com/u/gallopsean)\
**Post date:** [August 14, 2017, 2:20pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/19 "2017-08-14T14:20:22Z")

</div>

Thank you Jacob…School starts this week. Some subset of my Robotics students will have to figure out how to build a socially impactful robot which operates in marine environments. They will probably come up with their own design, but given that I have been through the process once, I will be in a position to talk them through the tricky bits (e.g., connecting a Bar 30 Pressure Sensor, booting ArduSub on a PixHawk 2.1, booting MaxProxy, etc.)

I enclose three photos of my current design:

 ![IMG_4074](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/c/c2373ece3199e3e26280a0989b1eb796bb7c2672.JPG)

 ![IMG_4075](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/3/34a0d340bdbdb7ddf6beb93fc05f2205956a3dbe.JPG)

 ![IMG_4076](https://us1.discourse-cdn.com/flex019/uploads/bluerobotics/original/2X/0/0fd6067ef5cbe96472fd5f4056342211c89dee27.JPG)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 14, 2017, 2:28pm UTC](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361/20 "2017-08-14T14:28:37Z")

</div>

Very good. I would love to see some updates on the progress and feedback on the process. I’ve already made some notes to add better support for pixhawk 2.1.

[Next page](https://discuss.bluerobotics.com/t/bar30-pressure-sensor-and-i2c-troubleshooting/1361.md?page=2)
