Arduino track MPPT (solar panel connect with high-gain boost converter)

Solar panel connect with the high-gain boost converter.
use voltage driver to decrease the voltage and current sensor to get the data. use perturb & observe way to do the project.
However, i got a few problem. can i ask how to fix the code ?

MPPT algorithms for solar panel.pdf (39.1 KB)

Hi and welcome to the Arduino forum.

A little hard to answer when you don't want to describe your problem. Is the problem this is a class assignment and you want someone to do it for you?

Paul

Please read the "How to use this forum" post and follow the directions. Post your code properly, using code tags.

Thanks for help! i am a new learner, i will read how to use the forum first. i got a few problems in the code, so i did not describe it well. i will resend the problem, thanks.

Thanks for help! I am doing a project with both handware and arduino, i think i need someone help me with the code.

i think i need someone help me with the code.

Please post the code properly and describe the problems.

Hi Emma-Z, don't attach code in a .pdf file - it's difficult to use then. Rather type [code], paste your code and then type [/code]. Then folks can see it and work with it to resolve your problem.

Basically my soalr panel output voltage is 17.2V, but my boost converter input is 5v. in case of destory the converter i think i may need a voltage divided to provider lower voltage to the converter.
After that, i need track the MPPT of the solar panel. So, can i ask how can i connect my arduino with the current sensor and voltage sensor?

Thanks for help!

Hi
I am also doing Same project :wink:

For Sensing Voltage...
Arduino pin can take Maximum 20mA Current So you have chose Resistors for voltage divider such that voltage divider provide below 20mA current.
From 17.2V to drop down 5V.. you need two Resistor value
Vin =17.2V
R1 = 10K
R2 =3.9K
Vout = ((Vin x R2)/(R1+R2))
= 4.826
and it gives current around 12mA below 20mA
if you use R2 4.3K then you will get 5.172V. safe to take 4.3K Resitor

For Sensing Current you need Current Sensor that is IC ACS770LCB Hall Effect current Sesor

Arduino pin can take Maximum 20mA Current So you have chose Resistors for voltage divider such that voltage divider provide below 20mA current.

Sorry but that is rubbish.
An Arduino pin should only be asked to GIVE 20mA, an input current on an input pin is in the order of uA, the impedance is so high you can not force 20mA through it unless you put several hundred Volta on it, in which case you have zapped the input with too much voltage.

The potential divider is to reduce the voltage to less than the chip's supply voltage which is normally 5V. Input current has nothing to do with it. For good A/D response make the bottom resistor, the one from input to ground 10K, Then calculate the value of your top on depending on the biggest voltage you will get.

@Emma-Z, please do not cross-post. Threads merged.

Thanks for help! can i ask have you finished you project? i already write a part of the code. can you help to have a look. thanks again!

/* MPPT algorithms for solar panel * /
  
int output_pin=9
//Variables:
float DutyA=6;
float DA;

float VoltageAa;
float VoltageAb=17.2; // Voltage Sensor A connected to analog pinA0
float CurrentA; // Current Sensor A connected to analog pin A1
float PAa
float PAb=10 


int Step =1; //steps to in
int val; //variable to store the read value

void setup() {
pinMode( output_pin, OUTPUT);
// put your setup code here, to run once;
setup_timer2();

Serial.begin();
//Serial.begin()

void loop() {
// put your main code here, to run repeatedly:
PAa = PAb;

VoltageAa = VoltageAb; 

VoltageAb = analogRead(A0) * (5.0 / 1023.0)*((Z1A+Z2A)/Z2A); 
CurrentA = (511-abs(analogRead(A1))) * (4.902 / 1023.0); 

PAb = (VoltageAb * CurrentA); 
if (PAa < PAb && VoltageAa < VoltageAb)
 { 
DutyA = DutyA - Step; 
} 
else if (PAa < PAb && VoltageAa > VoltageAb)
 { 
DutyA = DutyA + Step;
} 
else if (PAa > PAb && VoltageAa < VoltageAb)
 { 
DutyA = DutyA + Step; 
} 
else if (PAa > PAb && VoltageAa > VoltageAb) 
{ 
DutyA = DutyA - Step; 
}

//DA=floor(DutyA /255) *16);

sorry, it is not finish yet. can i ask if this part is right? especially the currentA and voltageVA expression.

thanks for help!

Can anyone provide arduino program using perturb and observe (solar mppt)

I have made updated MPPT and uploaded to my website Home Made Maximum Power Point Tracking (MPPT) Charge Controller | Updated 2019