Skip to main content

ProtoCentral TLA20xx MicroPython Library

MicroPython library for the ProtoCentral TLA20xx breakout — a TI TLA2024 / TLA2022 12-bit, 4-channel I²C ADC (ADS101x-class) with a programmable input mux, gain (PGA), and data rate. The same driver also runs on a Raspberry Pi (via a lightweight smbus2 shim), so one codebase covers MCUs (Raspberry Pi Pico, ESP32) and Linux SBCs alike.

Don't have one? Buy it here

Features

  • TI TLA2024 (4-channel) / TLA2022 (1-channel) 12-bit delta-sigma ADC
  • Programmable input mux: 4 single-ended or differential pairs (AIN0–AIN3)
  • Programmable gain / full-scale range from ±6.144 V down to ±0.256 V
  • Selectable data rate, 128 SPS to 3300 SPS
  • Continuous and single-shot conversion modes
  • I²C interface, default address 0x48
  • Qwiic / STEMMA QT connector for solder-free wiring
  • One driver for MicroPython and Raspberry Pi / Linux

Installation

MicroPython (Raspberry Pi Pico, ESP32, …)

Install over the network with mip:

mpremote mip install github:Protocentral/protocentral-micropython-tla20xx

Or copy protocentral_tla20xx.py to the board manually (e.g. mpremote cp protocentral_tla20xx.py :).

Raspberry Pi / Linux

sudo raspi-config            # Interface Options -> enable I2C
pip install protocentral-tla20xx
i2cdetect -y 1               # confirm the ADC shows up at 0x48

Hardware Setup

The board uses I²C. Connect power, ground, and the two I²C lines; the default address is 0x48 (ADDR strap: GND→0x48, VDD→0x49, SDA→0x4A, SCL→0x4B). Set the address in your own script to match the strap. Analog inputs are AIN0–AIN3.

Adafruit QT Py ESP32-C3 (MicroPython)

The examples default to this board — plug the breakout into the STEMMA QT / Qwiic connector for solder-free wiring, or wire it by hand:

TLA20xx Pin QT Py C3 Pin Notes
VIN 3V3 3.3 V supply
GND GND Ground
SDA GPIO5 I2C SDA
SCL GPIO6 I2C SCL

Raspberry Pi Pico (MicroPython)

TLA20xx Pin Pico Pin Notes
VIN 3V3 (OUT) 3.3 V supply
GND GND Ground
SDA GP4 I2C0 SDA
SCL GP5 I2C0 SCL

ESP32 (MicroPython)

TLA20xx Pin ESP32 Pin Notes
VIN 3V3 3.3 V supply
GND GND Ground
SDA GPIO21 default I2C SDA
SCL GPIO22 default I2C SCL

Raspberry Pi (Linux)

TLA20xx Pin RPi Header Notes
VIN Pin 1 (3V3) 3.3 V supply
GND Pin 6 (GND) Ground
SDA Pin 3 (GPIO2 / SDA1) I2C bus 1
SCL Pin 5 (GPIO3 / SCL1) I2C bus 1

Quick Start

MicroPython

import time
from machine import Pin, I2C
from protocentral_tla20xx import TLA20XX, MUX_AIN0_GND, FSR_2_048V, DR_128SPS, OP_CONTINUOUS

i2c = I2C(0, scl=Pin(6), sda=Pin(5), freq=400000)   # Adafruit QT Py ESP32-C3; set pins for your board

TLA20XX_I2C_ADDR = 0x48        # ADDR strap: GND=0x48, VDD=0x49, SDA=0x4A, SCL=0x4B
adc = TLA20XX(i2c, TLA20XX_I2C_ADDR)
adc.begin()
adc.set_mode(OP_CONTINUOUS)
adc.set_dr(DR_128SPS)
adc.set_fsr(FSR_2_048V)        # at +/-2.048 V, 1 LSB ~= 1 mV
adc.set_mux(MUX_AIN0_GND)

while True:
    print("count={:>6}   {:.2f} mV".format(adc.read_adc(), adc.read_voltage()))
    time.sleep(0.5)

Raspberry Pi / Linux

Same driver — swap machine.I2C for the smbus2 shim:

