# BAR30 on Flight Core

Source: https://forum.modalai.com/topic/42/bar30-on-flight-core
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: flight-core
Posted: 2020-11-16 16:07:34 UTC by Andrew Keefe
Replies: 4 · Views: 1448

## Andrew Keefe · 2020-11-16 16:07:34 UTC

Does the Flight Core firmware support the BAR30 pressure sensor?  I plugged one into J13 after changing out the connector, but the sensor didn't register in QGroundControl.  Then it donned on me that ArduSub supports the BAR30, but not the others.  I'm using the Flight Core on a submersible and I will be using the BAR30 for depth.

If this isn't already supported then I will need to manually pull it in from ArduSub I suppose.  I can write my own app to access the I2C bus and publish the information as a node.

## Reply by modaltb (ModalAI staff) · 2020-11-16 16:24:42 UTC

Hi Andrew,

We've not tried using this sensor, but getting I2C drivers up and going is pretty easy normally.  I found this in the Nuttx code base that might help:

  https://github.com/PX4/NuttX/blob/904a602c74dc08a100b5c2bd490807de19e73e10/drivers/sensors/ms58xx.c

You'd need to enable the driver to build in here:
  https://github.com/PX4/PX4-Autopilot/blob/master/boards/modalai/fc-v1/default.cmake#L17

And to run on startup here:
  https://github.com/PX4/PX4-Autopilot/blob/master/boards/modalai/fc-v1/init/rc.board_sensors

## Reply by Andrew Keefe · 2020-11-19 21:50:38 UTC

It looks like ArduSub modified the ms5611 driver to accommodate the ms5837 and calls the driver AP_Baro_MS5611.  The init() has a switch case on _ms56xx_type and includes a "BARO_MS5837" case.

https://github.com/ArduPilot/ardupilot/blob/ArduSub-4.0.0/libraries/AP_Baro/AP_Baro_MS5611.cpp

It also includes a function for calculating the temperature and compensated pressure for the 5837.

The Flight Core firmware incudes a different version of the MS5611 driver that doesn't support the ms5837.  This would be a good update to pull in.

## Reply by modaltb (ModalAI staff) · 2020-11-20 18:34:45 UTC

If it's a good addition, and you're up for it, I'd suggest going for it and adding the driver to the 'standard' PX4 code base!  If it's in the master branch we could pull it in pretty easily.
Thanks!

## Reply by ryan_meagher · 2021-05-26 18:40:46 UTC

I know this is kinda an old post but I have created a driver for px4 that can use both flavors of the MS5837 the bar2 and bar30. I will create a pull request with px4 so it will be available.
