How to meausre AC and DC current and voltage using arduino mega

I have a school project and will be doing an anaylses about the efficiency of solar tracking solar panel vs fixed solar panels. My issuse is that I would need to measure the voltage generated by the solar panel in DC where the maximum is 32V and 9Amps and also the voltage after the invertor meaning it would be 230V. The voltage sensors that I have found only allows voltage up to 25V. Do any of you guys have any idea what I should do?

What you should do is decide on the calculation you will use for efficiency. Are you going to measure power from the panels vs power out of the inverter? That makes no sense because the inverter power is based on the load on the inverter. Measuring voltages makes no sense because that will also be based on the loads of the panels and the inverter.

Everything you need to know about energy monitoring

have a look at PZEM-004T_voltage_current AC sensor which comes in 10amp and 100amp versions
Arduino https://github.com/mandulaj/PZEM-004T-v30 library

be careful - you are dealing with dangerous voltages
use an isolation transformer

The panel voltage is pretty static, doesn't really change between fixed/tracking one.
Mains voltage from inverter is static 230V as well.

What you likely want to measure is power your panel outputs.

I will be meausring the efficiency on the power given by the inverter having the same loads. My question is not on the calculation of efficiency but how can i measure 230 Vac and 32Vdc.

yes that is why i will meausre both voltage and current

See the link I gave

yes I saw it but the project requires to built it my self rather than buying a complete setup

And measure the power needed to control the moveable panels?

You didn't bother to read much
There are several webpages describing how to build an Arduino based energy monitor as well as information on theory and solar applications.

yes

You may use te following sketch to display the Soar and Inverter voltages:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  float Vsol = (5.0 / 1023) * analogRead(A0) * 32 / 3.17;
  Serial.print("Solar Output: ");
  Serial.print(Vsol, 2); Serial.println(" V");
  //----------------------------------------------
  float Vinv = (5.0 / 1023) * analogRead(A1) * 230 /2.84;
  Serial.print("Inverter Output: ");
  Serial.print(Vinv, 2); Serial.println(" V");
  //----------------------------------------------
  delay(1000);
}

Hmm it is a good idea, and the full wave rectifier and its system will be something like the photo attached correct? Instead of the step down transformer

Omit zener; V1 must be unregulated DC. T1 is isolates the low voltage electronics of MEGA from 230V AC.

That is absolutely dangerous!

Never try to measure mains voltage without isolation

How to do it safely is all explained in the link, even has pictures.

1 Like

so to be safe i would need a step down transformer from 230 to 5v. but than would it be accurate?

Does it mean you can't use any IC for this?
What other requirements you have?
If the purpose is to get relative efficiency between tracked/fixed, it's kind of pointless to measure both DC and AC side.

No it would not, it' all explained in the link I provided.
With pictures!

Try to get 230V/3V which is available. 230/5V would require voltage divider.