MPPT: perturb and observe
A solar panel gives its most power at one point on its I–V curve. The ESP32 measures the panel’s voltage and current, nudges the load (the PWM duty on a dump resistor) one step, and checks whether the power went up. If not, it reverses. It settles hunting around the maximum power point.

Open this lesson in the labFree, in your browser, no account needed.
How it works
At 850 W/m² this panel’s maximum power point is 15.5 W at 17.0 V (910 mA).
The load the panel sees is R ÷ D: the tracker finds D ≈ 54 % to make it 18.7 Ω.
The PWM switch is simulated as its average, so the dump resistor’s own reading shows less heat than it really gets.
Try it on the bench
- Set the panel to 400 W/m² (a cloud): the power drops and the tracker walks to the new peak.
Parts on the bench
- Bench power supply
- ESP32 DevKit
- USB charger / port
- Solar panel
- INA219 current sensor
- N-channel MOSFET
- 3 × Resistor
- Electrolytic capacitor
In the course
Solar PV Systems, module “6 · Charge controllers: PWM and MPPT”.