Welcome to Solarduino , A blog about DIY Solar PV and Arduino projects

DIY Solar I-V Curve Tracer with Arduino

Current – Voltage (I – V) curve is a graphical representation of the Solar Panel operation summarizing the relationship between output voltage and current under various irradiation and temperature condition. By creating a I-V curve under known environmental condition, the output performance of the panel can be determined. A good quality Solar Panel will not deviate much from the expected curve pattern. 

The most common electrical parameters for a Solar Panel are Short Circuit Current (Isc), Open Circuit Voltage (Voc), Maximum Operating Current (Imp) and Maximum Operating Votlage (Vmp). All of these can be obtained from the I-V curve. In order to draw a I-V curve of a Solar Panel, a dump load of various resistance is required to trick the solar panel’s output. 

In this project, we will use a Arduino board to determine the peak power value, short circuit, open circuit by measuring values from a high power disc rotation resistor which is needed to be operated manually. It is a semi manual device that you just need to rotate the disc variable resistor, then the arduino board will display you the peak power value, short circuit current and open circuit voltage. 

In more advance mode, if you have the temperature and irradiation sensor, the arduino board will calculate expected power production based on your input specs of your panel and it compares with the actual power measured by your panel so that you will know how your panel performs . 

Warning ! You may now dealing with high voltage and high power source ! We assumed that you have the basic electrical knowledge and know what you are dealing with. You may need guidance from experienced guys if you are new to electrical work. Safety and Precaution must be always have in mind. We shall not be responsible for anything happening to you.

PROVA SOLAR Module Analyzer

Solar Module Analyzer is a device used to create a I-V curve of a solar panel and able to determine important solar panel parameters such as short circuit current (Isc), Open circuit voltage (Voc), maximum power (Pmp), voltage at maximum power (Vmp) and current at maximum power (Imp). You can get it at our affiliate link here !!!

Peacefair PZEM-051 Energy meter is an compact DC energy meter that measures Voltage, Current, Power and Energy. Peacefair has a lot of model to measure different current requirement from 20A up to 100A. You can get it at our affiliate link here !!!   

Arduino has the ability to measure DC voltage and DC current (via module) using analog input pins. For Arduino UNO, there are 6 analog input pins (A0-A5) where you need separate pin for each measurement. If you stacked up a LCD Display Shield, Analog Pin A0 is automatically occupied by the button function. If you are going a step further by adding Datalogger Shield (to plot I-V curve), Analog Pin A4 and A5 are also occupied for I2C communication for the Real Time Cloak module in the Datalogger Shield. In order to use the Analog Pin A4 and A5 when Datalogger Shield is attached, you need to isolate the pin A4 & A5 from the I2C communication with Real Time Clock module in Datalogger shied to prevent data miscommunication. By this A4 and A5 analog pin can be used but the Clock Module function will be disabled. We are not using the time module anyway.

Just flip over the datalogger shield module and use a pen knife to cut and isolate the lines between SCL to analog pin A5, and SDA to analog pin A4. If you don’t have datalogger shield you do not need to do this modification. If you have the datalogger shield you must do this step or else the measurement data in pin A4 and A5 will come out different values.

Technically Analog Pin A1 to A5 are available for all the sensor inputs. In this project, I will divide into 2 level of codes. 

Code file 1 is a basic level which I-V data can be saved in Datalogger Shield,  you can use the data to plot a I-V or P-V curve in excel. If you don’t want to plot I-V curve it will be just alright, the LCD also giving you the instant Pmp, Vmp, Imp, Isc and Voc once the measurement processed is ended. It is a pure standalone I-V tracer or analyzer just like commercial device. Just that you need to plot I-V curve from the table of data by yourself.

Code file 2 is for full feature equipment which not only I-V data can be saved in Datalogger Shield and important parameters shown in LCD display, it can also tell you the quality of the panel. By determining the actual condition of environment, the expected output of a solar panel can be determined. Of cause you have to key in all the relevant parameters in the code prior each panel test. There are 2 more sensors required: Temperature sensor and Irradiation Sensor. 

Temperature sensor is to measure temperature of the solar cell in the solar panel (which normally we record at the back sheet of solar panel). In this sample we will be using NTC temperature probe and you can get more info in our post here !!. The second sensor is the irradiation sensor. It is actually using Short Circuit Current of a solar cell or solar panel to simulate intensity of sunlight as short circuit is almost directly proportional to irradiance. We will be using our own DIY irradiation sensor which you can find the post here !!. 

By adding 2 more sensors, everything will become more practical but the wiring will be a lot messier. The code already pre-assigned A1 to measure DC Voltage and A2 to measure from current module for code file 1. As for code file 2, A1 and A2 pins are the same as code file 1 but has also added A3 for irradiation sensor and A4 for temperature sensor. Do not reverse the voltage polarity which may damage the pins.

Arduino UNO (compatible board)

If you still not yet own an Arduino Micro-controller Board, you can get it cheap at our affiliate link here !!!

Measure Voltage using voltage divider method

If your measure DC voltage value which is not more than 5.0V, you can directly connect to the analog pin without any modification. In order to measure higher voltage such as 18Vdc, 48Vdc, 100Vdc or even 500Vdc, voltage divider method is used to split and reduce the measurement voltage into a 5V range. The voltage divider consists of two resistors connected in series as shown in the diagram below. All you need is just 2 resistors with different resistance values.

When the voltage is applied across the pair resistor of different resistance, it creates a voltage drop based on each resistor and it can be used as reference value and it is directly proportional to the total voltage value. Higher resistance R1 tends to have larger voltage drop while smaller resistance R2 will have smaller voltage value which is within acceptable range of Arduino.

 

2W 1% accuracy Resistors

Resistors with high accuracy can be used in voltage split method to measure voltage value in arduino. You may purchase the resistor at our affiliate link here !!!

For easy calculation, below we have attached an excel sheet that can automatically calculate the value of the resistors. First, key in the Monitoring Voltage. It is the maximum value of your DC voltage monitoring range. The next step is to key in the Total Resistance value. It is recommend that the total resistance ranges from 50,000 ohm to 300,000 ohm. 

Total Resistance is flexible. However, small total resistance will have large consumption and heat dissipation for high voltage measurements which end up you have to buy larger wattage resistor. In the contrary, too large total resistance may end up voltage measurement processing too slow or not accurate in low voltage measurements. 

As a guide, 100Vdc and below use Total Resistance value of 50,000 ohm, 200Vdc and below key in 100,000 ohm, and voltage less than 500Vdc key in 300,000 ohm. Once you keyed in Monitoring Voltage and Total Resistance values, the Excel sheet automatic calculate all the relevant specs for the two resistors.

There are 3 important information that need to be specified during the resistor purchase. You may purchase the resistor at our affiliate link here !!

1) Resistance value 

You will end up getting 2 resistors of different resistance value. You might get weird resistance value in the calculation sheet, for example 44,565 ohm and 5,325 ohm. It is just a guideline and all you need to do is to get a round figure which is closer but larger value for resistor R1 and smaller value for resistor R2. Example: 45,000 ohm and 5,300 ohm. This is to ensure monitoring voltage can be measured within 0-5V range.

2) Resistor Wattage

Similar to other products, resistor itself has its withstand’s wattage rating. Oversize wattage rating is always better than using small wattage rating on large consumption which may lead to resistor burnt. Resistor R1 always has more heat dissipation than resistor R2 thus it is not strange that both resistors are not with same wattage requirement. Just get a value larger than the wattage rating as specified in the excel sheet. The standard wattage of a resistor is: 1/8 Watt (0.125W), 1/4 Watt (0.25W), 1/2 Watt (0.5W), 1 Watt, 2 Watt and 5 Watt.

3) The resistance tolerance in %.

Resistor Tolerance is the percentage of deviation from the stated resistance value. If you do not have a Multimeter to measure the actual resistance value, you will need to purchase a better accuracy resistor. Resistors are very small and cheap component; if possible get most accurate ones. 1% is widely use and suitable for monitoring and measuring purposes. 

You may purchase the resistor at our affiliate link here !!

This is a cheap and reliable voltage sensor module available in the market using the same voltage division method. The voltage sensor module is designed to measure voltage up to 25Vdc with its resistors tolerance of 1%. You may consider getting this module which is available via our affiliate link here !!!

Measure Current using Module 

The current sensor that is widely used for Arduino is the ACS712 Current Sensor Module. It utilizing hall-effect phenomenon which voltage is produced from the movement of current within the region of magnetic field. The voltage produced by hall effect is directly proportional to the applied current making it suitable to estimate the applied current from the voltage sensed.

The sensor can measure current in 2 direction. Reverse current will not damage the sensor but the voltage produced will be in reduced. As we know, Arduino analog input only read positive integer values. In order to measure 2 direction, the zero point should be at half the total voltage range (0 to 5V) which is 2.5V. This is true if the supply voltage to the sensor is 5V. 

The standard ACS712 Current Sensor Module rated at 5A, 20A and 30A which are suitable to most applications. You may get them by our affiliate link here !!! The 5A module has the resolution of 185mV/ampere, 20A module has 100mV/ampere while 30A module has the resolution of 66mV/ampere.

Power Variable Resistor

We will be using Disc Rotation Variable Resistor (high power) to trick the Solar Panel output power at different resistance. The wattage rating of the variable resistor MUST be at least or larger wattage rating of the measured solar panel as the resistor will dissipate the power into heat or else it will be overheated and melted. There are 2 common types of variable resistor that can withstand high power: 1) straight sliding Rheostat (which normally seen at laboratory in high schools) and 2) Rotation disc sliding Rheostat (which can be found at automatic transformer equipment).

There are 2 important things during selection of the Power Variable Resistor. The first is the Withstand Power Rating of the Resistor. Since the power source of this project is from the solar panel, make sure the Rheostat power rating is as high as the solar panel. The second specs that need to be consider is the Resistant value of the variable resistor. The measurement could not covers a full range of the I-V curve if the resistant range is too low while too high resistant range will cause most data accumulate near Voc which seems not evenly distribute. 

In this example, I will be using 300W 1000ohm Rotation Disc Sliding Rheostat. 300W is sufficient for most solar panels while 1000 ohm is consider a good resistance range without compromising on Voc value.  

Rotation disc sliding Rheostat

This is a high power manual operated (handheld) variable resistor or potentiometer. It is  widely used in auto transformer equipment. It also can be automated by adding a rotating motor controlled by Arduino. Kindly get it at our affiliate link here !!!

Servo Motor for Arduino

Servo motor is a high torque motor use to rotate things and can be controlled by Arduino board. It can be used to automatic rotate the shaft of the Rotation Disc Sliding Rheostat so that you can leave your hand off and let it done automatically. You can get it at our affiliate link here !!!

Measure Temperature using NTC temperature probe

thermistor is a thermometer that is made of semiconductor that its resistance value changes with temperature. Thermistor will has its own temperature coefficient rating (B value) which tells us the amount of resistance changed or involved for every Kelvin or Celcius changes. 

There are two types of thermistor, the Negative Temperature Coefficient (NTC) and Positive Temperature Coefficient (PTC). With an NTC thermistor, when the temperature increases, its resistance decreases. This type of thermistor is widely used. On the contrary, A PTC thermistor will works the other way round, when temperature increases, its resistance will also increase. This type of thermistor is generally used as a fuse.

Since the thermistor sensor acts as a resistor, the 2-wire sensor does not have polarity, you can connect any pin to Analog Pin and another one to the Ground Pin. However, in order to convert from resistance to voltage, the Voltage Divider Method is used. The voltage divider consists of two resistors connected in series as shown in the diagram below. All you need is just 2 resistors with different resistance values, and a 5V voltage supply. The resistance can be reversed calculate since analog value can be read by Arduino.

Thermistor Equation

The first part of calculation was getting the resistance value R2 which is converted from the analog reading from the thermistor. This is the second part of calculation where the resistance value R2 is then substitute to Thermistor Equation to obtain its temperature value T2. We are using thermistor equation as below:

Not to confuse with the R1 & R2 value on previous formula or calculation which is based on voltage divider method. All the values in this thermistor equation are referring to the thermistor itself. The value R1 and T1 here refer to the thermistor standard rating (resistance at 25 degree celcius) while R2 is value from previous calculation and the T2 is the actual temperature that we need to find. For more detail on NTC temperature measurement, you can find in our post here !!!

NTC Temperature Sensor

NTC Thermistor is a temperature sensor based on resistance value changes. The higher the temperature, the lower its resistance. You can grab it at our affiliate link here !!!

Measure Irradiance using Solar Cell

Irradiation meter is the device that can measure intensity of sunlight in Watt per meter square (w/m2). Besides using it to describe weather condition, it is a very important and useful device for Solar PV Design. As an experienced Solar PV Designer, we use irradiation meter and its data for 2 purposes: 1) to simulate and provide feasibility study of a location or site whether it is viable to install Solar PV System, and 2) to quality check the running system whether it is up to expected power production value. 

Irradiation meter basically can be divided into 3 types of measurement sensor. There are Thermopile, Solar PV Cell and Photoresistor. We will be using Solar PV Cell operation principle.

Solar PV Cell is a photoelectric device that when the surface is exposed to sunlight, there will create a potential (voltage) across the material. Solar PV Cell is a single junction P-N Semiconductor device, it applies the rules of I-V curve. There are 4 important terms in Solar PV Cell, the Open Circuit Voltage (Voc), Short-circuit Current (Isc), maximum operate voltage (Vmp) and maximum operate current (Imp). To cut everything short, Short-circuit Current (Isc) value is directly proportional to the intensity of sunlight. 

Since it is using same technology (crystalline silicon) as Solar PV System, its measurement is more suitable and closely related to actual Solar PV System production. Temperature might have minor deviation effect on the reading which is not more than 3% in practical. 

SM206 Handheld Irradiance Meter

SM206 handheld irradiance meter is a low cost with reliable accuracy that could measure light and solar intensity in W/m2 and Btu unit. You can get it at our affiliate link here !!

0.5V Epoxy Solar Cell

Epoxy 0.5V solar cell is the best match to be used as a sensor to measure irradiation. It is not only cheap and small, it is also well insulated so that the cell is protected from environment condition. You can get it at our affiliate link here !!!

To measure the Short Circuit Current of the solar cell, a precise DC Current Module is needed. If you have a solar cell with short circuit current that is too small related to the current module, the current module always measure near lower boundary or  less than 10% of its capacity (for example) thus the resolution and deviation will become large and it affects the output accuracy. Kindly allow about 30% extra margin as solar constant could go up to 1360W/m2 on extreme clear sky. I have been looking for DC current module that has lower current limit and I found this:

Many modules come with standard mV/A sensitivity but do you know that there are some modules slightly deviate from the typical rating? This is extremely important if we need to measure precise small measurement. You may need to go to my post here to learn about how to precisely calibrate the module and other module such as ACS712 AC Module for small current detection. 

Hall-Effect DC Current Sensor 

This is a DC Current Sensor module that could measure smaller precision current as small as 0.25A. Kindly support us by getting it at our affiliate link below :

This project requires LCD Display Shield which not only can display the output values, but also button for execution functions such as automatically calibrate current module, and start or end recording values for measurement. 

The good news is you do not need to manually calibrate the current module offset setting if you got the LCD Display Shield with you. Below we have attached the code that utilizes the button function that could automatically calibrate by itself when you pressed the SELECT Button. You may download from the end of this page below. 

Besides, we need to use button function to start and stop recording data when you rotating the potentiometer. You may press LEFT button to start recording the data and you may start sliding the potentiometer starting at highest resistance value at constant rotation speed. Once you have rotated to the end of the variable resistor, you can start press RIGHT button to stop recording so that the arduino board will start processing the data to come out with the peak power etc. The main data will be displayed on LCD Display Shield. 

If you want the whole set of data to be recorded so that you can plot the I-V curve graph, you need the datalogger shield. Once the datalogger shield is attached, it can save all the measured values inside a SD Card and the table of values can be further tabulate  into a I-V curve graph. 

I recommend you to add a 16X2 LCD Display Shield which can be directly fit on to the top of the Arduino board without the need of extra wiring for the LCD Display. Without the LCD Display, you can only monitor the measured current value on PC via Serial Monitor. You can get the LCD Display board at our affiliate link here !!!. 

Datalogger Shield

