Skip to main content

Transfer tables for LMT8x Temperature Sensors.

Project description

Transfer tables for LMT8x Temperature Sensors.

LMT8x (LMT84, LMT85, LMT86, LMT87) are a series of analog temperature sensors made by Texus Instrument. These sensors can provide -50°C ~ 150°C with ±0.4°C accuracy. Although the output voltage is nearly linear to the temperature, it does have a slight umbrella parabolic shape. Therefore transfer tables are required to convert the voltage to the temperature.

Datasheets:

This package provides tranfer functions for LMT84, LMT85, LMT86, and LMT87 based on their transfer tables. These funcitons basically do a binary search through the transfer tables and return the match. If no match found, linear interpolation will be used to generate an approximate value.

Installation

pip install lmt8x

You can also install the in-development version with:

pip install https://github.com/charlee/python-lmt8x/archive/master.zip

Usage

lmt8x package provides functions lmt84_v2t, lmt85_v2t, lmt86_v2t, and lmt87_v2t for converting voltage to temperature.

  • input voltage must be in mV.

  • output temperature is in celsius.

from lmt8x import lmt87_v2t     # or `lmt86_v2t`, `lmt85_v2t`, `lmt84_v2t`

# read voltage from sensors.
# v = read_sensor()

# convert v to temperature.
# the pamaeter must be in mV. Return value is in celsius.
temp = lmt87_v2t(v * 1000)

print('Temperature is %s C.' % temp)

Documentation

https://python-lmt8x.readthedocs.io/

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

1.0.0 (2021-04-02)

  • First release on PyPI.

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

lmt8x-1.0.0.tar.gz (17.2 kB view hashes)

Uploaded Source

Built Distribution

lmt8x-1.0.0-py2.py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 2 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