Skip to content

Commit 8a72d77

Browse files
raveiouscfriedt
authored andcommitted
shields: Adding Adafruit INA228 Power Monitor.
This adds the shield definition for the Adafruit INA228 Power Monitor. It connects to boards using the STEMMA-QT interface. Product photo from https://learn.adafruit.com/assets/125551, with the license CC BY-SA 3.0 Signed-off-by: Ian Wakely <raveious.irw@gmail.com>
1 parent e60fa1e commit 8a72d77

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Ian Wakely
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_INA228
5+
def_bool $(shields_list_contains,adafruit_ina228)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2025 Ian Wakely
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&zephyr_i2c {
8+
status = "okay";
9+
10+
adafruit_ina228: ina228@40 {
11+
compatible = "ti,ina228";
12+
reg = <0x40>;
13+
rshunt-micro-ohms = <15000>;
14+
current-lsb-microamps = <10>;
15+
status = "okay";
16+
};
17+
};
40.4 KB
Loading
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.. _adafruit_ina228:
2+
3+
Adafruit INA228 Shield
4+
#############################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit INA228 High or Low Side Power Monitor`_ features the
10+
`TI INA228 current sensor`_, an I2C 20-bit power monitoring chip, with two
11+
STEMMA QT connectors. This board is capable of measuring up to 85VDC
12+
common-mode, high or low side measurements ranging from milli-amps to amps.
13+
14+
.. figure:: adafruit_ina228.webp
15+
:align: center
16+
:alt: Adafruit INA228 Shield
17+
18+
Adafruit INA228 Shield (Credit: Adafruit)
19+
20+
21+
Requirements
22+
************
23+
24+
This shield can be used with boards which provide an I2C connector, for
25+
example STEMMA QT or Qwiic connectors.
26+
The target board must define a ``zephyr_i2c`` node label.
27+
See :ref:`shields` for more details.
28+
29+
30+
Pin Assignments
31+
===============
32+
33+
+--------------+-------------------+
34+
| Shield Pin | Function |
35+
+==============+===================+
36+
| SDA | INA228 I2C SDA |
37+
+--------------+-------------------+
38+
| SCL | INA228 I2C SCL |
39+
+--------------+-------------------+
40+
| ALRT | INA228 ALERT out |
41+
+--------------+-------------------+
42+
| VIN- | Current sense neg |
43+
+--------------+-------------------+
44+
| VIN+ | Current sense pos |
45+
+--------------+-------------------+
46+
| VBUS | Voltage sense |
47+
+--------------+-------------------+
48+
49+
See :dtcompatible:`ti,ina228` for documentation on how to adjust the
50+
devicetree file, for example to adjust the sample averaging.
51+
52+
53+
Programming
54+
***********
55+
56+
Set ``--shield adafruit_ina228`` when you invoke ``west build``. For example
57+
when running the :zephyr:code-sample:`sensor_shell` sample:
58+
59+
.. zephyr-app-commands::
60+
:zephyr-app: samples/sensor/sensor_shell
61+
:board: adafruit_qt_py_rp2040
62+
:shield: adafruit_ina228
63+
:goals: build
64+
65+
.. _Adafruit INA228 High or Low Side Power Monitor:
66+
https://learn.adafruit.com/adafruit-ina228-i2c-power-monitor/
67+
68+
.. _TI INA228 Current sensor:
69+
https://www.ti.com/product/INA228
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) 2025, Ian Wakely
4+
5+
shield:
6+
name: adafruit_ina228
7+
full_name: Adafruit INA228 Power Monitor
8+
vendor: adafruit
9+
supported_features:
10+
- sensor

0 commit comments

Comments
 (0)