INA260 with ESP32 and ESPHome: DC Current, Voltage and Power Without an External Shunt

Build a safe INA260 current, voltage and power monitor with ESP32, ESPHome and Home Assistant. Includes integrated-shunt wiring, limitations and energy tracking.

The INA260 lets an ESP32 report DC current, voltage and power to Home Assistant without selecting, fitting or calibrating an external shunt resistor. Its precision 2 mΩ resistor is integrated inside the measurement IC. This makes it particularly attractive for monitoring a small solar load, a 12 V equipment cabinet, an always-on router or a bench DC circuit where you want useful electrical data without building a separate analogue measurement stage.

The key advantage is also the key limitation: the shunt is fixed. You cannot configure a larger current range by entering a different resistor value in ESPHome, and the component does not produce an amp-hour or watt-hour register by itself. This guide builds a complete 3.3 V ESP32 + INA260 monitor, explains the separate measurement and I²C connections, then adds an optional Home Assistant energy total using ESPHome’s software integration sensor.

What the INA260 measures—and how it differs from the INA226

The INA260 senses the small voltage drop across its integrated current path, separately measures the DC bus voltage and calculates power. Its built-in 2 mΩ shunt removes one of the most error-prone parts of an INA226 project: matching the configured resistor value to the resistor physically installed on a breakout. There are still wiring, temperature, board and application limits, so an integrated shunt is not a licence to pass arbitrary current through a tiny PCB.

CharacteristicINA260 practical meaning
Current pathIntegrated precision 2 mΩ shunt: no user-selected external shunt
DC bus measurement0–36 V common-mode/bus range at the sensor, independent of 3.3 V logic supply
Current capabilityIC shunt rated for up to 15 A continuous over the specified temperature range; breakout wiring and cooling may impose a lower limit
InterfaceI²C; ESPHome native ina260 platform
Reported quantitiesBus voltage (V), signed current (A) and power (W)
Not provided in hardwareDirect battery state-of-charge and persistent amp-hour/watt-hour counters

Texas Instruments specifies the internal shunt for 15 A continuous from −40 °C to +85 °C. That is an IC-level rating, not an automatic rating for the particular screw terminal, header, copper trace, cable or enclosure you bought. The INA226 is more flexible when a different resistor or installation range is necessary, while an INA228 can provide hardware charge and energy accumulation; choose the measurement architecture for the job rather than treating these parts as interchangeable.

Parts and a suitable test circuit

  • A normal ESP32 development board with a stable 3.3 V output and accessible I²C GPIOs. The example uses GPIO21 for SDA and GPIO22 for SCL on a classic ESP32 DevKit; other ESP32 variants require their own pin selection.
  • An INA260 breakout with its high-current VIN+ and VIN− measurement path clearly identified. The power pin for the logic side may be labelled VCC or VIN depending on the board: read its actual pinout.
  • A current-limited DC source and a small, known DC load such as a 12 V resistive lamp or another well-understood low-voltage device. Start far below the board’s current rating.
  • Appropriately rated conductors, a fuse chosen for the circuit, and a multimeter to verify polarity and load current. Use a proper connector rather than running load current through a breadboard.

Use this tutorial for isolated, low-voltage DC only. Never connect the INA260 directly to AC mains, an unprotected high-energy battery pack, or a circuit where a wiring fault could expose the ESP32 to hazardous voltage. Do not interpret “36 V bus voltage” as permission to connect 36 V to the ESP32’s power or GPIO pins.

ESP32 and INA260 wiring: two separate electrical paths

The board has a low-current digital supply/interface and a completely different, higher-current path through its measurement terminals. In a high-side configuration, positive supply current flows through VIN+ and then VIN− into the load. The load’s negative lead returns directly to the supply negative. The ESP32 does not carry the load current through a GPIO, GND trace or breadboard rail.

ESP32 or DC circuitINA260 breakoutPurpose
ESP32 3V3VCC / logic VIN, as labelled on the breakout3.3 V logic-side supply
ESP32 GNDGNDShared logic ground/reference
ESP32 GPIO21SDAI²C data, at 3.3 V
ESP32 GPIO22SCLI²C clock, at 3.3 V
DC supply positive, via suitable fuseVIN+ / input of current pathSource side of high-side shunt
VIN− / output of current pathDC load positiveCurrent exits the monitor into the load
DC load negativeDC supply negativeNormal return path; not routed through the ESP32
LOW-VOLTAGE DC SUPPLY (+) -- fuse -- INA260 VIN+ [internal shunt] VIN- -- (+) LOAD
LOW-VOLTAGE DC SUPPLY (-) ------------------------------------------- (-) LOAD

