
Small Wind Turbine MPPT with ESP32 - Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the Small Wind Turbine MPPT with ESP32 - Proteus Simulation, the sixty-ninth project of our IoT Projects series. If you have searched for wind turbine maximum power point tracking, an ESP32 MPPT controller, the tip speed ratio and the power coefficient of a small turbine, or a Proteus simulation of a wind generator with its load, here is a complete one. A small DC wind turbine gives its most power only into the right load, and the right load changes with every change of the wind. Here an ESP32 finds it by itself: it measures the turbine's voltage and current with an INA219, switches four 27 ohm cement resistors in and out with a relay module, and climbs to the load that takes the most power, with no wind sensor at all.
A solar panel has its famous maximum power point; a wind turbine has one too, and it moves faster. Too light a load and the rotor races at a high tip speed ratio, letting most of the wind slip through; too heavy and the generator holds the rotor back until it stalls. In this tutorial, we will go through the circuit, see how much power the wind carries, what the tip speed ratio and the power coefficient mean, why the best load falls as the wind rises, how to read the rotor's speed from the generator itself, and how perturb and observe tracking works on a bank of four resistors. Then we run the simulation at 5, 7 and 10 m/s, and back. At the end, you can download the project with the sketch and every library file.
NOTICE: Our team has put a lot of effort into this project: the circuit, the code and every part in the simulation are our own work, and you get them all free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below. And if our free projects help you, you can buy us a coffee. So, let's get started with the small wind turbine MPPT with ESP32 in Proteus simulation:
What Does This Wind Turbine MPPT Do?
- Measures the turbine: an INA219 in the turbine's + lead reads the voltage and the current; the ESP32 reads it 20 times a second and multiplies them into power.
- Switches the load: a 4-channel relay module puts one, two, three or four 27 ohm 10 W cement resistors across the turbine: 27, 13.5, 9 or 6.8 ohm.
- Finds the best load by itself: perturb and observe - one resistor more or less, wait for the rotor to settle, keep the change if the power rose, undo it if it fell.
- Needs no wind sensor: it never knows the wind speed; it only climbs the hill of power.
- Reads the rotor's speed from the generator: the generator's own voltage and current give its speed in RPM, with no tachometer.
- Protects the turbine: never less than one resistor on, a lighter load above 2.8 A, all four on if the voltage runs away.
- Shows it all: a 0.91" OLED and a dashboard on a laptop or a phone with the power, the load, the RPM and the energy.
It is a great project for learning how a wind turbine turns wind into electricity, why the load matters so much, and how a simple search finds an optimum it cannot see. In the simulation, the turbine's pop-up is the independent judge: it shows the wind, the rotor's speed, the tip speed ratio and the power coefficient, and draws the rotor's power curve with the best point marked and a dot for where the turbine runs now.
Components Used in the Proteus Simulation
All the parts come from our Proteus libraries, each with its own tutorial. The project zip at the end includes every LIB and DLL file.
| Part | Proteus device | Library post | Connection |
|---|---|---|---|
| ESP32 DevKit V1 | ESP32 DEVKIT V1 | ESP32 DevKit V1 Library for Proteus | U1, ESP32_Wind_MPPT.hex, TEP-WiFi 192.168.1.101 |
| Small wind turbine | WINDTURBINETEP | Wind Turbine Generator Library for Proteus | WT1: + to VIN+ of U2, - to GND |
| INA219 current sensor | INA219ADVTEP | INA219 Current Sensor Library for Proteus | U2, I2C at 0x40: VIN+ the turbine, VIN- the bank |
| 4-channel relay module | RELAY4ADVTEP | Relay Module Library for Proteus | RLY1: IN1 - IN4 on D25, D26, D27, D14 |
| 27 ohm 10 W cement resistors (x4) | RESISTORPOWER10WTEP | Power Resistor Library for Proteus | R1 - R4, from NO1 - NO4 to GND |
| SSD1306 OLED 0.91" 128x32 | OLED12832WHITEADVTEP | OLED 128x32 Library for Proteus | OLED1, I2C at 0x3C |
| Laptop WiFi Monitor | LAPTOP WIFI MONITOR | Laptop WiFi Monitor | PC1 |
| Mobile WiFi Monitor | MOBILE WIFI MONITOR | Mobile WiFi Monitor | MOB1 |
Proteus Simulation of the Wind Turbine MPPT: the Circuit
| Part | Pins | ESP32 / supply |
|---|---|---|
| WT1 turbine | + / - | the net WT / GND |
| U2 INA219 | VIN+ / VIN- | WT / LOAD |
| U2 INA219 | SDA / SCL / VCC | D21 / D22 / +3.3V |
| RLY1 relays | IN1 / IN2 / IN3 / IN4 | D25 / D26 / D27 / D14 (LOW = on) |
| RLY1 relays | VCC / JD-VCC | +5V |
| RLY1 relays | COM1 - COM4 / NO1 - NO4 | LOAD / R1 - R4 to GND |
| OLED1 | SDA / SCL / VCC | D21 / D22 / +3.3V |
The power path is the heart of the sheet: from the turbine's + through the INA219's 0.1 ohm shunt to the four relay contacts, and from each normally-open contact through its own resistor to ground. The turbine's - goes straight to ground, so the INA219 sees the full turbine current on the high side. Its bus voltage is measured at VIN-, after the shunt, so the turbine's own voltage is the bus voltage plus the shunt voltage. The relay module's VCC and JD-VCC need a real 5 V supply, because they feed the relay coils; a plain net label would leave them without power in the simulation. The INA219 and the OLED share the I2C bus on D21 and D22.
How the Wind Turbine MPPT Works
The Power in the Wind
Moving air carries kinetic energy, and the power flowing through a rotor of area A is one half of the air's density times A times the wind speed cubed. The cube is the important part: twice the wind brings eight times the power. Worked example for this turbine's 0.5 m rotor: A = pi x 0.25 squared = 0.196 square metres, so at 5 m/s the wind carries 0.5 x 1.225 x 0.196 x 125 = 15.0 W, and at 10 m/s 120 W. No rotor can take all of it: the Betz limit says at most 59.3 %, and a small hobby rotor manages much less.
Tip Speed Ratio and Power Coefficient
The share a rotor takes is its power coefficient, Cp, and it depends on one number: the tip speed ratio, lambda = the speed of the blade tips divided by the wind speed. This turbine reaches its best, Cp = 0.25, at lambda = 4, and gives nothing both at standstill and at lambda = 8, where it runs away freely. Worked example at 5 m/s: the best rotor speed is lambda x v / r = 4 x 5 / 0.25 = 80 rad/s, 764 RPM, and the rotor then takes 0.25 x 15.0 = 3.75 W. At 10 m/s the best speed doubles to 1528 RPM, and the rotor takes 30 W. So the best rotor speed is proportional to the wind; the controller's job is to hold the rotor near it.
Why the Best Load Changes with the Wind
The rotor's speed is set by a balance: the wind's torque on the blades against the generator's torque, which grows with the current the load draws. This generator gives 0.10 V per rad/s and brakes with 0.10 N.m per ampere, behind its winding's 1.5 ohm. Worked example at 5 m/s and lambda = 4: the EMF is 0.10 x 80 = 8.0 V; the rotor's torque is 3.75 W / 80 rad/s = 0.047 N.m, so the current must be 0.47 A; the whole circuit is then 8.0 / 0.47 = 17.1 ohm, and the load 15.6 ohm. At 10 m/s: EMF 16 V, torque 0.19 N.m, current 1.88 A, circuit 8.5 ohm, load 7.0 ohm. The best load roughly halves when the wind doubles: a fixed resistor can be right at one wind speed only. With four 27 ohm resistors the bank offers 27, 13.5, 9 and 6.8 ohm, so two resistors suit a light wind and three or four a strong one.
The Rotor Speed Without a Sensor
A DC generator is also a tachometer: its EMF is proportional to its speed. The terminals show the EMF minus the drop in the winding, so EMF = V + I x 1.5 ohm, the speed in rad/s is EMF / 0.10, and times 60 / (2 pi) gives RPM. Worked example from the probe run: 8.69 V and 0.32 A give 8.69 + 0.48 = 9.17 V, 91.7 rad/s, 876 RPM; the turbine's pop-up showed 876 RPM. The winding warms with use, and its resistance with it, so the estimate drifts a little at high currents.
Perturb and Observe on Four Resistors
Perturb and observe is the simplest maximum power point tracker: change the load a little, see whether the power rose, and keep going the same way if it did, or turn back if it fell. On a bank of four resistors the steps are coarse, so the program adds a rest: after a change that made things worse it goes back to the best load and stays there for two steps before trying again, which keeps it at the top most of the time instead of wobbling around it. The ESP32 never knows the wind speed. If the wind changes, the next tries find that a neighbour now gives more, and the search walks there by itself.
Waiting for the Rotor
A rotor has inertia, and after a load change it needs time to find its new speed. In the first probe run, after one resistor went off, the rotor went from 662 RPM to 826 RPM in 3 s, 866 RPM in 6 s and 875 RPM in 9 s: a time constant of about 2.2 s. That matters for the search, because while the rotor slows down it releases stored energy and looks briefly more powerful than it is, and while it speeds up it looks weaker. The first version, with 3-second steps, made exactly those mistakes. The final program waits 6 s after each change, three time constants, and then averages the power over 2 s; a step takes 8 s.
Limits: Current, Runaway and the Resistors
Three limits protect the turbine and the bank. The generator is rated at 3 A, so above 2.8 A the program takes one resistor off: the load gets lighter, the rotor speeds up and the current falls. If the voltage ever passes 30 V, the rotor is running away, and all four resistors go on at once. The program never switches all the resistors off, because an unloaded turbine in a strong wind races until it is damaged. And the bank itself has a limit: a 10 W resistor can take 16.4 V at 27 ohm. At 10 m/s with three resistors on, each carries about 15 V and 8.5 W, inside its rating; at 13 m/s the turbine could give over 50 W, more than four 10 W parts should carry, so a real 13 m/s site needs a bigger dump load. The simulation stays at 10 m/s and below.
The Arduino Code Explained
The sketch is ESP32_Wind_MPPT.ino, written in the Arduino IDE for the ESP32 DevKit V1. It talks to the INA219 directly through Wire, uses WiFi and WebServer for the dashboard and Adafruit SSD1306 for the OLED. The turbine's numbers, from its datasheet:
const float R_EACH = 27.0, R_SHUNT = 0.1, K_GEN = 0.10, R_GEN = 1.5; // ohm, ohm, V per rad/s, ohm (the turbine's datasheet)
The INA219: a 32 V bus range, +-320 mV across the shunt, continuous conversions:
ina(0x00, 0x399F); // 32 V bus, +-320 mV shunt, 12-bit, continuous
The turbine's voltage and current: the bus voltage is measured after the shunt, so the shunt's drop is added back. The bus register is unsigned: the first final run read it as a signed number, and every voltage above 16.4 V came out negative:
float shunt = inaRead(0x01) * 0.00001; // 10 uV a step
float bus = ((uint16_t)inaRead(0x02) >> 3) * 0.004; // 4 mV a step (UNSIGNED: final 1 read 16.4 V and up as negative)
v = max(bus + shunt, 0.0f);
The rotor speed from the generator's EMF:
rpm = (v + i * R_GEN) / K_GEN * 9.549; // EMF / k = rad/s; x 60 / (2 pi)
The load: the first k relays on (their inputs are active LOW), the others off:
for (int j = 0; j < 4; j++) digitalWrite(RELAY[j], j < n ? LOW : HIGH);
The timing: an 8-second step, the first 6 seconds for the rotor to settle:
const unsigned long STEP_MS = 8000, SETTLE_MS = 6000, SAMPLE_MS = 50; // (the rotor settles with a ~2.2 s time constant: probe 1's
Only the last 2 seconds of each step count:
if (now - stepT >= SETTLE_MS) { sumP += p; sumV += v; sumI += i; cnt++; } // the last 2 s of the step only
The current limit comes first in every step:
if (iAvg > I_MAX && n > 1) { // the generator's current limit: a lighter load (it speeds up)
Worse than the step before: back, and rest there:
note(s); dir = -dir; setLoad(n + dir); best = n; hold = HOLD_STEPS; pPrev = -1; return;
At either end of the bank the search turns round:
if ((dir > 0 && n == 4) || (dir < 0 && n == 1)) dir = -dir; // at an end of the bank: turn round
The runaway guard, checked at every reading, not only once a step:
if (v > V_RUNAWAY + 3 && n < 4) { note(F("RUNAWAY - all four resistors on")); setLoad(4); }
The energy, added up at every reading:
energy += p * SAMPLE_MS / 1000.0; // joules
The serial monitor gets one line per step: the load, the volts, the amps, the power, the RPM and the decision. The OLED shows the load, the power, the RPM, the energy and whether the tracker is searching or at the best load. The pages are / (the dashboard) and /data (JSON), served from one handler.
How to Run the Proteus Simulation
- Download the project zip below and install the library files (the steps are under the download button).
- Open ESP32-Wind-MPPT.pdsprj from the Proteus Simulation folder. Keep the HEX file and the DLL files next to it.
- Press Play. The wind is 5 m/s; the ESP32 starts with one resistor and finds the best load in a few steps.
- On the turbine's pop-up (WT1) press 7, then 10 m/s, and watch the tracker follow; then 5 again.
- Compare the turbine's tip speed ratio and Cp on its pop-up with the best values, 4 and 0.25.
- Open the Laptop or the Mobile WiFi Monitor and press Go for the dashboard.
Simulation Results: the Wind Turbine MPPT in Proteus
Here is the run that made the screenshots of this tutorial: 5 m/s, then 7 and 10 m/s, and back to 5. The times are the sketch's own clock, as it printed them on the serial monitor, one line for every 8-second step; the turbine's pop-up shows its own tip speed ratio, Cp and power for comparison.
5 m/s: Two Resistors
The ESP32 starts with one resistor. At 10.3 s: "1 x 27 ohm (27.0 ohm): 8.6 V 0.32 A 2.7 W, 871 RPM - try 2". With two: "6.3 V 0.46 A 2.9 W, 663 RPM - better: on to 3". With three: "4.9 V 0.54 A 2.6 W, 542 RPM - worse than 2.9 W: back". So two resistors, 13.5 ohm, are the best of the bank at 5 m/s, just as the worked example said: the best load at 5 m/s is about 15.6 ohm, between 13.5 and 27, and 13.5 ohm is the closer. The three powers, 2.7, 2.9 and 2.6 W, differ by only a few percent: near its top the power curve is very flat, which is why the patient 6-second settling matters. The turbine's pop-up, with one resistor in the probe run, showed the whole energy budget: 15 W in the wind, 3.7 W taken by the rotor, 2.7 W reaching the load; the rest heats the winding, the bearings and the cogging.
7 m/s: Still Two
7 m/s at 40.6 s. The tracker is resting, and its readings show the rotor speeding up with the wind: 704 RPM, then 1124 RPM and 8.2 W. Its next try goes the other way, to one resistor: "1 x 27 ohm (27.0 ohm): 14.1 V 0.52 A 7.3 W, 1425 RPM - worse than 8.2 W: back". At 7 m/s the best load is about 10.7 ohm, and 13.5 ohm is still the closest the bank offers, so the tracker settles on two resistors again at 8.4 W.
10 m/s: Three Resistors
10 m/s at 70.8 s. On two resistors the rotor climbs to 1900 RPM and 23.6 W, and the tracker's next try is a heavier load: "3 x 27 ohm (9.0 ohm): 14.9 V 1.63 A 24.2 W, 1652 RPM - better: on to 4". Four: "12.7 V 1.85 A 23.5 W, 1477 RPM - worse than 24.2 W: back". After its rest it tests two once more, "17.9 V 1.32 A 23.6 W - worse than 24.2 W: back", and stays on three. The turbine's pop-up agrees in every number: 24.2 W at 14.9 V and 1.63 A, 1654 RPM against the ESP32's own estimate of 1652 RPM, a tip speed ratio of 4.3 and Cp 0.25, the top of the curve. Its energy budget: 120 W in the wind, 29.9 W taken by the rotor, 24.2 W to the load. Each resistor carries 14.9 V, 8.2 W, inside its 10 W rating.
Back to 5 m/s: the Search Walks Home
5 m/s again at 144 s, with three resistors still on: the rotor slows to 547 RPM and gives 2.7 W. Perturb and observe does not know which way the best load lies, and its first try goes the wrong way: "4 x 27 ohm (6.8 ohm): 4.0 V 0.58 A 2.3 W, 465 RPM - worse than 2.7 W: back". After its rest it tries the other side: "2 x 27 ohm (13.5 ohm): 6.2 V 0.46 A 2.8 W - better: on to 1", then "1 x 27 ohm: 2.7 W - worse than 2.8 W: back", and it is home on two resistors at 2.9 W, the same as at the start of the run, with a tip speed ratio of 3.5 and Cp 0.25 on the turbine's pop-up. A wrong first guess costs only a few steps. The dashboard counts 0.64 Wh harvested in the 215 seconds of the run.
| Wind | One (27 ohm) | Two (13.5 ohm) | Three (9 ohm) | Four (6.8 ohm) | The tracker chose |
|---|---|---|---|---|---|
| 5 m/s | 2.7 W, 871 RPM | 2.9 W, 663 RPM | 2.6 W, 542 RPM | 2.3 W | two (TSR 3.5, Cp 0.25) |
| 7 m/s | 7.3 W, 1425 RPM | 8.4 W, 1132 RPM | - | - | two (TSR 4.2, Cp 0.25) |
| 10 m/s | - | 23.6 W, 1902 RPM | 24.2 W, 1652 RPM | 23.5 W, 1476 RPM | three (TSR 4.3, Cp 0.25) |
Download the Project Files
Click the button below to download Small-Wind-Turbine-MPPT-ESP32-Proteus-Simulation-v1.0.zip (about 4.5 MB, without the source code of the models):
Small Wind Turbine MPPT with ESP32 - Proteus Simulation V1.0- Proteus Simulation: ESP32-Wind-MPPT.pdsprj, ESP32_Wind_MPPT.hex and copies of the models.
- Arduino Code: ESP32_Wind_MPPT.ino, the sketch.
- Proteus Library Files: the LIB files of the ESP32 DevKit V1, the wind turbine, the INA219, the relay module, the power resistor, the OLED and the two WiFi Monitors.
- Proteus Model Files: the DLL models.
- README.txt: the installation steps, the properties, the test results and the links to every library post.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install the Project Files
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Start Proteus and open the project from the Proteus Simulation folder.
Changing the Code
Open ESP32_Wind_MPPT.ino in the Arduino IDE with the TEP boards for Proteus installed, compile it, export the compiled binary and set U1's PROGRAM property to the new HEX file. The resistor value, the generator's constants, the limits, the step and settle times and the rest length are at the top. In WT1's properties, WIND sets the wind at the start and GUSTS adds gusts as a percentage.
Ideas to Extend the Project
- Replace the relays with a MOSFET and PWM for a smooth load instead of four steps, and compare the energy over the demo wind.
- Add the cup anemometer and control the tip speed ratio directly, holding lambda at 4 instead of searching.
- Charge a battery through a buck converter instead of heating resistors, and track the power into the battery.
- Make the step adaptive: small and patient near the top, bold when the power changes a lot.
- Log the power curve: the best power found at each wind speed, against the 0.25 x wind power line.
- Add a brake: short the generator through a small resistor in a storm, and release it when the wind drops.
From Simulation to Real Hardware
- Size the dump load: the resistors must take the turbine's full power at the highest wind you expect, with margin; cement resistors run hot by design, so mount them on metal and away from anything that burns.
- Mind the relay contacts: DC is hard on contacts; switching a few amps at 20 V is fine for these relays, but a larger turbine needs MOSFETs.
- Real wind is gusty: average longer, or the search chases gusts instead of the best load.
- Keep a hardware brake: software can hang; a real turbine needs a way to stop that does not depend on the ESP32.
- Calibrate the generator: measure its volts per rad/s and its winding resistance once, and the RPM estimate stays good.
Troubleshooting
- The relays never click: their VCC and JD-VCC need a real 5 V supply (+5V), not a net label.
- The power reads 0: the turbine's + must go through the INA219 (VIN+ to VIN-) to the relays' COM pins.
- The search wobbles: give the rotor more time to settle (SETTLE_MS) before each judgement.
- A resistor glows: the bank is too small for the wind; use more or bigger resistors.
- The OLED stays blank: SDA / SCL on D21 / D22, address 0x3C, VCC on 3.3 V.
Limitations of the Simulation
- The turbine is the library's model: a smooth power curve with its best at a tip speed ratio of 4, a DC generator, friction and inertia, but no turbulence beyond its GUSTS setting.
- The resistors heat in the model, but the circuit uses their cold resistance; a real hot resistor changes a little.
- The network to the laptop and the phone is simulated inside Proteus.
- ESP32 is a product of Espressif Systems; this project is not made or endorsed by them or by Labcenter.
So, that was all about the Small Wind Turbine MPPT with ESP32 - Proteus Simulation. I hope it helps you understand how much power the wind carries, what the tip speed ratio and the power coefficient mean, why the best load follows the wind, how a generator tells its own speed, and how a patient perturb and observe search finds the best load with no wind sensor at all, all tested in a simulation before you put up a real turbine. More IoT projects with the ESP32 and the Raspberry Pi 5 are coming in this series. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!






















Comments
0