Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Baro: Support MS5837-02BA #27787 #29122

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Shaikimram
Copy link

The changes include differentiation between multiple MS5xxx sensor variants using the PROM Word 0 bits [11:5], enabling automatic initialization and configuration of the correct driver. Additionally, this update includes specific calculations and second-order compensation logic for the MS5837-02BA sensor, making it more viable for shallow water applications.

Key Changes
Differentiation Logic:

Extracted product ID from PROM Word 0 bits [11:5] to identify sensor variants:
MS5837-30BA26: 0b0011010
MS5837-02BA01: 0b0000000
MS5837-02BA21: 0b0010101
New Sensor Type:

Added a new enum type BARO_MS5837_02BA to differentiate MS5837-02BA sensors.
Calculation Logic:

Implemented _calculate_5837_02ba() for MS5837-02BA-specific pressure and temperature calculations, including second-order compensation for temperatures below 20°C.
Driver Initialization:

Updated _init() to automatically detect and initialize the appropriate sensor type using PROM data.
Added automatic assignment of water pressure type (AP_Baro::BARO_TYPE_WATER) for MS5837 sensors.

@Shaikimram Shaikimram marked this pull request as ready for review January 21, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant