Hardware Matrix

Is INA219 DC Voltage & Current Sensor Compatible with Home Assistant (ESPHome)?

Verdict Badge
VERDICT: [ COMPATIBLE (MANUAL CONFIG REQUIRED) ]
Protocol: I2C Bus / 3.3V
Bridge Needed: NO

Electrical Specifications

Always confirm pin assignments against the manufacturer datasheet before wiring.

Not yet documented. Electrical specifications for this device have not been confirmed against a manufacturer datasheet, so none are shown here rather than showing estimates. Submit verified specifications if you have the datasheet to hand.

Compatibility Overview

High-precision DC power monitoring sensor for solar panels battery banks and 12V automotive circuit telemetry.

Wiring INA219 DC Voltage & Current Sensor to ESP32

Module pin ESP32 Note
VCC 3V3 Powers the chip. Independent of the circuit being measured.
GND GND Must be common with the circuit under measurement — see the gotchas.
SDA GPIO21
SCL GPIO22
VIN+ supply side of the load The positive lead is cut and the shunt inserted: supply into VIN+, out of VIN− to the load. High-side sensing.
VIN− load side
A0 / A1 open Solder jumpers. Both open is 0x40; bridging them selects up to 0x4F.

Host pins are the ones the configuration on this page uses. Move a pin here and change it in the YAML — they are documented together so they cannot disagree.

Technical Specification Matrix

Feature / Attribute Specification / Status
Hardware Protocol I2C Bus / 3.3V
Bridge Required NO
Border Router Needed None
Hardware Capabilities & Peripherals
Bus Voltage (V) Shunt Voltage (mV) Current (mA) Power (W)

Note: these entities come from the ESPHome configuration you flash — each one needs its matching component in that YAML before it appears.

Pairing Complexity Intermediate
Factory Reset Instruction Hold BOOT button for 2s.

Wire, Flash, Adopt, Check

1

Wire it up

Follow the wiring table above. The ESP32 pins there are the ones the configuration uses, so if you move one, change it in both places.

2

Flash the configuration

Create a new device in the ESPHome dashboard (the Home Assistant add-on) and paste the configuration below into it, or save it as emb_esp32_ina219_esphome.yaml and run esphome run emb_esp32_ina219_esphome.yaml. The first flash goes over USB. If it is not detected, hold BOOT button for 2s to put it in download mode. Every update after that is over the air.

3

Adopt it in Home Assistant

Settings → Devices & Services. A node on the same network shows up as a discovered ESPHome device within a minute of joining Wi-Fi; choose Configure and enter the API encryption key from your secrets.yaml. If discovery does not find it, add the ESPHome integration by hand with the node's IP address.

4

Check it works

The I2C scan lists 0x40, Bus Voltage matches a multimeter on the load, and Current matches with a known load (a 12V, 5W bulb reads about 0.4A). A current that is exactly ten times out is the shunt value; a bus voltage of zero with a load running is VIN+ and VIN− on the wrong sides of the cut.

ESPHome Configuration

Starting configuration for INA219 DC Voltage & Current Sensor on ESP32. Untested on hardware — verify wiring and pins against your own board.

# ESPHome configuration for INA219 DC Voltage & Current Sensor
# Host: ESP32. Pin numbers below are host-side defaults — any free
# GPIO will do, and you should change them to match your own wiring.

esphome:
  name: emb_esp32_ina219_esphome
  friendly_name: "INA219 DC Voltage & Current Sensor"

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

logger:

api:
  encryption:
    key: !secret api_encryption_key

ota:
  - platform: esphome
    password: !secret ota_password

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

i2c:
  id: i2c_main
  sda: GPIO21
  scl: GPIO22
  scan: true

# A0/A1 strapping puts this anywhere in 0x40-0x4F; 0x40 is both pins low.
# shunt_resistance must match the resistor actually fitted to your board —
# 0.1 ohm is the common value but 0.01 ohm boards exist, and a wrong value
# gives readings that look plausible and are silently 10x out.
sensor:
  - platform: ina219
    address: 0x40
    shunt_resistance: 0.1 ohm
    max_voltage: 32.0V
    max_current: 3.2A
    current:
      name: "Current"
    power:
      name: "Power"
    bus_voltage:
      name: "Bus Voltage"
    update_interval: 60s

Before you flash: the !secret values come from your secrets.yaml, and the GPIO numbers are host-side defaults rather than properties of this part — change them to match how you actually wired it.

If the device is not found: it is usually the I2C address, not the config. Many breakouts strap their address with solder jumpers, so two boards of the same part can differ. This config leaves scan: true on — the boot log lists every address actually present on the bus, and you can copy the right one from there.

What Appears in Home Assistant

Bus Voltage
sensor

Measured at VIN−, relative to GND. Up to 26V.

Current
sensor

Through the shunt, signed: negative when it flows from VIN− to VIN+.

Power
sensor

Watts. Feed it to a total_daily_energy sensor to get kWh for the Energy dashboard.

Known Problems and Fixes

The shunt value is everything

The 0.1Ω shunt on the common module gives ±3.2A. shunt_resistance in the config must match the resistor actually on the board (it is marked R100 for 0.1Ω, R010 for 0.01Ω); a wrong value produces readings that look plausible and are out by exactly ten times. Swapping the shunt for a lower value raises the current range and the max_current setting with it.

Common ground, positive rails only

The INA219 measures the voltage at VIN− against its own GND, so the circuit it monitors must share ground with the sensor, and the bus voltage must be positive and under 26V. It cannot monitor a floating rail or a negative supply.

0x40 is shared

The HTU21D sits at 0x40 too. Bridge A0 on the INA219 (0x41) if both are on one bus.

Small currents are noisy

Twelve bits across 3.2A is about 0.8mA per step, and the bottom few steps are noise. For a sleeping battery device drawing microamps this is the wrong part; the INA226 has sixteen bits.

It is in the supply path

The shunt carries the load current. The module's screw terminals and traces are good for the rated 3.2A; do not route a motor stall current through them.

Shares I²C address 0x40

These parts default to the same address. At least one can be re-strapped, so they can coexist once you change it:

A0/A1 strapping selects 0x40-0x4F. Check a full build in the planner

🛠️ Hardware Correction & Field Contributions

Report a Pinout Error or Submit Tested Code Snippets

Found a pin mapping quirk or built a custom ESPHome YAML driver for INA219 DC Voltage & Current Sensor? Submit a pull request or report corrections to our index.

Frequently Asked Questions

Does INA219 DC Voltage & Current Sensor work without an internet connection?
100% local I2C sampling.
How is INA219 DC Voltage & Current Sensor powered and wired to the host board?
3.3V VCC for IC SDA=GPIO21 SCL=GPIO22; load up to 26V DC 3.2A max.
How does the host board reach Home Assistant (ESPHome)?
Wi-Fi 2.4GHz.

Alternatives

Related Compatibility Matrix Guides