# Low-Cost SCADA System Using Arduino and Reliance SCADA for a Stand-Alone Photovoltaic System

Authors: Ibrahim Allafi; Tariq Iqbal
Journal: Journal of Solar Energy
 (2018)

---

## Abstract

SCADA (supervisory control and data acquisition) systems are currently employed in many applications, such as home automation, greenhouse automation, and hybrid power systems. Commercial SCADA systems are costly to set up and maintain; therefore those are not used for small renewable energy systems. This paper demonstrates applying Reliance SCADA and Arduino Uno on a small photovoltaic (PV) power system to monitor the PV current, voltage, and battery, as well as efficiency. The designed system uses low-cost sensors, an Arduino Uno microcontroller, and free Reliance SCADA software. The Arduino Uno microcontroller collects data from sensors and communicates with a computer through a USB cable. Uno has been programmed to transmit data to Reliance SCADA on PC. In addition, Modbus library has been uploaded on Arduino to allow communication between the Arduino and our SCADA system by using MODBUS RTU protocol. The results of the experiments demonstrate that SCADA works in real time and can be effectively used in monitoring a solar energy system.


---

## Body

## 1. Introduction

For several hundred years, fossil fuels have been consumed as the main source of energy on Earth. As a result, they are now experiencing rapid depletion. Researchers and scientists who understand the importance of renewable energy have dedicated their efforts to the research, expansion, and deployment of new energy sources to replace fossil fuels.Photovoltaics (PV) are an important renewable energy sources. Also called solar cells, PV are electronic devices that can convert sunlight directly into electricity. The modern forms of PV were developed at Bell Telephone Laboratories in 1954 [1]. Despite their promising performance, PV have some limitations, such as depending on factors like longitude, latitude, and weather and being limited to daytime hours to generate power [2].The SCADA system is software that has been installed in several sites to monitor and control processes, and it is called telemetry importance [3, 4]. SCADA can monitor real-time electrical data measurements of solar module and batteries and collect data from wind turbines, such as the condition of the gearbox, blades, and electric system [5, 6]. Moreover, the sun-tracker system has also used the SCADA system to observe the solar insolation and movement of the sun [6].These days, commercial companies are widespread for monitoring systems such as photovoltaic systems. However, those are quite expensive. For example, SMA Company is a German Company, and it was founded in 1981. It has many products. Some of them are related to monitoring and controlling, for example, Sunny View. It can show all of your system data in good condition, and we can read all data clearly. However, the major problem is that the device is costly; it costs about CA$793 [7, 8].A previous study also shows a data acquisition and visualization system, with storage in the cloud, and it has been applied on a photovoltaic system. In addition, this design was based on embedded computer, and it connected with PV inverters by using RS485 standard, and microcontroller is to read climate sensors but sensors have used web system to show data [9].Also, a study shows a low-cost monitoring system, it is presented in [10]. The system has determined losses in energy production. The paper is based on multiple wireless sensors and low cost, and it used voltage, current, irradiation, and temperature sensors which are installed on PV modules as well.In this paper, designed SCADA system is of lower price compared with commercial SCADA system, and it delivers the same performance. In order to test this work, the SCADA system is employed for monitoring the parameters of solar energy systems (photovoltaic) in real time, which consist of a solar module, MPPT, and batteries. The parameters are the current and voltage of the photovoltaic (PV) system and the current and voltage of the battery. Data acquisition system is by Arduino controller and sensors. All data are sent to a PC and are shown on a user interface designed by Reliance SCADA. The data are saved on a computer as an Excel file as well. This allows users and operators to monitor the parameters of the PV system in real time. The components of the SCADA system in this paper consist of two parts: hardware and software.


## 2. Hardware Design

The proposed Reliance SCADA is designed to monitor the parameters of a small PV system. It is installed at the Department of Electrical Engineering, Memorial University, St. John’s, Canada. Figure1 shows 12 solar panels up to 130 watts and 7.6 amp. Two solar modules are connected in parallel. Therefore, the system shown in Figure 1 consists of 6 sets of 260 watts each.Figure 1
Solar panels on the roof of engineering building.The Reliance SCADA system was designed to be of low cost and can be expanded or modified without the need for major hardware changes in the future. Basic elements of the design are an Arduino Uno controller and sensors, as shown in Figure2.Figure 2
Hardware configuration of SCADA system.


