sparkfun / OpenLog_Artemis

The OpenLog Artemis is an open source datalogger the comes preprogrammed to automatically log IMU, GPS, serial data, and various pressure, humidity, and distance sensors. All without writing a single line of code!
https://www.sparkfun.com/products/15846
Other
88 stars 47 forks source link

Feature Request: Support MS5803 pressure sensor #138

Closed ryanneve closed 8 months ago

ryanneve commented 2 years ago

We've been using the MS5837 pressure sensor but have noticed large discrepancies between sensors. We would like to give the MS5803 a try. Sparkfun has library for the MS5803, but unfortunately it only supports the _14 variant which we won't be using. There is a fork which does support all range variants. I wrote my own library for this sensor years ago, but it's probably not the best choice.

What's the best way to get this added? I may be able to push the change. If so, should I add the NorthernWidget fork, or push changes to the SparkFun MS5803 library so that all variants are supported?

PaulZC commented 2 years ago

Hi Ryan (@ryanneve ),

This is a problem of two halves... The first half is adding or updating a library to support the various different models of MS5803. The second half is modifying the OLA firmware so it can disambiguate the MS5803 from the MS5837, MS5637 and MS8607 - all of which use the same I2C address...

On the MS5837, we managed to do this by reading the PROM memory at address 0xA0.

It may be possible to use the same trick on the MS5803, but the datasheets don't seem to specify what 0xA0 contains...

If the MS5803 detects as an MS5637 - and I suspect it might - then it might be possible to use the OLA code as-is and then reverse-engineer the correct pressure from whatever gets recorded. Ah... The MS5637 defaults to an OSR of 8192 and it looks like the MS5803 only goes as high as 4096... That's another complication.

If you want to have a go at this and send us a Pull Request or two, please do. I regret I won't be able to spend any time on this for the foreseeable future.

Best wishes, Paul

PaulZC commented 8 months ago

Closing... Sorry! It's just not practical to add the MS5803 when it is so similar to the MS5837, MS5637 and MS8607.

Best wishes, Paul