Skip to main content

A python module to enable a Raspberry Pi to access an LSM9DS1 IMU sensor.

Project description

lsm9ds1-rjg

Introduction

This is a device driver that enables a Raspberry Pi to access an LSM9DS1 IMU sensor.

The LSM9DS1 combines a 3D accelerometer, 3D rate gyroscope and a 3D magnetometer. It's useful in robotics and other applications for measuring a robot's attitude and movement. The LSM9DS1 is made by ST Microelectronics. The datasheet is available from their website.

Low cost breakout boards are available from various vendors including Adafruit and Sparkfun.

Driver Features

  • Connects with I2C or SPI
  • Preconfigured for 230 Hz output data rate
  • Converts accelerometer and gyro output to use the same axes as the magnetometer by flipping the direction of the x axis.
  • Detects data ready in software or with an optional GPIO hardware interrupt.
  • Provides raw, unscaled data. i.e. max acceleration is 32768 not 2g.
  • Extensible
  • Optionally enables high priority thread scheduling

Limitations

  • Not a complete implementation of the sensor's API.

Scaling

This driver returns raw unscaled data. This is a deliberate choice to make it easier to scale the data with your application.

Data Ready

If you don't check for data ready and just read data then you will miss some samples. Worse than that, in some cases you'll read part of one sample and part of the next. This provides plausible looking but incorrect data. You must wait for data ready before reading the sensor values. See the examples.

Examples

Known Issues

This library depends on smbus2 which introduced a breaking change in version 0.4.0. Please upgrade smbus2 or install v0.9.2 of this library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lsm9ds1_rjg-1.0.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

lsm9ds1_rjg-1.0.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file lsm9ds1_rjg-1.0.0.tar.gz.

File metadata

  • Download URL: lsm9ds1_rjg-1.0.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for lsm9ds1_rjg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 deff3acc6847e4bb8dbbcf885eef5dd70ed56e535704debf0e258d9f0cd5e7cc
MD5 bb87b2c288f4a035b10c26b33e06177f
BLAKE2b-256 ce72474856b9518f77dd42d8d37cc9dfceb468b28a34f00c01315671567bba88

See more details on using hashes here.

File details

Details for the file lsm9ds1_rjg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lsm9ds1_rjg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for lsm9ds1_rjg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dd84b524d94f075fc5ad4430eade40f4484c3747ac984c6fa24b0439a89bdea
MD5 bc168324df2bd3691a551ae233299cbd
BLAKE2b-256 7042e05434ec9a8f32cd9f437f6a77021f607532871b703e8caace3f4d3db986

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page