### 2.1. Arduino Uno Microcontroller

Arduino Uno is open-source hardware that is relatively easy to use. Figure3 shows Arduino Uno, while Table 1 shows specifications for the hardware. The license gives permission to anyone to improve, build, or expand Arduino. The original Arduino and its enhancement environment were founded in 2005 in Italy at the Smart Project Company. It has 14 digital input/output pins, 6 of which can be used as analog input/output [11].Table 1
Specifications of Arduino board.
Specifications Microcontroller ATmega328 Operating voltage 5 V Input voltage 7–12 V Input voltage (limits) 6–20 V Digital I/O pins 14 (6 PWM outputs) Analog input pins 6 DC current per I/O pin 40 mA DC current for 3.3 V pin 50 mA Flash memory 32 KB (ATmega328) SRAM 2 KB (ATmega328) EEPROM 1 KB (ATmega328) Clock speed 16 MHzFigure 3
Arduino Uno R3.


### 2.2. Current Sensor

Current sensors for DC currents must be able to measure a range of currents for PV and batteries between 0 A and 20 A. In this work, an ACS 712 sensor is used for sensing the current. It is designed to be easily used with any microcontroller, such as Arduino. The sensors are based on the Allegro AC712ELC chip. The scale value of ACS 712, which is used in this design, is 20 amp, which is appropriate for sensing current. Two sensors are installed: one is installed before MPPT to measure the PV current and the other is installed after MPPT to measure the battery current. Figure4 demonstrates how it connects in an electrical circuit with Arduino Uno.Figure 4
Connection drawing of current sensor.


### 2.3. Voltage Sensor

The function of voltage sensors, which are based on just two resistors, is to turn a large voltage into a small one. In this work, the voltage sensor is a 25 V-sensor with two resistors of 30 KΩ and 7.3 KΩ. The maximum voltage of either PV or battery is 25 V, so this sensor is appropriate. The output of the voltage sensor is between 0 V and 5 V. This scale is suitable to the Arduino analog inputs. In this experiment, we need two voltage sensors: one is installed before MPPT to measure the PV voltage and the other is installed after MPPT to measure the battery voltage. Figure5 demonstrates how it connects in an electrical circuit with Arduino Uno.Figure 5
Connection drawing of current sensor.


## 2.1. Arduino Uno Microcontroller

Arduino Uno is open-source hardware that is relatively easy to use. Figure3 shows Arduino Uno, while Table 1 shows specifications for the hardware. The license gives permission to anyone to improve, build, or expand Arduino. The original Arduino and its enhancement environment were founded in 2005 in Italy at the Smart Project Company. It has 14 digital input/output pins, 6 of which can be used as analog input/output [11].Table 1
Specifications of Arduino board.
Specifications Microcontroller ATmega328 Operating voltage 5 V Input voltage 7–12 V Input voltage (limits) 6–20 V Digital I/O pins 14 (6 PWM outputs) Analog input pins 6 DC current per I/O pin 40 mA DC current for 3.3 V pin 50 mA Flash memory 32 KB (ATmega328) SRAM 2 KB (ATmega328) EEPROM 1 KB (ATmega328) Clock speed 16 MHzFigure 3
Arduino Uno R3.


## 2.2. Current Sensor

Current sensors for DC currents must be able to measure a range of currents for PV and batteries between 0 A and 20 A. In this work, an ACS 712 sensor is used for sensing the current. It is designed to be easily used with any microcontroller, such as Arduino. The sensors are based on the Allegro AC712ELC chip. The scale value of ACS 712, which is used in this design, is 20 amp, which is appropriate for sensing current. Two sensors are installed: one is installed before MPPT to measure the PV current and the other is installed after MPPT to measure the battery current. Figure4 demonstrates how it connects in an electrical circuit with Arduino Uno.Figure 4
Connection drawing of current sensor.


## 2.3. Voltage Sensor

