Developing a Prototype for Sun Tracker System Based on IoT: Controlled by Mobile App and Online Database Monitoring

1Department of Computing, Faculty of Art, Computing and Creative Industry, Universiti Pendidikan Sultan Idris, 35900 Tanjong Malim, Malaysia 2Department of Electronic and Computer Eng., Universiti Teknikal Malaysia Melaka, Melaka, Malaysia 3School of Computing and Creative Media, University College of Technology Sarawak, Sarawak, Malaysia Department of Chemistry, Faculty of Science & Mathematics, Universiti Pendidikan Sultan Idris, 35900 Tanjong Malim, Malaysia Lamintang Education and Training (LET) Centre, Buana Impian, Blok B1 No. 27 & 28, Kota Batam, Kepri, Indonesia


Introduction
The community's need for energy is currently increasing, along with the increase in population and technological advancement (Ranabhat et al., 2016;Lee et al., 2009). Energy use until 2025 is still dominated by fossil fuels namely petroleum, natural gas and coal (Bryan et al., 2011;Barbose et al., 2014). Although petroleum reserves, natural gas and coal are still quite high, the use of these fuels is a source of carbon dioxide emissions (Samrat et al., 2014).
Also, with other energy sources such as water and wind. The use of water energy is often an obstacle when the dry season arrives where water sources used as plants often recede and water discharge is reduced so that energy generation cannot operate optimally. Meanwhile, wind energy is rather complicated because the construction requires certain regional topologies.
Therefore, the choice of energy sources that are very suitable for tropical regions that get sunlight throughout the year such as in Malaysia, Indonesia, Papua New Guinea and the areas that are on the equator is solar energy. Even though there is a rainy season, it can be said that sunlight will be available throughout the year. Sunlight is a natural energy source that is available as alternative energy that is clean, non-polluting, safe and with unlimited supplies.

