Skip to main content

Docs | Github | PyPI

sts1-sensors

Streamline the process of handling sensors for the STS1 project.

The following sensors are available both on the satellite and on the EDU module:

  • ADXL345 - Digital accelerometer.
  • BME688 - Pressure, humidity, temperature and gas sensor.
  • BMM150 - Geomagnetic sensor.
  • L3GD20H - Three-axis gyroscope.
  • TMP112 - High-accuracy temperature sensor.

The following sensors are available on the satellite only:

Quickstart

from sts1_sensors import ADXL345, BME688, BMM150, L3GD20H, TMP112

# Accelerometer
accel = ADXL345()
x, y, z = accel.get_acceleration()
print(f"{x=:.2f} g, {y=:.2f} g, {z=:.2f} g")

# Temperature, pressure, humidity and gas sensor
multi = BME688(enable_gas_measurements=True)
t = multi.get_temperature()
p = multi.get_pressure()
h = multi.get_humidity()
heat = multi.get_heat_stable()
res = multi.get_gas_resistance()
print(f"{t:.2f} °C, {p:.2f} hPa, {h:.2f} %RH, {heat=}, {res:.2f} Ohms")

# Geomagnetic sensor
mag = BMM150()
x, y, z = mag.get_magnetic_data()
print(f"{x=:.2f} µT, {y=:.2f} µT, {z=:.2f} µT")
print(f"Heading: {mag.get_heading():.2f}°")

# Gyroscope
gyro = L3GD20H()
x, y, z = gyro.get_angular_momentum()
print(f"{x=:.2f} dps, {y=:.2f} dps, {z=:.2f} dps")

# Temperature sensor
temp = TMP112()
print(f"{temp.get_temperature():.2f} °C")

More examples, see examples folder.

Installation

Initial Setup on the Raspberry Pi

  • Open a terminal on the Raspberry Pi (e.g. via SSH).
  • Activate the I2C interface: sudo raspi-config
  • Reboot sudo reboot now then reconnect.
  • Run sudo apt-get install i2c-tools
  • Run ls /dev/i2c*. Note the last number that apprears. E.g. for /dev/i2c-1 this would be 1.
  • Run i2cdetect -y 1. You may change that last number according to what you saw in the previous step.
  • If you see a grid of dashes -- with some numbers, this means some sensors were recognized and you are good to go. For example:
flo@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- 76 --

Installing the Python Package on the Raspberry Pi

Before installing this library, make sure picamera2 is installed system-wide:

sudo apt install python3-picamera2

If you want the latest stable version of the senor libray, install it like so:

pip install sts1-sensors

Depending on the Raspberry Pi OS version you are using it may be necessary to install the library in a python virtual environment

python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip install sts1-sensors

🚨 Note: This library has only been tested with the Arducam IMX519 camera module (link).
Camera-specific setup steps are required before use.
Here are the steps required for the Arducam IMX519 (link)

For Developers

  • Install just: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin
  • Add it to ~/.bashrc: export PATH="$PATH:$HOME/bin"
  • Install the package manager uv: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Add its path to your ~/.bashrc such that the command uv is available: export PATH=$HOME/.local/bin:$PATH
  • Clone this repo: git clone https://github.com/SpaceTeam/STS1_sensor_libraries
  • Switch into the directory.
  • Run uv sync --all-extras --dev. This creates a .venv folder and installs all necessary dependencies.
  • (Only on Raspberry Pi) Run pytest

Acknowledgments

This project makes use of the following open-source libraries and resources:

  • bmm150 - Usage of the bmm150 sensor.
  • bme680 - Usage of the bme680 sensor.

Metadata

Release files for sts1-sensors 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sts1-sensors 0.5.3
File Size Uploaded Provenance Actions
sts1_sensors-0.5.3.tar.gz 50.6 kB With provenance Details for sts1_sensors-0.5.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sts1-sensors 0.5.3
File Interpreter ABI Platform Actions
sts1_sensors-0.5.3-py3-none-any.whl Python 3 none any Details for sts1_sensors-0.5.3-py3-none-any.whl

Total release size: 70.6 kB

Release files / sts1_sensors-0.5.3.tar.gz

Download URL sts1_sensors-0.5.3.tar.gz
Size 50.6 kB
Tags Source
SHA-256 checksum
How to use checksums
58b146ee4a10b9f4251a5207e6b5170112cdf5890170c50d3e9aedc152b4cef5
BLAKE2b-256 checksum
How to use checksums
9bee2c29870c6588bb0e2613c79040119d7105301a0372f43ae95a8c9abed001
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.

Transparency log

Release files / sts1_sensors-0.5.3-py3-none-any.whl

Download URL sts1_sensors-0.5.3-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25e939a527936776043c46bad692b332abae89ffd2bd35540028a65514b10787
BLAKE2b-256 checksum
How to use checksums
67d479adaa96070faeda7edf53558e948c29b0596b54fa6ba4a46d6018fe2f6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.

Transparency log

Security for sts1-sensors 0.5.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sts1_sensors-0.5.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.3 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page