The function of voltage sensors, which are based on just two resistors, is to turn a large voltage into a small one. In this work, the voltage sensor is a 25 V-sensor with two resistors of 30 KΩ and 7.3 KΩ. The maximum voltage of either PV or battery is 25 V, so this sensor is appropriate. The output of the voltage sensor is between 0 V and 5 V. This scale is suitable to the Arduino analog inputs. In this experiment, we need two voltage sensors: one is installed before MPPT to measure the PV voltage and the other is installed after MPPT to measure the battery voltage. Figure5 demonstrates how it connects in an electrical circuit with Arduino Uno.Figure 5
Connection drawing of current sensor.


## 3. Hardware Setup

Figure6 shows the hardware setup designed for the SCADA system.Figure 6
Hardware setup of SCADA system.


## 4. Software Requirements

### 4.1. Arduino IDE

IDE is open-source software that features easy-to-write code that can be uploaded to any board. In this work, we needed to upload a new library on IDE to make a configuration between Arduino Uno and SCADA software by MODBUS RTU protocol. Figure7 shows how the system works and also shows the code that has been burned on Arduino Uno.Figure 7(A) Flow Chart. See Figure 7.(B) Code. The code has some main functions such as setup() (it is called once when the sketch starts) and loop() (it is called over and over and is heart of sketch). The most important in the code are libraries mentioned initially: regBank.setId() command, regBank.add(), and regBank.set(). The purpose of libraries is to connect between Arduino Uno and Reliance SCADA software by MODBUS RTU protocol. regBan.setId() is used to define MODBUS to work as slave. regBank.add() command is used to define addresses of registers which are used to send data to Reliance SCADA on computer. In this work, the addresses were from 30001 to 30005 as mentioned in the code, while reBank.set() command is used to write data on the previous addresses.#include <modbus.h>#include <modbusDevice.h>#include <modbusRegBank.h>#include <modbusSlave.h>modbusDevice regBank;modbusSlave slave;float out1 = 0.0; float out2 = 0.0; float out3 = 0.0; float out4 = 0.0; float AIO; float AI1; float AI2; int AI3; float vpv = 0.0; float vbatt = 0.0; float eff = 0.0; float p1 = 0.0; float p2 = 0.0; int mVperAmp = 100; int ACSoffset = 2500; double Voltage2 = 0; double Voltage3 = 0; double Ampspv = 0; double Ampsbatt = 0; float R1 = 30000.0; float R2 = 7500.0; void setup(){Serial.begin(9600);regBank.setId(10); ///Set Slave IDregBank.add(30001); regBank.add(30002); regBank.add(30003); regBank.add(3 0004); regBank.add(30005);slave._device = &regBank;slave.setBaud(9600);pinMode(0,INPUT); pinMode(1,INPUT); pinMode(2,INPUT); pinMode(3,INP UT); }void loop(){while(1){int AIO = analogRead(0); int AI1 = analogRead(1); int AI2 = analogRead(2); int AI3 = analogRead(3); vpv = (AIO∗ 5.0)/1024.0;out1 = vpv/(R2/(R1+R2));vbatt = (AI2∗ 5.0)/1024.0;out2 = vbatt/(R2/(R1+R2));Voltage2 = (AI1/1024.0)∗ 5000;Ampspv = ((Voltage2 - ACSoffset)/mVperAmp); Voltage3 = (AI3/1024.0)∗ 5000;Ampsbatt = ((Voltage3 - ACSoffset)/mVperAmp); p1 = vpv∗ Ampspv;p2 = vbatt∗ Ampsbatt;eff = p2/p1;Ampspv=abs(Ampspv);Ampsbatt=abs(Ampsbatt);out1=out1∗100;Ampspv= Ampspv∗(100);out2=out2∗100;Ampsbatt=Ampsbatt∗(100);eff=eff∗100;regBank.set(30001, (word) out1);regBank.set(30002, (word) Ampspv);regBank.set(30003, (word) out2);regBank.set(30004, (word) Ampsbatt);regBank.set(30005, (word) eff);delay(60000)slave.run();}}


### 4.2. Reliance SCADA