import time
from protocentral_tla20xx_linux import I2C
from protocentral_tla20xx import TLA20XX, MUX_AIN0_GND, FSR_2_048V, DR_128SPS, OP_CONTINUOUS

TLA20XX_I2C_ADDR = 0x48        # ADDR strap: GND=0x48, VDD=0x49, SDA=0x4A, SCL=0x4B

with I2C(bus=1) as i2c:
    adc = TLA20XX(i2c, TLA20XX_I2C_ADDR)
    adc.begin()
    adc.set_mode(OP_CONTINUOUS)
    adc.set_dr(DR_128SPS)
    adc.set_fsr(FSR_2_048V)
    adc.set_mux(MUX_AIN0_GND)
    while True:
        print("count={:>6}   {:.2f} mV".format(adc.read_adc(), adc.read_voltage()))
        time.sleep(0.5)

API Reference

Constructor

Constructor Description
TLA20XX(i2c, address) Create an ADC on a machine.I2C (or Pi shim) bus; address set by the ADDR strap (0x48 default)

Methods

Method Returns Description
begin() — Initialise to the default config word (0x8683)
set_mux(MUX_*) — Select input channel / differential pair
set_fsr(FSR_*) — Set full-scale range / PGA
set_dr(DR_*) — Set data rate
set_mode(OP_CONTINUOUS / OP_SINGLE) — Set conversion mode
read_adc() int Raw signed 12-bit conversion code (mirrors the Arduino read_adc())
read_voltage() float Convenience: measured voltage in mV (uses the current FSR)

Method and constant names mirror the ProtoCentral TLA20xx Arduino library so sketches translate directly.

Constants

Group Values
Mux MUX_AIN0_AIN1, MUX_AIN0_AIN3, MUX_AIN1_AIN3, MUX_AIN2_AIN3, MUX_AIN0_GND, MUX_AIN1_GND, MUX_AIN2_GND, MUX_AIN3_GND
Full-scale range FSR_6_144V, FSR_4_096V, FSR_2_048V, FSR_1_024V, FSR_0_512V, FSR_0_256V
Data rate DR_128SPS, DR_250SPS, DR_490SPS, DR_920SPS, DR_1600SPS, DR_2400SPS, DR_3300SPS
Mode OP_CONTINUOUS, OP_SINGLE

Examples

Example Platform Description
tla20xx_simpletest.py MicroPython Single-channel read (count + mV)
tla20xx_4channel_scan.py MicroPython Scan AIN0–AIN3 vs GND
tla20xx_raspberrypi.py Raspberry Pi Same read loop using the smbus2 shim

License

Software: MIT License — see LICENSE.md.

Hardware: the TLA20xx breakout board is open-source hardware licensed under CERN-OHL-P v2.

Metadata

Release files for protocentral-tla20xx 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for protocentral-tla20xx 1.0.0
File Size Uploaded Provenance Actions
protocentral_tla20xx-1.0.0.tar.gz 7.5 kB With provenance Details for protocentral_tla20xx-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for protocentral-tla20xx 1.0.0
File Interpreter ABI Platform Actions
protocentral_tla20xx-1.0.0-py3-none-any.whl Python 3 none any Details for protocentral_tla20xx-1.0.0-py3-none-any.whl

Total release size: 14.7 kB

Release files / protocentral_tla20xx-1.0.0.tar.gz

Download URL protocentral_tla20xx-1.0.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6464a98e4da1cde0f5d6a1c38ca2c0b1039d61fcbca972ba4d0477f7d8ca9d3f
BLAKE2b-256 checksum
How to use checksums
78c42fbf152ae070b68242ffc741808db22e2e2e154ec55067da855e5edd6325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Release files / protocentral_tla20xx-1.0.0-py3-none-any.whl

Download URL protocentral_tla20xx-1.0.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
688ca5a56f8026a5d77827f8a79a4950a229b72b4a8890f611b80ad0c326b82e
BLAKE2b-256 checksum
How to use checksums
04d3d4239f3f25de61a5df0f25fdb74d734773b17fad636d16cb917d4efb78ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Security for protocentral-tla20xx 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for protocentral_tla20xx-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page