Source: https://mokxi.com/parts/ina228
Updated: 2026-11-22

Part

# Power and energy monitor, INA228

A 20-bit power monitor on a 15 milliohm shunt that adds up energy and charge as it goes.

See every part

- 8 pins
- 1 setting
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Power and energy monitor, INA228 in brief

What it is, and every setting the properties panel gives it.

The TI INA228 is a power and energy monitor. It measures current, bus voltage and power to 20 bits through a 15 milliohm shunt, and adds up energy in joules and charge in coulombs as it goes, which makes it the monitor for a battery's state of charge or a project's energy use over a day. The chip keeps the running totals itself. It talks over I2C, with an address from 0x40 to 0x4F. In Mokxi it is used with Adafruit's library, shipped as Adafruit_INA228.h, and the sketch calls setShunt(0.015, 10.0). VBUS is the bus voltage input, tied to the load's supply side, and IN+ and IN- are the two ends of the shunt, in series with the load. The Mokxi model leaves out the limit comparisons and their alerts, the shunt temperature compensation, and noise. Nothing is draggable: the current is the circuit's own.

Family

Sensors

Pins

8

address

64

Pins

## 8 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

VCC

Supply, 2.7 to 5.5 V.

GND

Ground.

SCL

I2C. The board carries the pull-ups.

SDA

I2C. The board carries the pull-ups.

ALERT

Pulls low on a conversion when the conversion-ready alert is on.

VBUS

The bus voltage input: tie it to the load's supply side.

IN+

The two ends of the 15 milliohm shunt, in series with the load.

IN-

The two ends of the 15 milliohm shunt, in series with the load.

How to use it

## How to use the INA228 with an Arduino Uno

The example project is an energy meter. An INA228 sits in series with a 12 V lamp: IN+ goes to 12 V and IN- goes to the lamp, while VBUS ties to the 12 V supply side. VCC goes to 5 V, GND to the Uno's GND, and SCL and SDA to the Uno's SCL and SDA. An OPT3001 light sensor reads the light falling on the solar panel that would charge the battery.

The sketch includes Adafruit_INA228.h and ClosedCube_OPT3001.h, calls meter.begin(), then meter.setShunt(0.015, 10.0) to set the 15 milliohm shunt. The chip keeps the running totals itself, so the loop only reads them: every 500 ms it prints bus voltage, current in mA, power in mW, energy in joules, charge in coulombs, and the panel light in lux. 3600 coulombs is one amp hour.

With default settings, the serial monitor printed: "Energy meter", "12.00 V 100 mA 1197 mW 0.65 J 0.055 C panel 19999 lux", "12.00 V 100 mA 1197 mW 1.29 J 0.108 C panel 19999 lux". The voltage, current and power stay the same because the load does not change. The joules and coulombs climb every line as the chip accumulates them.

Try swapping the lamp for another model and watch the totals climb faster or slower. Drag the light slider on the OPT3001 and watch the lux number change.

Part pin

Goes to

VCC

5 V

GND

Arduino Uno R3 pin GND

SCL

Arduino Uno R3 pin SCL

SDA

Arduino Uno R3 pin SDA

IN+

12 V

IN-

lamp pin 1

VBUS

12 V

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3 · the first 45 lines

Common errors

## Common Power and energy monitor, INA228 errors and fixes

What goes wrong

The fix

Leaving VBUS unconnected.

VBUS is the bus voltage input. Tie it to the load's supply side, as the example does with 12 V.

Putting the shunt anywhere but in series with the load.

IN+ and IN- are the two ends of the 15 milliohm shunt. In the example IN+ goes to 12 V and IN- to the lamp.

Looking for a slider to change the current.

There is nothing to drag. The current is the circuit's own, so change the load, for example swap the lamp for another model.

Questions

## Questions and answers

### what is the ina228

A TI chip that measures current, bus voltage and power to 20 bits through a 15 milliohm shunt and adds up energy and charge as it goes.

### what is the ina228 i2c address

The address property ranges from 0x40 to 0x4F.

### how does the ina228 count energy and charge

The chip keeps the running totals itself in registers that accumulate with each conversion, until cleared.

### why does the ina228 read zero power and energy

VBUS is probably unconnected. Tie it to the load's supply side.

How it is modeled

## What is true about the Power and energy monitor, INA228, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Not modeled

The limit comparisons and their alerts, the shunt temperature compensation, and noise.

From INA228 power and energy monitor, in full.

Projects

## See the Power and energy monitor, INA228 in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Power and energy monitor, INA228 in it.

- Arduino Uno R3

Keep going

## Keep going

- I2C Scanner for Arduino and ESP32, and Fixes
- Current monitor, INA219
- Power monitor, INA226
- Three-channel current monitor, INA3221

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Power and energy monitor, INA228

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