Reliance software is employed in numerous technologies for monitoring and controlling systems. It can also be used for connecting to a smartphone or the web. Reliance is used in many colleges and universities around the world for education or scientific research purposes [12]. Figure 8 shows a user interface designed by Reliance SCADA software to monitor the parameters of the photovoltaic system.Figure 8
User interface of SCADA system.The user interface has four real-time trends and four display icons to show values as digital numbers. In addition, it has two buttons and a container. These features are discussed in Results and Discussion.


## 4.1. Arduino IDE

IDE is open-source software that features easy-to-write code that can be uploaded to any board. In this work, we needed to upload a new library on IDE to make a configuration between Arduino Uno and SCADA software by MODBUS RTU protocol. Figure7 shows how the system works and also shows the code that has been burned on Arduino Uno.Figure 7(A) Flow Chart. See Figure 7.(B) Code. The code has some main functions such as setup() (it is called once when the sketch starts) and loop() (it is called over and over and is heart of sketch). The most important in the code are libraries mentioned initially: regBank.setId() command, regBank.add(), and regBank.set(). The purpose of libraries is to connect between Arduino Uno and Reliance SCADA software by MODBUS RTU protocol. regBan.setId() is used to define MODBUS to work as slave. regBank.add() command is used to define addresses of registers which are used to send data to Reliance SCADA on computer. In this work, the addresses were from 30001 to 30005 as mentioned in the code, while reBank.set() command is used to write data on the previous addresses.#include <modbus.h>#include <modbusDevice.h>#include <modbusRegBank.h>#include <modbusSlave.h>modbusDevice regBank;modbusSlave slave;float out1 = 0.0; float out2 = 0.0; float out3 = 0.0; float out4 = 0.0; float AIO; float AI1; float AI2; int AI3; float vpv = 0.0; float vbatt = 0.0; float eff = 0.0; float p1 = 0.0; float p2 = 0.0; int mVperAmp = 100; int ACSoffset = 2500; double Voltage2 = 0; double Voltage3 = 0; double Ampspv = 0; double Ampsbatt = 0; float R1 = 30000.0; float R2 = 7500.0; void setup(){Serial.begin(9600);regBank.setId(10); ///Set Slave IDregBank.add(30001); regBank.add(30002); regBank.add(30003); regBank.add(3 0004); regBank.add(30005);slave._device = &regBank;slave.setBaud(9600);pinMode(0,INPUT); pinMode(1,INPUT); pinMode(2,INPUT); pinMode(3,INP UT); }void loop(){while(1){int AIO = analogRead(0); int AI1 = analogRead(1); int AI2 = analogRead(2); int AI3 = analogRead(3); vpv = (AIO∗ 5.0)/1024.0;out1 = vpv/(R2/(R1+R2));vbatt = (AI2∗ 5.0)/1024.0;out2 = vbatt/(R2/(R1+R2));Voltage2 = (AI1/1024.0)∗ 5000;Ampspv = ((Voltage2 - ACSoffset)/mVperAmp); Voltage3 = (AI3/1024.0)∗ 5000;Ampsbatt = ((Voltage3 - ACSoffset)/mVperAmp); p1 = vpv∗ Ampspv;p2 = vbatt∗ Ampsbatt;eff = p2/p1;Ampspv=abs(Ampspv);Ampsbatt=abs(Ampsbatt);out1=out1∗100;Ampspv= Ampspv∗(100);out2=out2∗100;Ampsbatt=Ampsbatt∗(100);eff=eff∗100;regBank.set(30001, (word) out1);regBank.set(30002, (word) Ampspv);regBank.set(30003, (word) out2);regBank.set(30004, (word) Ampsbatt);regBank.set(30005, (word) eff);delay(60000)slave.run();}}


## 4.2. Reliance SCADA

Reliance software is employed in numerous technologies for monitoring and controlling systems. It can also be used for connecting to a smartphone or the web. Reliance is used in many colleges and universities around the world for education or scientific research purposes [12]. Figure 8 shows a user interface designed by Reliance SCADA software to monitor the parameters of the photovoltaic system.Figure 8
User interface of SCADA system.The user interface has four real-time trends and four display icons to show values as digital numbers. In addition, it has two buttons and a container. These features are discussed in Results and Discussion.