Solar Cell
One of the technological efforts to utilize solar energy is to use solar cells. Solar cells are a collection of photovoltaic cells that can convert sunlight into electricity. Solar cells will produce electrical energy according to the intensity of light received from the sun's rays (Alexandru, 2013;Bradbury et al., 2016).
Conventional solar cells work using the principle of p-n junction, which is the junction between the p-type semiconductor and the n-type. This semiconductor consists of atomic bonds in which there are electrons as a basic constituent. N-type semiconductors have excess electrons (negative charges) while p-type semiconductors have excess holes (positive charge) in their atomic structure. The condition of the excess electrons and holes can occur by doping the material with a dopant atom. As an example, to get a P-type silicon material, silicon is doped by boron atoms, whereas to get an N-type silicon material, silicon is doped by phosphorus atoms.
The role of these p-n junctions is to form an electric field so that electrons (and holes) can be extracted by contact material to produce electricity. When the p-type and n-type semiconductors are contacted, the excess electrons will move from the n-type semiconductor to the p-type to form a positive pole in the n-type semiconductor and the negative pole on the p-type semiconductor instead. As a result of the flow of electrons and holes, an electric field is formed which when the sun's light on the PN of these junctions will push electrons to move from the semiconductor to the negative contact, which is then used as electricity and instead the hole moves towards the positive contact waiting for the electron to come, like illustrated in Fig. 1.
Various techniques are used in maximizing the absorption of sunlight, including image processing techniques in Lee et al. (2013) study, attitude determination in Rufino and Grassi (2009) research, altazimuthal tracker in Merlaud et al. (2012) study, multi-robot systems in Rodr´ıguez-Canosa et al. (2014 study, VOC algorithms in Antolín et al, (2017) study and others technique used in other related study such as in Zhu and Zhao (2018), Tharamuttam and Ng (2017) and Wang and Lu (2013) studies.

Internet of Things
The Internet of Things (IoT) is a concept where everything around us can communicate with each other through an internet network. The initial idea of IoT was first raised by Kevin Ashton in 1999 (Skouri et al., 2016).
There are two types of devices that are often used in applying IoT, namely Arduino and Raspberry Pi (Scott, 2015;Horan, 2013;Upton, 2015).

Arduino
Arduino is one of the AMEGA 328 (datasheet) microcontrollers. It has 14 input pins from the digital output where the 6 input pins can be used as PWM outputs and 6 analogue input pins, 16 MHz crystal oscillator, USB connection, power jack, ICSP header and reset button. Arduino as shown in Fig. 2, is based on Embedded System so that Arduino does not need an Operating System in operation. And, Arduino doesn't need a downloader to program it. Arduino supports C/C ++ Language. To program Arduino is enough to connect it to a computer via USB and activate the Arduino IDE (Integrated Development Environment).
In its specifications, Arduino has 32 KB Flash memory, 2 KB SRAM, 1 KB EEPROM and has a clock speed of 15 MHz. These specifications are sufficient for a microcontroller to meet the needs of a project, but users cannot write programs more than 32 KB.
Arduino is very powerful in supporting other hardware devices such as switches, sensors, other microcontrollers and so on. Arduino also has a variety of Shields that have various functions such as shields that function as Wi-Fi, LCD, Bluetooth modules and so on.

Raspberry Pi
Raspberry Pi as shown in Fig. 3, is a Single Board Computer, so it can be said that Raspberry Pi is a mini computer that can be used as a computer that is commonly used. Raspberry Pi requires Linux in operation.
Raspberry Pi Has 4 Slots in B + type, HDMI Port, LAN Port, Jack and Video Audio Port (RCA) and Mini USB Port as Charger for Raspberry Pi. To operate the Raspberry Pi needed is an SD card to install the operating system, mouse, keyboard and monitor that has an HDMI input.
In Operation, Raspberry Pi uses Python and Perl languages in programming. The Raspberry Pi has two models namely the A model and the B model. The difference between the A and B models lies in the memory used, Model A uses 256MB of memory and the 512MB B model. Besides that, the B model has also been equipped with an Ethernet port (network card) that is not found in the A model. The Raspberry Pi design is based on the Broadcom BCM2835 Systemon-a-chip, which has embedded the ARM1176JZF-S processor with 700 MHz, Video Core IV GPU and 256 Megabytes of RAM (model B).
To improve its performance, the Raspberry Pi is supported by several additional shields for example Camera Module, LCD Display Module and others. Data storage on the Raspberry Pi is designed not to use hard disks or solid-state drives but instead relies on SD memory cards for long-term boot and storage.

Comparison between Arduino and Raspberry Pi
The strengths and weaknesses of the two depending on what they are used for. If the goal is to use high efficiency real-time control, then Arduino is better. But Raspberry Pi has advantages, it can do all the functions of a computer. Whether it's programming, multimedia, or surfing in cyberspace. Apart from that, by using Raspberry Pi, the user can control the project through the Linux GUI found on the Raspbian OS, so that testing on a project can be done easily.
For example, when creating a robot project, the Arduino is best used because it has a higher level of precision compared to Raspberry Pi. That is because Arduino uses Firmware in its operation, unlike Raspberry Pi which uses the Operating System. Raspberry Pi that uses the OS in its operation will take longer than Arduino. That's because also because the resources contained in Raspberry Pi tend to prioritize all the processes that are in the OS.

Solar Tracking based on IoT
In its application, solar panels are placed statically where the solar panel only leads to one particular direction so that the absorption of sunlight intensity cannot be performed optimally and results in the 14 maximum power produced. To utilize solar energy maximally, the solar panel must follow the direction of sunlight. The greater the intensity of sunlight captured by the solar panel, the greater the electrical power produced. Therefore, a control device is made that allows solar panels to move in the direction of the sun's crossing from east to west.
This research uses a solar tracker consisting of horizontal axis tracker and vertical axis tracker. The rotation axis for the horizontal axis tracker is mounted in a horizontal position with the ground, where horizontal axis tracker works more effectively at low latitudes. The rotation axis for vertical axis tracker is made perpendicular to the ground. This vertical axis tracker moves from East to West and is more effective at high latitudes compared to horizontal axis tracker.
The use of these two types of tracker will make the controller's performance increase. The movement of the two trackers will be controlled through a mobile application built in the AppInventor platform. System control can be done from anywhere without having to be near the system. A mini Liquid Crystal Display (LCD) 7" inch size monitor that is activated using a microcomputer raspberry pi serves to display information on the reading of the temperature, voltage and light intensity obtained by solar panels. This information is also displayed in real time at http://thinger.io so database monitoring can be done anywhere via the web.
A Model proposed for solar tracking as shown in Fig. 4.

Working Principles
The system is equipped with a 12 Volt power supply. The power supply serves to provide energy to microcontrollers and other devices. There are diodes and potentiometers installed between the solar panel and the battery. The diode serves to prevent the battery from supplying the solar panel. And the potentiometer connected to the Arduino serves to regulate the sensitivity of the solar tracker.
In addition, the system is equipped with a battery control unit, which is a device that functions to decide the charging between the solar module and the battery when it has reached the maximum threshold, which is 13.65 Volts (in this case a 12 Volt battery capacity) and disconnect between battery and load when the battery capacity reaches the minimum threshold, which is 10.5 Volts.
Block diagram of the model proposed for solar tracking shown in Fig. 5. The working principle of the system is that the batteries and photovoltaic modules work together to provide electrical energy to the load. Electrical energy can be generated directly from the photovoltaic module during the day and energy is taken from the battery at night. Energy can be taken from batteries and photovoltaic during cloudy weather. All cannot be separated from the BCU (Battery Control Unit) function as a regulator.
When the system is first turned on, the system will initiate the solar parts tracking system, after the initialization process, the microcontroller is active. Engineering can then control the position of the panel remotely through mobile apps. After obtaining a position that allows solar panels to absorb sunlight optimally, the system will absorb solar energy. After maximum energy is obtained, the energy is converted into electrical energy and then stored in the battery and can also be directly used to charge (charger).
During the day, the sun shines by removing radiation energy through light waves. With photovoltaic modules, the light energy from solar radiation is converted into electrical energy. If the voltage on the module is greater than the battery voltage, the charging current occurs to the battery. The battery voltage will continue to increase linearly with the charging time. If the battery voltage has reached the maximum threshold set, which is 13.65 Volts, then BCU will disconnect between the photovoltaic module and the battery.
At night, there is no energy produced by the photovoltaic module, which automatically supplies energy to the load is the battery. If you use too much battery energy, the battery voltage will decrease as the battery energy decreases. If the battery voltage drops past the minimum threshold set, which is 10.5 volts, then the load will automatically die which is marked by a disconnection between the battery and the load.

Experiment Design
There are several important things for the solar tracking that are proposed excluding Raspberry PI and Arduino, namely:  Figure 6 shows the 5 Volt DC solar panel prototype used in this study. A 5 Volt DC solar panel has a measured maximum voltage of 6.5 volts and a minimum voltage of 0 volts. The solar panel has two cables, namely a positive cable and a negative cable that will flow in a direct electric current (DC current). Simply put, the working principle is when the solar panel is exposed to sunlight, it will produce voltage.

Tracking
Azimuthal dual-axis system used for this research, where daily motion is made by rotating the module around the vertical axis so that it is necessary to continuously combine the vertical rotation with an altitudinal motion around the horizontal axis. Figure 7 shows the sensor system of the proposed and called as four-quadrant sensor system.

Power Supply
The Power Supply circuit is the main series of microcontroller-based prototype solar tracking systems. The Power Supply circuit connects the resource with the entire circuit. The power source used comes from a battery with a voltage of 5 volts. Figure 8 shows the servo motor used in this research. A servo motor is a rotary device or actuator (motor) designed with a closed loop feedback control system (servo) so that it can be set-up or adjusted to determine and ensure the angular position of the motor output shaft.  The servo motor used in this study is a DC servo motor with standard rotation. DC servo motor is a device that consists of a DC motor, a series of gears, a control circuit and a potentiometer. A series of gears attached to the DC motor shaft will slow down the shaft rotation and increase the servo motor torque, while the potentiometer with resistance changes when the motor rotates serves as a determinant of the position limit of the servo motor shaft rotation. The standard rotation servo motor (180° servo rotation) is a servo motor with its output shaft rotation limited to 90° to the right and 90° to the left.

Mini LCD
This system uses a 7" inch mini Liquid Crystal Display (LCD) as shown in Fig. 9, which is activated using a raspberry pi microcomputer. Mini LCD will display information about reading the slope, temperature, voltage and light intensity.

Light Dependent Resistor
In this research, four LDR were used to determine the resistance value, in which the LDR was installed in each corner of the solar cell.
Light Dependent Resistor (LDR) as shown in Fig. 10, is a type of resistor whose resistance value or resistance value depends on the intensity of the light it receives. The value of LDR resistance will decrease when bright light and value will become high if in dark conditions. In other words, the function of the LDR is to deliver electric current if it receives a certain amount of light intensity (Light Condition) and inhibits an electric current in dark conditions. The rise and fall of the resistance value will be proportional to the amount of light it receives.

Temperature Sensor DHT11
The DHT11 sensor is a sensor module that functions to sensing temperature and humidity objects that have the analog voltage output that can be further processed using a microcontroller. Figure 11 shows DHT11 used in this research.
The DHT11 sensor has three pins, namely: • The VCC pin is connected to a source voltage of 3.3 volts or 5 volts DC • Data pins are connected with digital pins found on the microcontroller • The ground pin is connected to the ground pin on the microcontroller

Microcontroller ESP8266 NODE MCU
This study uses the ESP8266 Microcontroller NODE MCU for Wi-Fi connection, as shown in Fig. 12. ESP8266 is a Wi-Fi module that functions as an additional microcontroller like Arduino so that it can connect directly with Wi-Fi and make TCP/IP connections. This module requires a power of around 3.3v with three Wi-Fi modes, namely Station, Access Point and Both. This module is also equipped with processor, memory and GPIO where the number of pins depends on the type of ESP8266 used. This module can stand alone without using any microcontroller because it already has equipment like a microcontroller.
Node MCU ESP8266 is a development derivative module of the ESP8266 family type EST-12 IoT (Internet of Things) platform module. Functionally this module is almost similar to the Arduino module platform, but what distinguishes it is devoted to "Connected to the Internet".

MPU6050
In this research MPU6050 sensor was used. MPU6050 as shown in Fig. 13, is a sensor used to determine slope. The MPU6050 sensor is able to read angle tilt based on data from the accelerometer sensor and gyroscope sensor.
The MPU6050 sensor has 8 pins, including: 1. Pin Vcc, connected to a 3 Volt pin 2. Pin GND, connected to a GND ESP pin 3. Pin SDA connected to a D2 ESP pin 4. Pin SCL connected to a D1 ESP pin 5. Four pins no need connected to any pin

Micro SD Card -ESP
The Micro SD Card as shown in Fig. 14, communicates with ESP using SPI. The Micro SD Card library is "SD.h", which is provided by Arduino by default when installing the Arduino IDE Software. The 1 is Vcc 2 is Data 3 is Ground 1 2 3 library "SD.h" will be used to Read and Write on a Micro SD card.

Voltage Sensor
The working principle of the voltage sensor module is based on the principle of suppression of resistance and can make the input voltage decrease by 5 times the original voltage.
Voltage Sensor VCC < 25 is used in this research. The form of a voltage sensor module as shown in Fig. 15.

Analog to Digital Converter
The An analogue to digital converter (ADC) circuit converts the output of the analogue circuit to digital logic (1/0) with 5 Volt DC V reff . By comparing V reff , V in (+) and V in (-) it will get data in the form of digital signals calculated based on Equation 1: The results of these calculations are then converted into binary data that will be issued through the ADC port as information on the amount of voltage.

AppInventor
The controller is built using the AppInventor platform which is activated by logging in at http://ai2.appinventor.mit.edu. Front page of the AppInventor shown in Fig. 16. The control is based on mobile apps where engineers need to enter their ID and Password to be active in the system. In this study, angles were determined at 0, 30, 90, 120 and 180 for each horizontal and vertical axis tracker.

ThingerIo
ThingerIo is used to display information about reading the slope, temperature, voltage and light intensity. This information will be displayed in real time in the form of a chart or graphic. ThingerIo. Activated via https://console.thinger.io. Front page of the ThingerIo shown in Fig. 17.

System Performance
The Fig. 18 shows the physical form of the design results of the system, while the diagram block for testing process shown in Fig. 19. In this research, the hardware circuit consists of three parts, namely: 1. The first part is the series of Arduino, Battery and LCD that will be connected via a jumper cable. All three devices have an input of 5 volts.

22
2. The second part is a series of solar tracking devices, consisting of two servo motors and a solar panel module. 3. The third part is the LCD circuit on the control board which serves to display the energy output absorbed by the solar panel, the better capacity received and the output of the energy used.
System testing is done to find out whether the system can function according to its function and can produce output as expected.
The first test is carried out on sensors and servo, where the data sent by the sensor is sent to servo to test each servo movement whether it has moved according to the procedure when it was executed. The next test is testing on an Appbased controller. Testing on the controller is done by entering certain angles according to the design results in the AppInventor. The controller test is followed by testing the database information that has been built at ThingerIo. The solar panel will be activated and the reading results will be viewed on the ThingerIo web using a mini LCD.
After the system is running properly and all parts function as desired, it will be followed by data retrieval of the temperature, voltage and light intensity of the solar panel.

Tool Performance Testing
Headings When the solar cell is illuminated by the sun it will produce energy (voltage). The magnitude of the voltage generated depends on the amount and intensity of the sun's rays on the solar cell and depends on the amount of solar cell used. The lighter that hits solar cell, the greater the voltage generated. Likewise, the opposite, the less sunlight intensity about solar cell, the voltage generated will decrease (during the cloudy or late afternoon). At night it is not exposed to sunlight so there is no voltage generated.
The reading of the data taken during the sunny days (days 1, 2 and 4) can be seen in Fig. 20, 21 and 22. When the weather is sunny, it can be seen that the temperature directly proportional to voltage and light intensity. In addition, the graphic shows a regular pattern. In the morning, the intensity of the light received by the solar panel will be maximum when directed to the position of 30 degrees from the rising sun. The servo moves horizontally and scans. At noon, the intensity of the light received by the solar panel will be maximum when it is directed to a position 90 degrees from the rising sun.
In the afternoon, the intensity of the light received by the solar panel will be maximum when directed to the position of 60 degrees from the rising sun.
The dual axis tracking system works optimally during the morning and evening. While during the day the Voltage produced in the solar tracker tends to be the same because the position of the sun is perpendicular to the solar cell.
When the sunny weather there is obtained, the average temperature is 29.50, the average voltage is 19.40 Volt and the average light intensity is 23,187 Lux. Figures 23 and 24 show the graph of temperature, voltage and light intensity during cloudy weather. When the weather is cloudy, the chart shows the voltage pattern and the intensity of the light which is directly proportional, but not the temperature graph. The motor will work heavier because the operator will always move it to find a certain angle that can produce maximum light intensity. When the cloudy weather is obtained, the average temperature is 28.10 Celsius, the average voltage is 18.05 Volt and the average light intensity is 21,688 Lux. Figure 25 shows the graph of temperature, voltage and light intensity during rainy weather. The graph shows the results of reading in a random pattern. Light intensity moves up and down sharply. This is because the intensity of the light received by the solar cell is very minimum even though the solar cell position has been changed.
When the rainy weather is obtained, the average temperature is 26.03 Celsius, the average voltage is 13.60 Volt and the average light intensity is 18,364 Lux.

Conclusion
The Some conclusions from this research are: 1. The use of AppInventor and ThingerIo is very helpful in maximizing device performance. AppInventor and ThingerIo make the connection between mechanical tools, mobile app-based controls and real-time data readings very close. 2. Dual axis sun tracker devices that are built using four LDRs produce an average voltage of 19.40 Volt when the sunny weather, 18.05 Volt when the cloudy weather and 13.60 Volt when the rainy weather. 3. In this research, it was found that the temperature is very influential on the amount of voltage produced.
Where the temperature is directly proportional to the resulting voltage. Besides that, the temperature is influenced by the large intensity of sunlight absorbed by the sun tracker. When the sunny weather is obtained, the average temperature is 29.50 Celsius, the average voltage is 19.40 Volt and the light intensity is 23,187 Lux. 4. To maximize absorption of light intensity by the solar panel, the use of vertical axis and the horizontal axis is insufficient. Adding a Z-axis needs to be considered. While to reduce operator load, the use of an automatic solar tracker needs to be considered. 5. To maximize the absorption of sunlight, more research is needed on the harmonious relationship between the width of the solar cell, the tracker design and the motor strength. 6. Arduino is suitable to make a project related to hardware (mechanics) and Raspberry Pi is suitable to make a project that can deal with the internet directly (reading data in real time).