Monitor your vertical or horizontal axis wind turbine with this Arduino-based data logger. Measure rotational speed (RPM), generated voltage, and output power in real-time. Data is displayed on a 20x4 LCD and can be logged to an SD card for long-term performance analysis.
Unlike solar panels, wind turbines are mechanical and produce variable AC or DC depending on wind speed. This monitor uses an Interrupt-based RPM counter and a Bilateral Current Sensor to track how much energy your turbine is actually contributing to your system.
We use a magnet mounted on the turbine shaft and a Hall-effect sensor. Every rotation triggers an interrupt on the Arduino, allowing us to calculate speed with extremely high precision even in gusty conditions.
| Peripheral | Device Pin | Arduino Pin | Notes |
|---|---|---|---|
| RPM Sensor | Out | Digital 2 | Using INT0 for speed |
| Turbine Voltage | Out | Analog A0 | Scaled DC voltage |
| Charge Current | Out | Analog A1 | ACS712 (30A) |
| OLED Display | SDA / SCL | A4 / A5 | I2C Interface |
| Brake Relay | In | Digital 7 | Emergency stopping |
High winds can spin a turbine to destructive speeds. The code includes a safety feature that activates a "Brake Relay" (shorting the turbine phases) if the RPM exceeds your defined safe limit.
volatile int revs = 0;
unsigned long timeold = 0;
float rpm = 0, volts = 0, amps = 0, watts = 0;
void count_rev() {
revs++;
}
void setup() {
pinMode(2, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(2), count_rev, FALLING);
pinMode(7, OUTPUT); // Brake Relay
digitalWrite(7, LOW);
}
void loop() {
if (millis() - timeold >= 1000) {
detachInterrupt(0);
rpm = (revs * 60);
volts = analogRead(A0) * (25.0 / 1023.0);
amps = (analogRead(A1) - 512) * (30.0 / 512.0);
watts = volts * amps;
if (rpm > 1200) digitalWrite(7, HIGH); // Emergency Brake
revs = 0;
timeold = millis();
attachInterrupt(0, count_rev, FALLING);
}
}