## 5. Communication System

MODBUS library is added to Arduino Uno to allow communication with Reliance SCADA via a USB cable using MODBUS RTU protocol. Table2 shows the allocation of MODBUS address for MODBUS RTU on Reliance SCADA software, with the MODBUS address for Arduino Uno mentioned in the Arduino code.Table 2
Allocation of MODBUS address for MODBUS RTU.
Number Variable name MODBUS RTU address (1) Voltage of photovoltaic system 0 (2) Current of photovoltaic system 1 (3) Voltage of battery 2 (4) Current of battery 3 (5) Efficiency of MPPT 4


## 6. Cost of the SCADA System

Most factories that use several systems are looking for a low cost SCADA system to monitor and control their systems remotely. In this paper, the components used are quiet cheap. Table3 shows the price (CA dollar) for whole components according to the amazon.ca website.Table 3
Price components of SCADA system.
Number Item Quantity Price (1) Current sensor 2 6.8 (2) Voltage sensor 2 7.3 (3) Arduino Uno 1 7.9 (4) Software (IDE) — Free (5) Software (Reliance) — Free (6) Old small computer(PC) with Windows 7 1 60  Total amount   CA $82According to Table3, we found that the whole price of SCADA system was CA$82. This price seems cheap to design SCADA system for monitoring parameters of our system.


## 7. Results and Discussion

In this work, the proposed SCADA monitors a solar energy system and several experiments are carried out. The experiments cover the measurement error of the sensor systems which are installed to measure PV current and voltage, battery current and voltage, MMPT efficiency, and SCADA features.The sensors that are used contain errors, so these errors are calculated with calibrated instruments, as listed in Table4.Table 4
Measurement errors of sensor system.
Number Sensor Value Calibrated instrument Value Measurement error (1) PV-voltage sensor 15.3 V Voltmeter-ammeter 15.5 V 1.31% (2) Battery-voltage sensor 13.84 Voltmeter-ammeter 14.33 3.42% (3) PV-current sensor 3.22 A Voltmeter-ammeter 2.77 A 1.62% (4) Battery-current sensor 3.66 A Voltmeter-ammeter 3.55 A 3.10%As can be seen in Table4, the measurement error of current sensors was the highest. The error percentages of the PV current sensor and the battery current sensor are about 3.42% and 3.10%, respectively. Although the error percentages of both voltage sensors were quite low, they were closer to the calibrated instrument.The monitoring tasks are displayed on the PC. They include the PV parameters as a graph and digital numbers and the MPPT efficiency as digital numbers. Figure9 shows the user interface of SCADA after the system was operational.Figure 9
User interface of SCADA while running.The SCADA system is designed to make an update every minute. As shown in Figure9, there are four figures: two of them observe the PV voltage and current and the other two monitor the battery voltage and current. The figure also shows that the SCADA system makes updates every minute.The user interface of SCADA shows five icons displaying values of parameters as digital numbers, and they also make automatic updates every minute.Our SCADA system has the feature of enabling all data to be easily saved on a computer as an Excel file. To save the data, the user just has to hit the Export-Data icon and then hit the Save-Data icon. These icons are programmed by script to save the data on a PC as an Excel file. Figure10 shows a screenshot of data saved in Excel.Figure 10
Data saved in Excel file.Also, user interface has a container that shows details. The Arduino connects with SCADA, and it gives warning if there is any error in connection.The efficiency of MPPT was also monitored. It represents the output power of MPPT over the input power to MPPT. Figure11 presents MPPT efficiency for various periods of time, with efficiency ranging between 1 and 0.8.Figure 11
Efficiency of MPPT.


## 8. Conclusion

In this paper, a low-cost SCADA system was designed and built with Reliance SCADA software and Arduino Uno. The SCADA system was applied to a stand-alone photovoltaic system to monitor the current and voltage of PV and batteries. The results of the experiments demonstrate that SCADA works in real time and can be effectively used in monitoring a solar energy system. The developed system costs less than$100 and can be modified easily for a different PV system.



---

*Source: 3140309-2018-05-02.xml*