Wind MPPT

Hi, everyone. I have just joined the forum. Learned "C" and started using Arduino just in two weeks. I want to develop a wind MPPT table using Arduino.

Please check my Sketch. Even the analogue input pin is grounded the LED connected at D09 is blinking. I have connected 6.8K pull-down resistor between A0 and ground. Can anyone help me?

code attached.

Please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum Your code is too long for me to study quickly without copying to a text editor.

You don't seem to have a line of coe to print the variable analogValue so you can see what is being detected.

I don't understand your use of a pull-down resistor. Please make a simple pencil drawing of your connections and post a photo of the drawing.

If the pull-down resistor IS NOT part of your voltage divider I suspect it is inappropriate.

...R

Sorry, Now attached files.

Wind MPPT.txt (3.21 KB)

Sorry, but parts of this code make no sense to me.

digitalWrite(ledPin, LOW);
delay (3);
digitalWrite(ledPin, LOW);

Why set a pin low, wait three microseconds, and set it low again? Do you have reason to believe it didn't work the first time?

if (analogValue <= 4) {

delay (997);

}
else if (analogValue <= 1){

Now, assuming that analogValue was 0 or 1. The first if would be true (<=4). Anything following the else will not execute so why test if analogValue <=1? This Portion of code will NEVER run.

If you write a function like

void doBlink(int onDelay, int offDelay)
{ digitalWrite(ledPin, HIGH);
delay (onDelay);
digitalWrite(ledPin, LOW);
delay (offDelay); }

You could shorten your program considerably (and use less programming Memory!) by replacing calls such as

else if (analogValue <= 918){
digitalWrite(ledPin, HIGH);
delay (800);
digitalWrite(ledPin, LOW);
delay (200);
}

With
else if (analogvalue <= 918)
doBlink(800, 200);

You could even create an Array with the individual threshold values, the on delay and the off delay and Loop through the Array instead of having all those if else Statements.

I wouldn't have even thought this line would compile

else (analogValue <= 1020);{

else, not followed by "if" but with a conditional test? What?

Why do you initialize the Serial port (using a lot of Memory to do so) and then not use it? I don't see any Serial.write or Serial.writeln Statements so why is the Serial port initialized.

Actually, if you included something like Serial.writelin(analogValue); you might also discover why the LED is blinking. The analog port will return a value between 0 and 1023. Theoretically, with the analog port attached to ground it should be getting a Zero. But is it really?

Hi JaBa,
Tnx for reply.
I wrote "
digitalWrite(ledPin, LOW);
delay (3);
digitalWrite(ledPin, LOW);
this to keep LED OFF at low analog input; but that did not work.

Pl find attached code written using array function and comment/ suggest.

Wind MPPT 2.txt (1.02 KB)

Hi,
OPs Diag.


Tom... :slight_smile:

Hi
You need to change your resistor divider to A0, that way will not work very well.
I assume the 12V is the supply from the windturbine, what will its maximum value be?

Tom... :slight_smile:

Hi
Your diag would be something like this, but you have the UNO being supplied by the windturbine, not good, it needs a stable supply.


Sorry have used pin 13 instead of 9 for LED

Tom.. :slight_smile:

Hi,
Can you explain how the code is supposed to work?
When is the LED supposed to turn ON/OFF or flash.

MPPT of a PV and Windturbine depends apon current as well as voltage measurements.

Thanks.. Tom... :slight_smile:

Solar MPPT is different than wind MPPT. Solar MPPT normally ramp-up 20% to 25% per minute. Wind MPPT depend on TSR (Tip Speed Ratio); using a wind tunnel we have tested our VAWTs and arrived at a table. It is not liner. Hence I used Arduino. PWM duty cycle will depend on the table. 0 to 500V DC I have reduced to 0 to 5VDC and connected to A0. D9 I have connected to power MOSFET. Now I can use any grid inverter with fixed MPPT voltage with my Arduino MPPT. I purchased two Arduino Nanos, one Arduino Uno and one Arduino Mini. But only Uno and one Nano are working. Nano is taking code only I select Arduino Uno bord; not Nano. I do now know why? anyone help me? May be they are just clones. I purchased through ebay and amazone online stores.

Hi,

kesirajus:
Solar MPPT is different than wind MPPT.
Solar MPPT normally ramp-up 20% to 25% per minute.
Wind MPPT depend on TSR (Tip Speed Ratio); using a wind tunnel we have tested our VAWTs and arrived at a table.
It is not liner.
Hence I used Arduino. PWM duty cycle will depend on the table.
0 to 500V DC I have reduced to 0 to 5VDC and connected to A0.

D9 I have connected to power MOSFET.

Now I can use any grid inverter with fixed MPPT voltage with my Arduino MPPT.

I purchased two Arduino Nanos, one Arduino Uno and one Arduino Mini.

But only Uno and one Nano are working.

Nano is taking code only I select Arduino Uno bord; not Nano.
I do now know why?
anyone help me?
May be they are just clones. I purchased through ebay and amazone online stores.

Sorry had to put it in point form to see what you had.
I have used your code on a UNO here using a pot to imitate wind turbine input and I can see your PWM change.
UNO to Nano should only need the tools/board select to work, so its a bit puzzling.
Have you loaded Blink example to the Nano, to check that it is working?
Tom... :slight_smile:

Hi TomGeorge,
My Laptop is detecting Non-working Nano display when I click get board info showing "BN: Unknown board
VID: 1A86
PID: 7523
SN: Upload any sketch to obtain it".

When up-loading sketch after few minutes getting error

"avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x8c
avrdude: stk500_recv(): programmer is not responding"

Actual error code is too long I copy pasted just 3 lines.
Also I noticed that Rx blinking slightly and TX not blinking at all.

My laptop not at all detecting non-working promini.

Can you help me?

Hi,
I think you need to ask this question in "Installation and Troubleshooting" section of the forum.

You could try re-installing the boot loader, if you google bootloader arduino nano

There are a lot of how to do it instructions.

Tom... :slight_smile:

kesirajus:
When up-loading sketch after few minutes getting error

Nick Gammon's chip detector program may help with debugging.

...R

I purchased two Arduino Nanos, one Arduino Uno and one Arduino Mini.

But only Uno and one Nano are working.

Nano is taking code only I select Arduino Uno bord; not Nano.

It is no clear whether if

  • one nano is working as expected and the other one only when you select Uno
    or
  • one nano is not working at all and the other one only when you select Uno
    ?
    If the two Nanos don't behave the same, is clear there-s a fault in either one or both of them.