If you plan to record the data in a proper way, you may consider this Datalogger Shield. It allows your arduino to record your data in SD Card. Datalogger shield is often installed together with LCD Display shield. Please find it at our affiliate link here !!! For more about this Datalogger Shield, kindly visit our post here.

Hardware Connection

Once you get all your components ready, you may start to do hardware wiring. Below is the schematic of the whole wiring. You may also need some tools and accessories. Be sure your connection cable is tight and all components shall be installed in such a way no movement at all. 

You can stack up screw shield, LCD Display Shield, and Datalogger Shield on top of Arduino UNO. No additional wiring is required as the shields are meant for adding function without need of extra wiring. 

Beginner Level – No Irradiation Sensor & temperature Probe 

At beginner level, you already can determine the Short Circuit Current (Isc), Open Circuit Voltage (Voc) and Peak Wattage (Pmp). There is lack of irradiation and temperature information. Without irradiation and temperature information, the expected power cannot be determined so actual performance of solar panel cannot be determine. However, you can have external temperature and irradiation meter and calculate separately.

Extension wiring for Irradiation Sensor & temperature Probe 

After adding the temperature and irradiance sensor, kindly select the second code file. You have to key in the specs of the solar panel which normally can be obtained from the back of solar panel but the temperature coefficient specs will be only available in the datasheet. If you got a cheap solar panel, the temperature coefficient can select my default value for monocrystalline and polycrystalline. I will try to reduce the complexity of the code as much as possible. 

 

Screw Shield / Expansion Shield

When there are a lot of wiring around especially more than 1 sensor, sharing pins will be difficult as existing pins (ground and 5V) are limited. This shield provides a lot of convenient terminals for each of the input and output pins. The shield can be mounted directly on top of the Arduino Uno board or in between the shields which made it very convenient to use. You can get it at our affiliate link here !!!

Dupont Line Wires

You may need Dupont Line Wires to connect Arduino board and Sensor Module. It is available at our affiliate link here !!! 

Software Codes

The final step would be adding source code onto Arduino board. I assume you have installed the Arduino Software. If you have not installed the software, the link here can bring you to the official download site. Once you have downloaded the software, you may download the code file (.ino) for this application below (right click save link). 

There is 2 source codes file attached which are source code with and without temperature and irradiance sensor. Both source codes require LCD Display shield to work. Datalogger Shield is the optional which you can save the measurement data in a SD card so that you can plot the I-V curve in excel. The datalogger shield is included in the code by default. If you don’t want the function, kindly delete all the relevant datalogger codes.

Operation

Once the code is successfully uploaded, you may press SELECT button to calibrate the current module and irradiance sensor. During Calibration make sure no current and sunlight detected (you have to cover the solar cell). Press UP / DOWN button to swap the display pages. For beginner there is only 2 pages while extended code will have 3 pages where irradiance and temperature values are shown in page 3. 

Press the LEFT button to start measuring process. Once the LEFT button is pressed, kindly rotate the Rheostat from maximum resistance to lowest resistance. It shall be done at constant rate and best within 2-5 seconds. Once the Rheostat is rotated at the end terminal, press the RIGHT button to stop the measuring process. After the RIGHT button is pressed, the Vmp, Imp, Pmp, Isc and Voc will be displayed on the LCD Display Screen but divided into 2 pages. You can press again for new record measurements.

I will not display the code here because it is long. You can download the .ino file to see for your own. Almost all code lines are with explanation. 

Before we end, we would like to give gratitude to you for taking the time to read the post. We would need readers like you to support us in order to keep growing. You can support us in the following ways :

Donate & Fund Raising

If you like my work, please send me a donation to encourage me to do more. Thanks

Aliexpress Affiliate

We are the member of Aliexpress affiliate marketing. Do support us by clicking the affiliate product links if you do wish to purchase them.

Like and Share

If you like our post, we need your support to like and share our posts or videos so that it can reach more and more people like you !!

Result – In SD Card

Result – In LCD Display

Data processed in Excel

For Arduino Code Files, Remember to Right Click > Save Link As … You may alter the internal code as you wish. Happy coding !! 

I-V Tracer with Arduino (part 1).ino
I-V Tracer with Arduino (Complete Feature).ino