Skip to main content

Python library for TLA2528 ADC on Raspberry Pi and Linux

Project description

TLA2528 Python Library

Python library for interfacing with the TLA2528 family of ADC chips on Linux (Raspberry Pi).

Overview

The TLA2528 is a 12/16-bit, 8-channel ADC with 8 digital I/O pins. It supports:

  • Manual and auto-sequence sampling modes
  • Oversampling ratios (2x, 4x, 8x, 16x, 32x, 64x, 128x)
  • Configurable analog and digital I/O
  • Alert triggers based on voltage thresholds

Datasheet: https://www.ti.com/lit/ds/symlink/tla2528.pdf

Installation

pip install tla2528

Quick Start

from tla2528 import TLA2528, Channel, OversamplingRatio

# Initialize the ADC
adc = TLA2528(
    bus=1,  # I2C bus number
    address=0x10,  # Default I2C address
    avdd_volts=3.3,
    analog_inputs=[Channel.CH0, Channel.CH1, Channel.CH2],
    oversampling_ratio=OversamplingRatio.OSR_16
)

# Read single channel
voltage_mv = adc.get_mv(Channel.CH0)
print(f"Channel 0: {voltage_mv:.2f} mV")

# Read all configured channels
voltages = adc.get_all_mv()
for i, voltage in enumerate(voltages):
    print(f"Channel {i}: {voltage:.2f} mV")

Features

  • ✅ Manual and Auto-Sequence ADC reading modes
  • ✅ Oversampling for increased precision
  • ✅ Digital input/output configuration
  • ✅ Automatic calibration support
  • ✅ Thread-safe operations
  • ✅ Comprehensive error handling

Requirements

  • Python 3.8+
  • Linux with I2C support (Raspberry Pi, etc.)
  • smbus2 library

Hardware Connection

Connect the TLA2528 to your Raspberry Pi I2C bus:

  • VDD → 3.3V
  • GND → Ground
  • SDA → I2C SDA (GPIO 2)
  • SCL → I2C SCL (GPIO 3)

Enable I2C on Raspberry Pi:

sudo raspi-config
# Interface Options → I2C → Enable

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

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

tla2528-0.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

tla2528-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file tla2528-0.1.0.tar.gz.

File metadata

  • Download URL: tla2528-0.1.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tla2528-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e7ee4e5e4db298952745f895b0dd643aa676663004d0fd680c97e9efa69697a6
MD5 5477b4ca35c2c17da8f0d6f75dd282e1
BLAKE2b-256 dbf03c0e217c0c1699d3c55041eb6a0e692085aa63634abd9466a0c657f5ffcf

See more details on using hashes here.

File details

Details for the file tla2528-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tla2528-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for tla2528-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df96b15b8c30606dde09e5639def17e8363d3deba22a5684243cd89e4b5b5605
MD5 b261b38cf65cc966a291fb31c3ec9b54
BLAKE2b-256 eaaa078fff75333b9c493fe7659b4fc38534a79e499d1e4a3db660d90324db6f

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