{"id":47625026,"url":"https://github.com/bluerobotics/ms5837-python","last_synced_at":"2026-04-01T22:43:49.347Z","repository":{"id":46828566,"uuid":"79371648","full_name":"bluerobotics/ms5837-python","owner":"bluerobotics","description":"A python module to interface with MS5837-30BA and MS5837-02BA waterproof pressure and temperature sensors.","archived":false,"fork":false,"pushed_at":"2023-04-12T13:33:18.000Z","size":17,"stargazers_count":26,"open_issues_count":7,"forks_count":35,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-14T23:23:53.131Z","etag":null,"topics":["i2c","pressure","python","rov","sensor","temperature"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluerobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-18T18:42:11.000Z","updated_at":"2024-03-08T23:33:36.000Z","dependencies_parsed_at":"2023-02-02T15:49:28.777Z","dependency_job_id":null,"html_url":"https://github.com/bluerobotics/ms5837-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bluerobotics/ms5837-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluerobotics%2Fms5837-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluerobotics%2Fms5837-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluerobotics%2Fms5837-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluerobotics%2Fms5837-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluerobotics","download_url":"https://codeload.github.com/bluerobotics/ms5837-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluerobotics%2Fms5837-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i2c","pressure","python","rov","sensor","temperature"],"created_at":"2026-04-01T22:43:47.593Z","updated_at":"2026-04-01T22:43:49.335Z","avatar_url":"https://github.com/bluerobotics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ms5837-python\n\nA python module to interface with MS5837-30BA and MS5837-02BA waterproof pressure and temperature sensors. Tested on Raspberry Pi 3 with Raspbian.\n\n# Installation\n\nThe python SMBus library must be installed.\n\n\tsudo apt-get install python-smbus2\n\nDownload this repository by clicking on the download button in this webpage, or using git:\n\n```sh\ngit clone https://github.com/bluerobotics/ms5837-python\n```\n\nIf you would like to try the example, move to the directory where you downloaded the repository, and run `python example.py`. To use the library, copy the `ms5837.py` file to your project/program directory and use this import statement in your program: `import ms5837`.\n\n### Raspberry Pi\n\nIf you are using a Raspberry Pi, the i2c interface must be enabled. Run `sudo raspi-config`, and choose to enable the i2c interface in the `interfacing options`.\n\n# Usage\n\n\timport ms5837\n\nms5837 provides a generic MS5837 class for use with different models\n\n\tMS5837(model=ms5837.MODEL_30BA, bus=1)\n\nThese model-specific classes inherit from MS5837 and don't have any unique members\n\n\tMS5837_30BA(bus=1)\n\tMS5837_02BA(bus=1)\n\nAn MS5837 object can be constructed by specifiying the model and the bus\n\n\tsensor = ms5837.MS5837() # Use defaults (MS5837-30BA device on I2C bus 1)\n\tsensor = ms5837.MS5837(ms5837.MODEL_02BA, 0) # Specify MS5837-02BA device on I2C bus 0\n\nOr by creating a model-specific object\n\n\tsensor = ms5837.MS5837_30BA() # Use default I2C bus (1)\n\tsensor = ms5837.MS5837_30BA(0) # Specify I2C bus 0\n\n### init()\n\nInitialize the sensor. This needs to be called before using any other methods.\n\n    sensor.init()\n\nReturns true if the sensor was successfully initialized, false otherwise.\n\n### read(oversampling=OSR_8192)\n\nRead the sensor and update the pressure and temperature. The sensor will be read with the supplied oversampling setting. Greater oversampling increases resolution, but takes longer and increases current consumption.\n\n    sensor.read(ms5837.OSR_256)\n\nValid arguments are:\n\n    ms5837.OSR_256\n    ms5837.OSR_512\n    ms5837.OSR_1024\n    ms5837.OSR_2048\n    ms5837.OSR_4096\n    ms5837.OSR_8192\n        \nReturns True if read was successful, False otherwise.\n\n### setFluidDensity(density)\n\nSets the density in (kg/m^3) of the fluid for depth measurements. The default fluid density is ms5837.DENISTY_FRESHWATER.\n\n\tsensor.setFluidDensity(1000) # Set fluid density to 1000 kg/m^3\n\tsensor.setFluidDensity(ms5837.DENSITY_SALTWATER) # Use predefined saltwater density\n\nSome convenient constants are:\n\n\tms5837.DENSITY_FRESHWATER = 997\n\tms5837.DENSITY_SALTWATER = 1029\n\n### pressure(conversion=UNITS_mbar)\n\nGet the most recent pressure measurement.\n\n\tsensor.pressure() # Get pressure in default units (millibar)\n\tsensor.pressure(ms5837.UNITS_atm) # Get pressure in atmospheres\n\tsensor.pressure(ms5837.UNITS_kPa) # Get pressure in kilopascal\n\nSome convenient constants are:\n\n\tms5837.UNITS_Pa     = 100.0\n\tms5837.UNITS_hPa    = 1.0\n\tms5837.UNITS_kPa    = 0.1\n\tms5837.UNITS_mbar   = 1.0\n\tms5837.UNITS_bar    = 0.001\n\tms5837.UNITS_atm    = 0.000986923\n\tms5837.UNITS_Torr   = 0.750062\n\tms5837.UNITS_psi    = 0.014503773773022\n\nReturns the most recent pressure in millibar * conversion. Call read() to update.\n\n### temperature(conversion=UNITS_Centigrade)\n\nGet the most recent temperature measurement.\n\n\tsensor.temperature() # Get temperature in default units (Centigrade)\n\tsensor.temperature(ms5837.UNITS_Farenheit) # Get temperature in Farenheit\n\nValid arguments are:\n\n\tms5837.UNITS_Centigrade\n\tms5837.UNITS_Farenheit\n\tms5837.UNITS_Kelvin\n\nReturns the most recent temperature in the requested units, or temperature in degrees Centigrade if invalid units specified. Call read() to update.\n\n### depth()\n\nGet the most recent depth measurement in meters.\n\n\tsensor.depth()\n\nReturns the most recent depth in meters using the fluid density (kg/m^3) configured by setFluidDensity(). Call read() to update.\n\n### altitude()\n\nGet the most recent altitude measurement relative to Mean Sea Level pressure in meters.\n\n\tsensor.altitude()\n\nReturns the most recent altitude in meters relative to MSL pressure using the density of air at MSL. Call read() to update.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluerobotics%2Fms5837-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluerobotics%2Fms5837-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluerobotics%2Fms5837-python/lists"}