Giter Club home page Giter Club logo

Comments (3)

joaoantoniocardoso avatar joaoantoniocardoso commented on June 8, 2024

Hi, I don't have experience with this lib, but I believe the answer you are looking for might be in the code:

// The pressure sensor measures absolute pressure, so it will measure the atmospheric pressure + water pressure
// We subtract the atmospheric pressure to calculate the depth with only the water pressure
// The average atmospheric pressure of 101300 pascal is used for the calcuation, but atmospheric pressure varies
// If the atmospheric pressure is not 101300 at the time of reading, the depth reported will be offset
// In order to calculate the correct depth, the actual atmospheric pressure should be measured once in air, and
// that value should subtracted for subsequent depth calculations.
float MS5837::depth() {
return (pressure(MS5837::Pa)-101300)/(fluidDensity*9.80665);
}

from bluerobotics_ms5837_library.

rafaellehmkuhl avatar rafaellehmkuhl commented on June 8, 2024

For accurate results underwater you should always calibrate your out-of-water pressure before diving.

This is how it's done in Ardupilot, for example.

from bluerobotics_ms5837_library.

ES-Alexander avatar ES-Alexander commented on June 8, 2024

Just to close this out:

  • yes, the altitude+depth estimates are calculated based on the sensor's measured pressure and temperature
  • when using these sensors it's recommended to set the surface/ground pressure as the zero-point, like the 'tare' function on a scale, so that the relative depth/altitude estimates are correct for your operating conditions
  • the 30BA sensor variant can have quite significant absolute error (up to ±200mbar) -> it's not expected to be a highly accurate absolute pressure sensor

from bluerobotics_ms5837_library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.