ESP32 3V3  ------------------------ INA260 logic VCC (or board logic VIN)
ESP32 GND  ------------------------ INA260 GND
ESP32 GPIO21 (SDA) ---------------- INA260 SDA
ESP32 GPIO22 (SCL) ---------------- INA260 SCL

The ESP32 and INA260 logic supply must have a common reference. When the measured DC supply is separate from the ESP32’s USB supply, verify the grounding arrangement and absence of hazardous potential differences before connecting their grounds. Do not assume every breakout has electrical isolation: the INA260 is a current monitor, not an isolation barrier.

The example uses high-side placement because it is straightforward for a positive-ground-referenced DC load. A low-side placement is also possible at the IC, but it changes the sensed ground path and may require rerouting the breakout’s separate VBUS connection. On Adafruit’s INA260 breakout, VBUS is normally tied to VIN+; its documentation describes cutting the board jumper and wiring VBUS separately for proper low-side voltage/power measurement. Do not generalise that jumper procedure to a differently laid-out board.

Confirm the 3.3 V interface before powering it

The INA260 silicon operates from 2.7–5.5 V on its logic supply while measuring a higher external DC bus. Most hobby breakouts connect I²C pull-ups to the breakout logic supply. Powering such a board from the ESP32’s 3.3 V rail keeps SDA and SCL at appropriate levels; powering it from 5 V can pull ESP32 GPIOs to 5 V, which is unsafe unless a correctly designed level shifter separates the buses.

Never connect the monitored 12 V or 24 V supply directly to the breakout’s logic VCC pin. The bus voltage is sensed through the separate measurement terminals or designated VBUS input. Inspect the particular breakout: some include additional regulator/level-shifter circuitry, but a generic module cannot be assumed to do so.

Adafruit’s INA260 breakout already includes 10 kΩ SDA/SCL pull-ups to its logic supply. If several I²C boards share the bus, check their combined pull-up resistance and the total cable capacitance before adding more resistors. Keep high-current wiring separate from the I²C pair, particularly around motors and PWM-driven loads.

Complete ESPHome configuration: current, voltage and power

The following is a complete starting configuration for an ESP32 DevKit with an INA260 at I²C address 0x40. Replace the example Wi-Fi secrets with names from your own ESPHome secrets file; if your device already exists, retain its actual ESPHome node name and API encryption key rather than creating a second Home Assistant device.

esphome:
  name: ina260-dc-monitor
  friendly_name: INA260 DC Monitor

esp32:
  board: esp32dev
  framework:
    type: esp-idf

logger:

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "INA260 Recovery"
    password: !secret fallback_ap_password

captive_portal:

i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true

sensor:
  - platform: ina260
    address: 0x40
    update_interval: 10s
    current:
      name: "DC Load Current"
      id: dc_load_current
    bus_voltage:
      name: "DC Bus Voltage"
      id: dc_bus_voltage
    power:
      name: "DC Load Power"
      id: dc_load_power

The configuration uses the native ina260 sensor platform. You do not need to declare a resistor value, a calibration constant or an ADC pin. ESPHome’s INA260 component reads and publishes the chip’s current, bus-voltage and power registers directly. The component defaults to a 60-second update interval; 10 seconds is a reasonable bench-testing interval, not a requirement for continuous logging.

The example uses current ESPHome OTA syntax (ota: - platform: esphome). It does not need a separate custom sensor library. On first installation, connect the ESP32 over USB and use ESPHome’s dashboard installation flow. After a successful upload and Wi-Fi connection, verify that the serial logs find the I²C device and that Home Assistant receives all three measurements before installing the monitor in a permanent location.

Verify the first readings with a known load

Start with the DC source off. Inspect both terminal orientations; then power the ESP32 logic, check that ESPHome sees address 0x40, and only then energise the fused DC load. For a resistive 12 V load drawing roughly 0.5 A, expect current near +0.5 A and power near 6 W. These figures are an illustration, not a universal lamp specification. Compare your actual readings with a correctly connected meter.

If the current is near zero with the load operating, trace the load’s complete positive-current path. A wire that goes from the supply straight to the load bypasses the INA260 entirely; in that case, the sensor can show a plausible bus voltage but almost no current. A return current flowing in an unexpected alternate path can similarly defeat your intended measurement.

