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

DIY Irradiation Meter with Arduino

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.

1) Thermopile

Thermopile is the sensor that consists of several thermocouples usually connected in series or parallel in order to create readable current or voltage when thermal (heat) is applied on it. In nature, electric voltage is created when there is a temperature difference in 2 junctions of dissimilar metal conductor. It is called Seebeck effect. It is due to electron energy levels shifted differently in the different metals, creating a potential difference between the junctions which translates to a voltage between the two un-joined wire ends. 

Sensor like Pyranometer and Pyrheliometer are the most famous irradiation device that are made from thermopile. The absorber of the sensor consists of 2 colors which are black and white to increase the temperature difference between dissimilar metal junctions. Some of the pyranometer only have black absorber. Since intensity of sunlight is proportional to the conversion of thermal energy absorption, the intensity on sunlight can be measured in this way. 

The accuracy of this sensor is high with extra protection such as vacuum and isolate from environment condition but the disadvantage of this sensor is the measurement value changes very slow since temperature change is slow.

Pyranometer

Pyranometer is an high end quality irradiance sensor based on thermopile. It has a semi-sphere dome and internally is vacuumed to prevent environment condition to affect the sensor reading. It can measure up to 2000W/m2. You can get it from our affiliate link here !!!

2) Solar PV Cell

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. 

This type of sensor is cheaper and measurement changes is fast compared to thermopile sensor. 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. 

 

Seaward Irradiance Meter

Seaward Irradiance Meter using Solar Reference Cell for measurement. We have been using this type of meter for commercial and professional Solar PV System testing. You may get it at their official website here ! 

3) Photodiode

Photodiode is an electronic component similar to Solar Cell which is a photovoltaic semiconductor device but in a very small version. Both photodiode and solar cell although serve different application purposes, technically both are the same at a fundamental level. Some photodiodes came with light-filter glass on the sensor which might cause some wavelength or energy is filtered out before entering the sensor thus choosing the correct photodiode model and type is essential. Many low cost solar irradiation meter and light intensity sensor is made of photodiode. You can identified them by seeing the sensor is covered by white opaque plastic cover on top to diffuse the light. Irradiation meter using photodiode sensor is among the least accurate compare to previous sensors.

 

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 !!

DIY Solar Irradiance Meter using Solar Cell as sensor

