Multi-Channel Solar and Battery DC Power Monitor with ESP8266 and INA3221

A 3-channel DC power monitor using an ESP8266 and an INA3221 sensor to track solar generation, battery current, and load consumption while respecting PWM charge controller grounding.

Illustration for: Multi-Channel Solar and Battery DC Power Monitor with ESP8266 and INA3221
AI-generated illustration
WorkingIntermediateFor: maker

About this project

This project monitors power production, battery storage, and consumption in low-voltage off-grid setups using an ESP8266 microcontroller and an INA3221 triple-channel I2C sensor running ESPHome. By inserting current shunt resistors into separate branches, the system simultaneously tracks photovoltaic generation, load consumption, and net battery charge or discharge current. It addresses a frequent and dangerous design flaw in common PWM solar charge controllers: because these devices regulate charging by disconnecting the negative solar lead, sharing a common ground across all negatives creates an unintended bypass that prevents charging shutoff. The monitor is powered safely from the controller load terminal and publishes real-time telemetry to Home Assistant for power budgeting.

What you need

  • ESP8266 development board
  • INA3221 3-channel I2C current and voltage sensor module
  • PWM solar charge controller
  • 12V lithium-ion battery pack
  • DC-DC step-down buck converter (12V to 5V)
  • DC inline fuses
  • Home Assistant server

Highlights

  • Identified and resolved charging cutoff failure by isolating negative solar panel leads from the common ground bus.
  • Measures solar input, load output, and net battery charge/discharge simultaneously across three INA3221 channels.
  • Powers the microcontroller from the charge controller load terminal to safeguard the battery against over-discharge.

Built with

ESP8266ESPHomeINA3221Home AssistantI2C