INA229 FT232H
A small Python driver for the Texas Instruments INA229 SPI power/energy/charge monitor, including an FT232H helper for Adafruit Blinka and pyftdi.
Installation
Install the released package from PyPI:
python -m pip install ina229-ft232h
For local development, clone the repository and install it in editable mode:
python -m pip install -e .
Set BLINKA_FT232H=1 before starting Python whenever the FT232H helper is
used.
FT232H wiring
| FT232H | INA229 |
|---|---|
| D0 (SCK) | SCLK |
| D1 (MOSI) | SDI |
| D2 (MISO) | SDO |
| D3 | /CS |
| GND | GND |
The FT232H uses 3.3 V logic. Keep the SPI harness short and provide a solid ground return. For longer harnesses, reduce the baud rate and consider source series termination on SCK, MOSI, and /CS.
Basic usage
import ina229_ft232h as ina229
spi = ina229.ft232h_spi(baudrate=1_000_000)
device = ina229.INA229(
spi,
shunt_ohms=0.01,
max_current=8.0,
)
print(device.bus_voltage)
print(device.shunt_voltage)
print(device.current)
print(device.power)
print(device.energy)
print(device.charge)
print(device.temperature)
max_current defines the signed CURRENT-register full scale and therefore
the current LSB. Choose it above the largest expected transient. The shunt drop
must also remain within the selected ADC range:
adc_range=False: +/-163.84 mVadc_range=True: +/-40.96 mV, four times finer resolution
ADC configuration
device.configure_adc(
mode=ina229.MODE_CONT_ALL,
vbus_ct=ina229.CT_50US,
vshunt_ct=ina229.CT_50US,
temp_ct=ina229.CT_50US,
avg=ina229.AVG_1,
)
The module exports the INA229 register addresses and MODE_*, CT_*, and
AVG_* field constants for lower-level use.
SPI mode note
The INA229 requires falling-edge sampling. Blinka's FT232H backend rejects
CPHA=1, while pyftdi's mode-1 three-phase emulation shifted received INA229
words by one bit on the tested hardware. ft232h_spi() therefore defaults the
underlying pyftdi port to mode 2, which provides the working edge timing
without three-phase emulation. Override it with
ft232h_spi(mode=...) if another adapter requires different timing.
Tests
python -m unittest discover -v
Release maintainers can find the trusted-publishing setup and release process in RELEASING.md.
Metadata
Release files for ina229-ft232h 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ina229_ft232h-0.1.0.tar.gz | 9.1 kB | With provenance | Details for ina229_ft232h-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ina229_ft232h-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ina229_ft232h-0.1.0-py3-none-any.whl |
Total release size: 15.3 kB
Release files / ina229_ft232h-0.1.0.tar.gz
| Download URL | ina229_ft232h-0.1.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78240bfbf0c15fbc65cd3fb18b0c485cbcf3f3f2f092e1fa86a46f1815d38a36
|
|
BLAKE2b-256 checksum How to use checksums |
fc962b93e3081636e8053af95d1ff08ae3d1a01ed3c20c47fa2c202e3ed1fb05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 29, 2026.
Transparency logRelease files / ina229_ft232h-0.1.0-py3-none-any.whl
| Download URL | ina229_ft232h-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c0df11bbc21a51ae5957a7cfd4999fcddce7805ecc0b84603087131ceabb3fe
|
|
BLAKE2b-256 checksum How to use checksums |
7ee05573ac12788b34f4cc33c98109a79d535ad84974ddb8a420ab1679e4564d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 29, 2026.
Transparency logSecurity for ina229-ft232h 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for ina229_ft232h-0.1.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 Aug 29, 2026.
Transparency logA 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.