In this post we will be using a solar cell to measure Solar Irradiance Level. As discussed earlier, Solar Irradiance Level is Directly proportional to Short Circuit Current (Isc) value. Since it is measured by current value, you also need a current sensor for Arduino. Before purchase your solar cell and current sensor, make sure both are compatible and the rating (if possible) are close to each other (solar short circuit current has to be lower than the current limit of the module. If you get the current sensor limit too high, example 30A current sensor module and a 300mA Solar Panel, the resolution might be off and the measured value will not be accurate. 

Choosing A Solar Cell

The first task is to find a suitable Solar Cell for our application. Since we only need short circuit current reading from a solar cell, to save cost, we need to get a solar cell to be lowest voltage as possible (0.5V) which is a cell, not a panel. In worst case, you may also get a small solar panel with low voltage but high current (example 5V 600mA). Before purchase, make sure there is a datasheet or description showing the short circuit value under Standard Test Condition (STC) of the solar cell or solar panel. You need the short circuit value to key it into the Arduino Code.

 

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 !!!

Choosing DC Current Module

DC Current Module determines the accuracy and the resolution of the measured value. 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:

I have purchased 3 models (0.5A, 1.0A and 2.0A) for testing and the output is compared to ACS712 5A standard current module. Initially the output of this type of module is not accurate (deviate from the typical mV/A rating from the manufacturer). However, after I re-calibrated the module, the stability and accuracy will surprise you ! Note: you need to pre-calibrate (especially for this type of module) if you want a high precision small current measurement. Even ACS712 module is not accurate for small current measurement. 

 

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 :

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.

Pre-calibrate the module

At first I plan to throw them away as the measurement value is not the same as ACS712 module, Peacefair DC Energy Meter and UNI-T multimeter output values. The measurement output value is  from 4 to 12% lower than expected. There is no trimpot or potentiometer to do the calibration. The trimpot onboard is for setting Digital Output as alarm trigger which I’m not using it here.

As I almost lost hope, luckily I found a way to do manual calibration to obtain high accuracy for small current value but requires some calibration components. You need a multimeter, a high wattage adjustable or sliding rheostat, and a power supply. 

 

By measuring the fixed output voltage and various applied resistance values, we can accurately know the expected output to be compared with module output current value. By comparing the difference in ratio, the actual mV/A rating of the particular module can be known. My method is get the current from module (which is at or near the current limit) by adjusting the rheostat. Record the voltage and resistance value and use calculator to get the new mV/A rating of the particular module. Kindly take note each module will have different or specific mV/A due to deviation error. Key in and replace the new value of mV/A in the arduino code. 

Meanwell 12V 50W Power Supply

Meanwell is a very famous company making power supply products. You can get it here !!!

50W Sliding Rheostat

Sliding Rheostat is a variable resistor that can withstand high power. You can get it at our affiliate link here !!

UNI-T Multimeter 

UNI-T Multimeter is a good quality with decent price. We have been using UNI-T multimeter for years has not been any issue. You can get yours at our affiliate link here !!!

Arduino has the ability to measure DC current using current module connected to analog input pin. For Arduino UNO, there are 6 analog input pins (A0-A5) where you can use one of the pins. Arduino NANO has 8 pins while Arduino MEGA has 16 input pins. The analog input pins will map input voltages between 0 and 5V into integer values between 0 and 1023 with resolution of 4.9mV per unit (5.00V / 1024 units). 

All sensors that connected to analog input must be measured by voltage value. In order to provide the current value, the current sensor module is actually providing voltage value that related to measured current value. 

The current sensor utilizing hall-effect principle 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. 

 

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 !!!

Unlike Voltage Sensor, Current Sensor requires initial offset setting. You may need to offset the value by checking the initial false current when no current draws during Arduino startup. Each sensor has its own deviation error. When there is no current sensed, the sensor might not be 100% at middle point of voltage value. Some might be remaining at few milli voltages above / below the middle point even though after averaging. This might be due to voltage supplied not in exact 5V or due to the sensor itself.

 

Secondly, current sensor is also a sensitive sensor. The output reading of the sensor seems to have electrical noises and its value fluctuates  all the time even when there is no current detected. It is more obvious if the measurement is in a smaller time frame. In order to greatly reduce this phenomenon, multiple samples must be taken for averaging must be done. 

Our code is designed to display a value which is derived from averaging 1000 samples in every second. Each sample is recorded every 1 milli second (0.001 second). The single averaged value is then to be displayed at Serial Monitor and LCD Display. With this, the fluctuation of value is way lesser compare to taking 1 sample reading every second. Make sure the sensor cables are tight because minor movement of wires might affects on the wire terminal connections thus affecting the accuracy reading.

 

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 !!!. 

The good news is you do not need to manually calibrate the offset settings 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.  

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 oftern 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 your solar cell, current sensor module and Arduino Board 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 module 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. 

Screw Shield Expansion Board

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 still 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). Make sure you have installed the DHT.h library as attached.

There are 2 source code files attached, the first source code is Irradiation Meter source code with LCD Display Shield while the second code is including the Datalogger Shield. With datalogger shield, not only the daily irradiation can be reset (reset at 12am everyday), but also can record the measurement values into SD card. In order to use the Datalogger Shield, make sure you download and install the library as required. You can visit my post about datalogger shield for detail here !!!. 

The output can also be shown in Serial Monitor using Arduino Software. Once the code is uploaded to Arduino UNO, the value will be displayed on LCD display. The data is saved to SD card every minute by default. 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 Serial Monitor

Result – In LCD Display

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

Irradiation Meter with LCD.ino
Irradiation Meter with LCD & Datalogger Shield.ino