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

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-0.9.2.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

lsm9ds1_rjg-0.9.2-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

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