The current sign depends on the actual direction through VIN+ and VIN−. A negative current can indicate a reversed sense path or genuine reverse energy flow, such as a battery charging rather than discharging. Check the source and load topology before inverting signs in software. When the source itself can reverse polarity, first establish whether the sensor’s allowed bus and pin voltages are still respected; this is not a generic reverse-battery-protection device.

Understanding voltage, current and power numbers

Voltage is not the same as supply to the ESP32

The INA260 bus_voltage value comes from its external bus-sensing arrangement, not from the ESP32 3V3 rail. With common high-side breakouts, the voltage-sense connection is made on the source-side sense terminal. A real load therefore sees slightly less voltage than that upstream reading because of voltage dropped across the shunt, connectors and wiring. At 10 A, the ideal drop across 2 mΩ alone is 20 mV; the rest of the circuit may contribute more.

Power is a product of the measured quantities

For a reasonably steady DC load, check whether bus voltage times current is consistent with reported power. A 12.0 V bus and 0.50 A load corresponds to approximately 6.0 W. With rapidly changing loads, separate sensor register conversion times and the ESPHome update schedule can produce readings that do not match the instant you measured with a handheld meter. Average or sample the load under steady conditions before interpreting a small difference as a fault.

Resolution is not accuracy

An external meter may have more display digits, but that does not mean it has better absolute accuracy. The INA260’s built-in shunt reduces calibration uncertainty, yet board temperature, bus noise, contact resistance, offset near zero and meter tolerances still matter. A value moving by a few milliamps while the load is off is not necessarily a mysterious standby load; short the intended path only as permitted by your safe test setup, record the offset, and compare against the manufacturer’s published measurement limitations.

Why an integrated shunt still needs a thermal check

The shunt dissipates heat according to P = I² × R. With the INA260’s nominal 0.002 Ω internal resistance, a 5 A load dissipates 0.05 W in the shunt, 10 A dissipates 0.20 W, and 15 A dissipates 0.45 W. Terminal blocks, traces, solder joints and external cables have additional resistance and thermal behaviour. The actual safe continuous current is the lowest rating in the whole path, including the board manufacturer’s rating and your enclosure temperature.

This matters most when a monitoring project is installed near batteries or in a warm electrical enclosure. Choose a fuse and appropriately rated connections for the load circuit; do not let a website’s generic “15 A” label stand in for a circuit assessment. The INA260 does not replace a fuse, circuit breaker, battery-management system or dedicated overcurrent protection. Although the chip has alert features, the basic ESPHome platform in this guide only exposes current, voltage and power as sensors, not an independent hardware cut-off.

Add accumulated energy to Home Assistant

Current, voltage and power are instantaneous or periodically sampled quantities. A dashboard that shows how much energy a load has used needs energy integrated over time. The INA260 does not maintain a persistent Wh counter. ESPHome can integrate its published positive power readings to create a software energy entity; the result is an estimate whose accuracy depends on how often samples are published and what happens while the monitor is offline.

For a permanently positive-power load, append the following sensor entry under the same existing sensor: list—do not create a second top-level sensor: key. It converts power in watts, integrated over hours, into watt-hours and then into kilowatt-hours for Home Assistant.

  - platform: integration
    name: "DC Load Energy"
    id: dc_load_energy
    sensor: dc_load_power
    time_unit: h
    integration_method: trapezoid
    restore: true
    unit_of_measurement: kWh
    accuracy_decimals: 4
    device_class: energy
    state_class: total_increasing
    filters:
      - multiply: 0.001

For example, a constant 6 W load running for two hours uses about 12 Wh, or 0.012 kWh. The restore: true setting can preserve the running total through an ordinary ESP32 reboot but cannot measure consumption while the device itself is unpowered. Persistent writes also cause flash wear, particularly if you publish measurements extremely frequently. An always-on installation and sensible update interval are better than treating the monitor as a revenue-grade energy meter.

The example assumes power never becomes negative. A bidirectional battery circuit can charge and discharge, so its signed or net power may decrease the integrated total; that is not a valid monotonically increasing consumption entity. For such a system, make separate non-negative import/export power sensors with appropriately verified signs, integrate them separately, and only then configure corresponding Home Assistant energy statistics. If you need actual accumulated charge (Ah) from the measurement chip itself, see the INA228 rather than expecting the INA260 to provide that hardware counter.

