Skip to main content

An inofficial python library for the Digipas DWL5500XY high precision inclinometer.

Reason this release was yanked:

this version has wrong import paths and is missing potentially dangerous error checking.

Project description

Upload Python Package

Description

Python library and a small recording script for the Digipass DWL5500XY inclinometer, which fixes a few minor in Stormholt's implementation. For further details regarding the sensor, please read the instruction manual.

The DWL5500-XY is an inclinometer (sensor that measures the angle against gravity) with an accuracy and precision of 0.001 deg. It internally uses a high precision accelerometer and therefore uses strong filtering to get rid of the noise. Measurements therefore need some time to settle (up to 5 minutes after sharp movements. Settling time is lower for small movements).

Installation

[!IMPORTANT] Both the libraries serial and pyserial can be imported as import serial. This module expects a pyserial installation, and will not work with the incorrect library!

git clone https://github.com/missing-user/py-DWL5500XY.git
pip install py-DWL5500XY

Quickstart

  1. Place the sensor according to one of the graphics below. Dual axis angle measurement is only available when oriented as in Figure 32 Graphic about mounting styles from the instruction manual
  2. Let the sensor warm up and settle in for 15 minutes after connecting it to power to get the full measurement accuracy.
  3. Run python inclinometer_gui.py from your terminal to open the recording tool.
  4. It will ask you for the serial port your device is connected to. Type it into the terminal and press enter.

Usage

  1. Open the serial connection. On Windows you can find the port by opening Windows Key > Device Manager > COM Devices and identifying the COM port that appears when plugging in the USB to serial converter of your sensor. On Linux, you can list connected serial devices using ls /sys/class/tty/ttyUSB*. Replace the port name in the code by the one you identified. windows screenshot
import os
import DWL5500XY
sc = DWL5500XY.Sensor(True) # The argument controls Logging level
if os.name == 'nt':
  sc.open_connection("COM5") # Windows style serial port
else:
  sc.open_connection('/dev/ttyUSB0') # Linux style serial port
  1. Initialize the sensor and set the location you are operating in (county codes can be found starting on page 60 of the instruction manual). The location dependent gravitational acceleration constant g is internally used for filtering.
sc.initialize_sensor()
sc.set_location_code(0x17, 0x0E) # Germany, Munich
sc.set_mode(sc.LOCATION_MODE) # Call after setting the location code
  1. Switch the sensor into the correct measurement mode. It supports dual axis angle measurement (in degrees) (default), single axis angle measurement (in degrees), vibration measurement (in multiples of g).
sc.set_mode(sc.DUAL_MODE)
# sc.set_mode(sc.SINGLE_MODE)
# sc.set_mode(sc.VIBRO_MODE)
  1. Periodically read data from the sensor.
sc.read_response() # Blocking function, sensor returns measurements at a rate of 10Hz 

Re-Calibration

Connect to the sensor as usual, then call sc.calibration() and follow the instructions from the terminal.

[!CAUTION] Calling the calibration function will overwrite the factory settings!

If you have purchased a new DWL5500XY sensor, i suggest to NOT PERFORM A NEW CALIBRATION! The sensor should be calibrated at the factory, and will most probably be better than what you can achieve, unless you really know what you're doing. You have been warned.

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

DWL5500XY-0.0.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DWL5500XY-0.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file DWL5500XY-0.0.0.tar.gz.

File metadata

  • Download URL: DWL5500XY-0.0.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for DWL5500XY-0.0.0.tar.gz
Algorithm Hash digest
SHA256 bf6ede81ecaf287c9ed84e1342941144da07baad835a105074e7b3e0ac862f08
MD5 a67262e57dd14cc9c59e0a8acc90c0ec
BLAKE2b-256 18bc85471b41cdb673a8dc0ff75620f22a423daad7aed33c9d70a46def60ee75

See more details on using hashes here.

File details

Details for the file DWL5500XY-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: DWL5500XY-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for DWL5500XY-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d25373e270d0bb729fc4d409a9a64308e1c7ade9747a9cb44afe26b59e7f8364
MD5 1a00d423a64fd767d321203ad6535ffe
BLAKE2b-256 a568587c27c05160020975c74022710a07c02f1004b700da644a5b9fc916ccef

See more details on using hashes here.

Supported by

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