Solar Energy Monitoring and Control System with ESP32
Intermediate11/6/2026- Author: IoTSpark Maker

Solar Energy Monitoring and Control System with ESP32

Build a low-voltage DC model using an ESP32 to measure solar voltage, current, and power, monitor a battery, and control a DC load over MQTT.

ESP32Solar EnergyMQTTINA219IoTDC PowerEnergy Monitoring
6 steps9 components
← Back to project
Detailed guide

Part 1: System Overview

Introduces the low-voltage DC model's architecture and the role of the ESP32, INA219, charge controller, storage battery, DC load, and MQTT.

Updated 31/08/2026

Part 1: System Overview

The Solar Energy Monitoring and Control System with ESP32 is an educational engineering model for measuring the DC source from a solar panel, tracking a storage battery, and controlling a small DC load. The project's focus is understanding the energy flow correctly, how to measure voltage, how to measure current, and how to send data to MQTT for remote monitoring.

The model includes a solar panel, a solar charge controller, a protected storage battery, an ESP32, an INA219 sensor, a voltage divider, a 5V buck converter, and a DC load control module.

⚠️ This lesson's scope is limited to low-voltage DC systems under 24V. Do not connect 220V AC mains power, an inverter, a grid-tied system, or a high-voltage solar panel string.

Main Operating Flow

BlockFunction
Solar panelGenerates DC voltage when exposed to light.
INA219Measures bus voltage, current, and power on the monitored line.
Solar charge controllerManages the battery-charging process, matched to the battery type.
Storage batterySupplies power to the ESP32 and the DC load as needed.
ESP32Reads the sensor, applies safety thresholds, sends data, and receives MQTT commands.
Relay or MOSFET moduleSwitches the small DC load on/off per the ESP32's command.

Goals After Completion

GoalExpected Outcome
Measuring energyCan read voltage, current, and power from the INA219.
Measuring the batteryCan compute battery voltage from the voltage divider.
Controlling the loadCan switch the DC load on/off in AUTO or MANUAL mode.
IoT connectivityCan send telemetry and receive control commands over MQTT.
Basic safetyAutomatically cuts the load when battery voltage is low, and alerts via MQTT.

Technical Limits to Remember

The INA219 is suited to measuring current and power within a low bus-voltage range. The ESP32 must never read a 6V, 9V, or 12V battery voltage directly at its ADC pin. To measure the battery via the ADC, use a voltage divider and check the voltage at the ADC pin with a multimeter before connecting.