Measuring Voltage from Solar panel?

Hi everyone, first of all please be patient with me. I’m a complete newbie to arduino and electronics in general :blush:.
I’m trying to build a solar tracker and i’m a little helpless with trying to connect everything together. I have attached a scetch, the way i was thinking it could be done? I have a solar panel, charge controller and a battery and would like to measure the voltage and eventually the current generated by the solar panel with an arduino uno.

Do you think the setup is correct? and i could get a voltage reading? How would i measure the current from the solar panel? Could i do that with the setup i did or would i need one of those current sensor breakout boards?

Measuring the voltage of your solar panel is not very useful. It general it does not change much. The current will vary based on irradiance.

Thanks for the reply. ok, is it possible to measure the current with the voltage divider (R1 & R2)?

To measure current you need a very low resistance between the solar panel and its load. I have 0.005Ohm resistors in series with my panels. You then use Ohms law to calcutale the current based on the voltage measured across the resistor.

With such low resistance the voltage across it will be very small and will need to be amplified before the ADC in an Uno can measure the voltage.

If you have a Mega or a Leonardo it will have the capability for differential ADC meaasurements and includes an amplifier.


I'd suggest using two analog input pins and program your arduino to record their 0-5V voltage inputs. Make a ptential divider from solar "+" to GND so that on the coldest day of the year at 1000W/m^2 (a little brighter than expected sunshine) the middle of the divider connected to pin a0 will be less than about 4.5Volts above ground. You need to read Voc of your solar panel from its datasheet to get that safe. Normal Vmpp of your solar panel will be about 80% of this. Next make an op amp circuit to convert from about -0.5 Volts to +5Volts or whatever gets the right range from the small negative voltage from GND to solar panel "-" through either its cables or your very low calibrated shunt resistance.

The product IV gives you the Watts output of the panel, which is possibly what you want to know. In arduino code

long w1 ........ w1 = analogRead(0)*analogRead(1);

is the absolute minimal uncalibrated code to contain in your program. Note that 2^10 * 2^10 > 2^15 so I'd use the 'long' type 32 bit integer to store an uncalibraetd power, and not the plain 16 bit integer. That might give you some ideas for reading.

Mainly current and also somewhat voltage off a solar panel go up with more light. Temperature affects mainly the voltage, with about 5% extra on a cold day. Record both to see what is going on.

@ad2049q - you leave me at a loss for words.

I know a little about this subject and after reading your post a few times I suspect you do also.

However I doubt very much if your “explanation” will mean much to someone who doesn’t already know how to do it.


To: Robin2,

acknowledged. Sorry if I'm blathering on like someone who has read the solar panel datasheet. All I'll say is to reiterate that the originator of this thread should record both current and voltage as well, as only one of those isn't quite enough.

ad2049q: All I'll say is to reiterate that the originator of this thread should record both current and voltage as well, as only one of those isn't quite enough.


It is much easier to measure the voltage but the current measurement is the most important. You could make a guess about the typical voltage, but you couldn't guess the current.


Hi, please check how the charge controller works, most when they disconnect the panel when the battery is charged, will open circuit the solar panel negative terminal from the battery negative. So use the battery negative as the gnd reference, don't worry about panel volts. Just measure battery volts, which will be the same a panel when charging, and measure current at the battery terminal. Leave the panel side of the charge controller alone.

Tom........ :)