{"id":21590940,"url":"https://github.com/spaceteam/sts1_sensor_libraries","last_synced_at":"2025-05-05T17:38:43.815Z","repository":{"id":204934337,"uuid":"576939576","full_name":"SpaceTeam/STS1_sensor_libraries","owner":"SpaceTeam","description":"Sensors for the STS1 project.","archived":false,"fork":false,"pushed_at":"2025-03-08T14:23:58.000Z","size":1325,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T22:41:31.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://spaceteam.github.io/STS1_sensor_libraries/","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/SpaceTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-11T13:36:55.000Z","updated_at":"2025-03-08T14:12:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"d32f265e-69e6-4606-8d04-9aa5de68177a","html_url":"https://github.com/SpaceTeam/STS1_sensor_libraries","commit_stats":null,"previous_names":["spaceteam/sts1_sensor_libraries"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2FSTS1_sensor_libraries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2FSTS1_sensor_libraries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2FSTS1_sensor_libraries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpaceTeam%2FSTS1_sensor_libraries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpaceTeam","download_url":"https://codeload.github.com/SpaceTeam/STS1_sensor_libraries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252543929,"owners_count":21765246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-24T16:21:12.579Z","updated_at":"2025-05-05T17:38:43.809Z","avatar_url":"https://github.com/SpaceTeam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Docs](https://spaceteam.github.io/STS1_sensor_libraries/) | [Github](https://github.com/SpaceTeam/STS1_sensor_libraries) | [PyPI](https://pypi.org/project/sts1-sensors/)\n\n# sts1-sensors\n\nStreamline the process of handling sensors for the STS1 project.\n\nThe following sensors are available both on the satellite and **on the EDU module**:\n* [`ADXL345`](https://www.analog.com/en/products/adxl345.html) - Digital accelerometer.\n* [`BME688`](https://www.bosch-sensortec.com/products/environmental-sensors/gas-sensors/bme688/) - Pressure, humidity, temperature and gas sensor.\n* [`BMM150`](https://www.bosch-sensortec.com/products/motion-sensors/magnetometers/bmm150/) - Geomagnetic sensor.\n* [`L3GD20H`](https://www.pololu.com/file/0J731/L3GD20H.pdf) - Three-axis gyroscope.\n* [`TMP112`](https://www.ti.com/product/TMP112) - High-accuracy temperature sensor.\n\nThe following sensors are available **on the satellite only**:\n* [`GUVA_C32`](https://www.digikey.de/de/products/detail/genicom-co-ltd/GUVA-C32SM/9960949) - Ultraviolet light sensor.\n\n## Quickstart\n\n```python\nfrom sts1_sensors import ADXL345, BME688, BMM150, L3GD20H, TMP112\n\n# Accelerometer\naccel = ADXL345()\nx, y, z = accel.get_acceleration()\nprint(f\"{x=:.2f} g, {y=:.2f} g, {z=:.2f} g\")\n\n# Temperature, pressure, humidity and gas sensor\nmulti = BME688(enable_gas_measurements=True)\nt = multi.get_temperature()\np = multi.get_pressure()\nh = multi.get_humidity()\nheat = multi.get_heat_stable()\nres = multi.get_gas_resistance()\nprint(f\"{t:.2f} °C, {p:.2f} hPa, {h:.2f} %RH, {heat=}, {res:.2f} Ohms\")\n\n# Geomagnetic sensor\nmag = BMM150()\nx, y, z = mag.get_magnetic_data()\nprint(f\"{x=:.2f} µT, {y=:.2f} µT, {z=:.2f} µT\")\nprint(f\"Heading: {mag.get_heading():.2f}°\")\n\n# Gyroscope\ngyro = L3GD20H()\nx, y, z = gyro.get_angular_momentum()\nprint(f\"{x=:.2f} dps, {y=:.2f} dps, {z=:.2f} dps\")\n\n# Temperature sensor\ntemp = TMP112()\nprint(f\"{temp.get_temperature():.2f} °C\")\n```\nMore examples, see examples folder.\n\n## Installation\n\n### Initial Setup on the Raspberry Pi\n\n* Open a terminal on the Raspberry Pi (e.g. via SSH).\n* [Activate the I2C interface](https://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/): `sudo raspi-config`\n* Reboot `sudo reboot now` then reconnect.\n* Run `sudo apt-get install i2c-tools`\n* Run `ls /dev/i2c*`. Note the last number that apprears. E.g. for `/dev/i2c-1` this would be `1`.\n* Run `i2cdetect -y 1`. You may change that last number according to what you saw in the previous step.\n* If you see a grid of dashes `--` with some numbers, this means some sensors were recognized and you are good to go. For example:\n```\nflo@raspberrypi:~ $ sudo i2cdetect -y 1\n     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n00:                         -- -- -- -- -- -- -- --\n10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --\n50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --\n60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --\n70: -- -- -- -- -- -- 76 --\n```\n\n### Installing the Python Package on the Raspberry Pi\nBefore installing this library, make sure `picamera2` is installed system-wide:  \n```bash\nsudo apt install python3-picamera2\n```\n\nIf you want the latest stable version of the senor libray, install it like so:\n```bash\npip install sts1-sensors\n```\n\nDepending on the Raspberry Pi OS version you are using it may be necessary to install the library in a python virtual environment\n```bash\npython3 -m venv --system-site-packages .venv\nsource .venv/bin/activate\npip install sts1-sensors\n```\n\n\u003e **🚨 Note:** This library has only been tested with the **Arducam IMX519** camera module ([link](https://www.uctronics.com/arducam-mini-16mp-imx519-camera-module-raspberry-pi-zero.html)).  \n\u003e Camera-specific setup steps are required before use.  \n\u003e Here are the steps required for the **Arducam IMX519** ([link](https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/16MP-IMX519/))\n## For Developers\n\n* Install [just](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries): `curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin`\n* Add it to `~/.bashrc`: `export PATH=\"$PATH:$HOME/bin\"`\n* Install the [package manager uv](https://docs.astral.sh/uv/getting-started/installation/): `curl -LsSf https://astral.sh/uv/install.sh | sh`\n* Add its path to your `~/.bashrc` such that the command `uv` is available: `export PATH=$HOME/.local/bin:$PATH`\n* Clone this repo: `git clone https://github.com/SpaceTeam/STS1_sensor_libraries`\n* Switch into the directory.\n* Run `uv sync --all-extras --dev`. This creates a `.venv` folder and installs all necessary dependencies.\n* (Only on Raspberry Pi) Run `pytest`\n\n## Acknowledgments\n\nThis project makes use of the following open-source libraries and resources:\n\n* [bmm150](https://gitlab.com/umoreau/bmm150) - Usage of the bmm150 sensor.\n* [bme680](https://github.com/pimoroni/bme680-python) - Usage of the bme680 sensor.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Fsts1_sensor_libraries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspaceteam%2Fsts1_sensor_libraries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspaceteam%2Fsts1_sensor_libraries/lists"}