Adafruit INA3221 Shield
Overview
The Adafruit INA3221 Triple Power Monitor Shield features a TI INA3221 current sensor and two STEMMA QT connectors. It measures current and bus voltage on three channels.
Requirements
This shield can be used with boards which provide an I2C connector, for example STEMMA QT
or Qwiic connectors. The target board must define a zephyr_i2c node label.
See Shields for more details.
Pin Assignments
Shield Pin |
Function |
|---|---|
SCL |
I2C SCL |
SDA |
I2C SDA |
VIN3+ |
Current sense pos, channel 3 |
VIN3- |
Current sense neg, channel 3 |
VIN2+ |
Current sense pos, channel 2 |
VIN2- |
Current sense neg, channel 2 |
VIN1+ |
Current sense pos, channel 1 |
VIN1- |
Current sense neg, channel 1 |
WRN |
Interrupt for current level |
CRI |
Interrupt for overcurrent |
TC |
Interrupt for timing control |
VALID |
Interrupt for power valid |
VPU |
Pull up voltage for VALID pin |
See ti,ina3221 for documentation on how to adjust the
devicetree file, for example to adjust the sample averaging.
Programming
Set --shield adafruit_ina3221 when you invoke west build. For example
when running the Sensor shell sample:
# From the root of the zephyr repository
west build -b adafruit_feather_canbus_rp2040 --shield adafruit_ina3221 samples/sensor/sensor_shell
west flash
Use the shell command to show voltage, current and power on channel 1. This example has a voltage and current of approximately 5 Volt and 3 mA, respectively:
uart:~$ sensor get ina3221@40
channel type=33(voltage) index=0 shift=3 num_samples=1 value=63920453436ns (5.079999)
channel type=35(current) index=0 shift=3 num_samples=1 value=63920453436ns (0.003199)
channel type=36(power) index=0 shift=3 num_samples=1 value=63920453436ns (0.016255)
Use this command to select channel 2 instead of channel 1:
uart:~$ sensor attr_set ina3221@40 voltage 19 2