Tweeted twitter.com/StackElectronix/status/796646933469270016
2 Improved formatting and gave clearer description of my question/problem.
source | link

I am currently doing a MPPT(Maximum Power Point Tracking) using Arduino UNO. So far I have pretty much almost finished the coding. When I was about to test my program using a regulated DC power supply, it suddenly occurred to me that I had done things wrongly. How was my circuit going to detect/read the voltage and current values?

Regarding this, I do not know how I can let my Arduino circuit detect the current and voltage values separately on each analog input. I would be using the current and voltage value (pv_I and pv_Vnew) to multiply them together to obtain the power value.

My problem is that I need help with the hardware, getting the voltage and current values into the ADC I hope someone can help me with this problem.

If it helps, this below is a part of my code where i do the multiplying and stuff.

float pv_I; //input current
float pv_Vnew; //input voltage

void reading(void)
{
  pv_I = analogRead(A0);     //This is the area that is in question
  pv_Vnew = analogRead(A1);  //This is the area that is in question

  reading_value[0] = pv_I;
  reading_value[1] = pv_Vnew;

  Serial.print("Current, Voltage: "); //Start of string

  for(int i = 0 ; i < 2 ; i++)
  {  
    Serial.print(reading_value[i]);  
    Serial.print(", "); // Seperate each value with ',' to identify them seperately
  }

  Serial.println(" END"); // End of string
  delay(500);

}

void PowerCalculation(void)
{
  tempPower = pv_I * pv_Vnew;
  pv_NewP = tempPower;

  Serial.print("Calculated Power: ");
  Serial.println(pv_NewP);
}

I am currently doing a MPPT(Maximum Power Point Tracking) using Arduino UNO. So far I have pretty much almost finished the coding. When I was about to test my program using a regulated DC power supply, it suddenly occurred to me that I had done things wrongly. How was my circuit going to detect/read the voltage and current values?

Regarding this, I do not know how I can let my Arduino circuit detect the current and voltage values separately on each analog input. I would be using the current and voltage value (pv_I and pv_Vnew) to multiply them together to obtain the power value. I hope someone can help me with this problem.

If it helps, this below is a part of my code where i do the multiplying and stuff.

float pv_I; //input current
float pv_Vnew; //input voltage

void reading(void)
{
  pv_I = analogRead(A0);     //This is the area that is in question
  pv_Vnew = analogRead(A1);  //This is the area that is in question

  reading_value[0] = pv_I;
  reading_value[1] = pv_Vnew;

  Serial.print("Current, Voltage: "); //Start of string

  for(int i = 0 ; i < 2 ; i++)
  {  
    Serial.print(reading_value[i]);  
    Serial.print(", "); // Seperate each value with ',' to identify them seperately
  }

  Serial.println(" END"); // End of string
  delay(500);

}

void PowerCalculation(void)
{
  tempPower = pv_I * pv_Vnew;
  pv_NewP = tempPower;

  Serial.print("Calculated Power: ");
  Serial.println(pv_NewP);
}

I am currently doing a MPPT(Maximum Power Point Tracking) using Arduino UNO. So far I have pretty much almost finished the coding. When I was about to test my program using a regulated DC power supply, it suddenly occurred to me that I had done things wrongly. How was my circuit going to detect/read the voltage and current values?

Regarding this, I do not know how I can let my Arduino circuit detect the current and voltage values separately on each analog input. I would be using the current and voltage value (pv_I and pv_Vnew) to multiply them together to obtain the power value.

My problem is that I need help with the hardware, getting the voltage and current values into the ADC I hope someone can help me with this problem.

If it helps, this below is a part of my code where i do the multiplying and stuff.

float pv_I; //input current
float pv_Vnew; //input voltage

void reading(void)
{
  pv_I = analogRead(A0);     //This is the area that is in question
  pv_Vnew = analogRead(A1);  //This is the area that is in question

  reading_value[0] = pv_I;
  reading_value[1] = pv_Vnew;

  Serial.print("Current, Voltage: "); //Start of string

  for(int i = 0 ; i < 2 ; i++)
  {  
    Serial.print(reading_value[i]);  
    Serial.print(", "); // Seperate each value with ',' to identify them seperately
  }

  Serial.println(" END"); // End of string
  delay(500);

}

void PowerCalculation(void)
{
  tempPower = pv_I * pv_Vnew;
  pv_NewP = tempPower;

  Serial.print("Calculated Power: ");
  Serial.println(pv_NewP);
}
1
source | link

Separate voltage and current from regulated DC power supply

I am currently doing a MPPT(Maximum Power Point Tracking) using Arduino UNO. So far I have pretty much almost finished the coding. When I was about to test my program using a regulated DC power supply, it suddenly occurred to me that I had done things wrongly. How was my circuit going to detect/read the voltage and current values?

Regarding this, I do not know how I can let my Arduino circuit detect the current and voltage values separately on each analog input. I would be using the current and voltage value (pv_I and pv_Vnew) to multiply them together to obtain the power value. I hope someone can help me with this problem.

If it helps, this below is a part of my code where i do the multiplying and stuff.

float pv_I; //input current
float pv_Vnew; //input voltage

void reading(void)
{
  pv_I = analogRead(A0);     //This is the area that is in question
  pv_Vnew = analogRead(A1);  //This is the area that is in question

  reading_value[0] = pv_I;
  reading_value[1] = pv_Vnew;

  Serial.print("Current, Voltage: "); //Start of string

  for(int i = 0 ; i < 2 ; i++)
  {  
    Serial.print(reading_value[i]);  
    Serial.print(", "); // Seperate each value with ',' to identify them seperately
  }

  Serial.println(" END"); // End of string
  delay(500);

}

void PowerCalculation(void)
{
  tempPower = pv_I * pv_Vnew;
  pv_NewP = tempPower;

  Serial.print("Calculated Power: ");
  Serial.println(pv_NewP);
}