API Reference

adafruit_ina23x

CircuitPython driver for the INA237 and INA238 DC Current Voltage Power Monitors

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_ina23x.INA23X(*args: Any, **kwargs: Any)

Driver for the INA237/INA238 current and power sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the INA23X is connected to.

  • address (int) – The I2C device address. Defaults to 0x40

  • skip_reset (bool) – Skip resetting the device on init. Defaults to False.

property alert_flags: int

Current alert flags.

property alert_type: int

Alert type configuration.

property bus_voltage: float

Bus voltage in volts.

property conversion_ready: bool

Check if conversion is complete.

property current: float

Current in amperes.

property die_temperature: float

Die temperature in degrees Celsius.

property power: float

Power in watts.

set_calibration(shunt_res: float = 0.015, max_current: float = 10.0) None

Set the calibration based on shunt resistance and maximum expected current.

Parameters:
  • shunt_res (float) – Shunt resistance in ohms

  • max_current (float) – Maximum expected current in amperes

property shunt_voltage: float

Shunt voltage in volts.