Depth Sensor Error Bar30

Hello everyone,

I am using Bar 30 sensor. And it connected pixhawk by i2c. Sometimes qgc gives depth sensor error, and depth value increases suddenly 1 to 30 in a moment. I see this issue also here someone solve this problem by ferrit core. I am thinking, chaning i2c speed solve the problem? I checked last version ardusub firmware from github.

Here i found i2c works 100kHz.

#ifndef HAL_I2C_MAX_CLOCK
#define HAL_I2C_MAX_CLOCK 100000
#endif

And here cube orange supports 400 kHz.

#elif defined(STM32H7)
if (businfo[i].busclock <= 100000) {
  bus.i2ccfg.timingr = HAL_I2C_H7_100_TIMINGR;
  bus.busclock = 100000;
} else {
  bus.i2ccfg.timingr = HAL_I2C_H7_400_TIMINGR;
  bus.i2ccfg.timingr = HAL_I2C_H7_400_TIMINGR;
  bus.busclock = 400000;
}

Should i change these variables? Or ferrit core is the best solution?

Hi @omer_1 -

Have you modified the Bar30, like extending the wires? If so, this is the likely cause, and reducing the length or installing a ferrite core can certainly help.

Increasing the I2C bus frequency would likely make the problem worse, not better!

1 Like

Hi @omer_1,

There is some possibility you’re running into this issue (where the errors are actually false positives), which you should be able to confirm from your autopilot logs.

If that’s the case you can try the proposed fix, which will likely get merged in today, and should be available in a Dev release within a few days :slight_smile:

2 Likes