Home Assistant’s energy dashboard also checks unit, device class, state class and long-term statistics. If an energy entity does not appear as an available source, inspect its statistics/recorder status and confirm it represents the correct physical quantity. Do not label raw bus voltage, current or instantaneous power as “energy” simply to make a dashboard accept it.

A low-current alert that does not confuse Wi-Fi outages with zero current

A simple use case is an equipment cabinet where the monitored device should draw a small but nonzero standby current. You might want a notification if a pump controller draws near-zero current during a commanded run. However, zero reported current and an unavailable ESPHome sensor are different conditions. A dashboard should show loss of telemetry distinctly; treating unavailable data as zero can create false alarms or hide a failed monitor.

For an automation, use a condition that the equipment is known to be commanded on, the current entity is available, and its value remains below a chosen, empirically measured threshold for several update periods. A short timeout is unreliable for intermittently operating equipment, and a value that is suitable for one load may be meaningless for another. For critical dry-run or overcurrent protection, use a purpose-built hardwired protective device rather than relying on Wi-Fi, Home Assistant and a 10-second monitoring loop.

Troubleshooting: no I²C device, wrong readings and offline nodes

SymptomMost useful check
ESPHome finds no 0x40Confirm breakout logic supply and ground; SDA/SCL mapping; scanner logs; address jumpers; and 3.3 V pull-up level.
0x40 appears, current stays around zeroConfirm the load’s positive current actually passes through VIN+ then VIN− and the circuit is energised.
Current is negative when you expected positiveCheck actual current direction; do not invert without understanding whether the source and load can swap roles.
Bus voltage is wrong but current looks plausibleCheck the breakout’s VBUS connection and where in the circuit voltage is sensed; compare with a meter at that point.
Values jump around with a motor or PWM loadKeep I²C away from high-current conductors; verify grounding and supply; compare steady loads and use appropriate filtering/averaging.
INA260 works at low current but overheats at higher currentDe-energise; inspect terminal, wire, PCB and enclosure current/temperature ratings; do not assume the IC rating applies to the entire assembly.
Energy counter decreases or becomes unsuitable for the Energy dashboardConfirm sign conventions; a reversible charge/discharge path requires separate non-negative energy channels.
Home Assistant shows unavailable after installationCheck ESP32 power, Wi-Fi signal, logs, API connectivity and whether the sensor was configured in the correct ESPHome node.

If the device stops responding after installation, return to the minimal three-sensor configuration and test at the bench. Do not “fix” a missing INA260 by arbitrarily changing its address: the address is set by physical pins or solder jumpers on the board. Some breakout manufacturers use a different default or label; read the specific PCB documentation and compare against what ESPHome’s I²C scanner actually detects.

INA260, INA226, INA3221 or INA228: which belongs in this project?

Choose the INA260 when you want one DC current path, a convenient integrated shunt and straightforward current/voltage/power readings within the rating of the full breakout assembly. Choose an INA226 when you need to pick an appropriate external shunt and measurement range. Choose an INA3221 to monitor three separate DC channels within its own electrical limits. Choose an INA228 when higher-resolution measurements and chip-side charge/energy accumulation are relevant. The integrated shunt makes setup simpler, not universally more accurate or suitable for more current.

For low-voltage battery monitoring, remember that an INA260 measures what is flowing now. It does not know the battery’s rated capacity, temperature-adjusted available capacity, ageing, charge efficiency or its state-of-charge starting point. Battery percentage requires a separate model, fuel-gauge device or a properly commissioned coulomb-counting strategy. Conversely, a fuel gauge alone cannot tell you the instantaneous power of a separate DC appliance if the measurement topology does not include that appliance.

Practical build checklist

  • Test first with a low-current, fused DC load and a known-good meter; establish the sign of current through VIN+ and VIN−.
  • Power the INA260 logic side from 3.3 V, confirm all I²C pull-ups are 3.3 V-safe and select ESP32 pins that are actually available on your board.
  • Route only the load’s intended current through the sensor’s high-current terminals. Keep that current off the ESP32, breadboard and small jumper wires.
  • Verify the complete circuit’s voltage/current/thermal limits; the 15 A IC-shunt figure is not a guarantee about an anonymous breakout or enclosure.
  • Publish current, bus voltage and power before adding derived energy. Add a total_increasing energy sensor only for a genuinely non-negative consumption channel.
  • Retain a wired protective device for any safety-critical current limit; Home Assistant alerts are monitoring, not guaranteed fault protection.

Further reading and component documentation

Share your love