Development of an inexpensive data logger for solar water heating system regulators

Received Oct 16, 2018 Revised Nov 19, 2018 Accepted Mar 1, 2019 Each solar thermal plant can provide different parameters to be treated and evaluated, mostly temperature measurements, pressure specifications, heat transfer values. This data collection can be quite expensive taking into account the important number of sensors and data loggers and their specifications. Hence to assure flexibility in the data collection at a low cost, many hardware and software specifications can be adopted. Here we built an inexpensive data logger based on the Arduino board and IDE to collect and store incoming data from Resol DeltaSol regulators integrated in different solar water heating systems. The objective of this study is to allow massive synchronized measurements with high resolution to be stored into an SD card through the Arduino platform. The measurements are given by multiple sensors (temperature, pump speed, relay states) connected to the regulator. The results from the tests of the plant connected to the data logger are provided later on, alongside the commercial aspects of the built data logging device. After a month of daily measurements, the data logger showed an outstanding performance with an extreme low cost compared to industrial datalogger.


INTRODUCTION
Renewable energy today is by far the first studied, evaluated and promoted science all around the world due to many factors, including sustainable development, the decrease of fossil energy reserves because of the excessive industrial and domestic use for power extraction, as well as the increase in the energy demand [1]. Solar energy, wind, hydraulic and biomass energy sources are coming hand in hand with fuel to overcome the challenge of good function through a long time [2]. Nevertheless, solar energy is considered the most efficient in terms of clean exploitation and conversion processes, including photovoltaic, photochemical, and photo thermal conversion, converting sun radiation to electricity, chemical and thermal energy respectively. Nevertheless, the energy conversion efficiency remains low in photovoltaic and chemical applications compared to the thermal conversion approach [1,2].
The thermal conversion process is considered the traditional conversion method transforming solar radiation into heat; this type of energy extraction process is quite applicable on Moroccan soil. As an example, the concentrated solar power plant built in Ouarzazat, this kind of renewable energy extraction systems helps reduce the very high energy dependency of Morocco (depends mainly on imported sources (96%)) [3] and also prohibit further pollution problems in the future. The Integration of embedded systems in different electric plants [4], especially mega energy furnaces and heating systems [5], is crucial in order to realize different tasks without involving any human control [6]. Monitoring variables can provide early warnings of malfunction, therefore minimizing relevant costs and finally helps observing their long-term

MATERIAL AND METHODS
A solar collector was installed on the roof of the Solar energy laboratory, physics department, Faculty of Sciences, IBN TOFAIL University Kenitra Morocco Latitude: 34°15′39″ north, Longitude: 6°34′48″ west, 13 m above sea level. The collector is connected to a 195 L tank (Elbi BSV-200) to store the heated water and transfer the heat to the biodigester. The total system is monitored and regulated using a Resol DeltaSol C/4 regulator, controlling the pumps, electro vans and displaying the different temperatures of the system [ Figure 1]. System data is collected and stored in a micro SD card every 10 minutes.

Solar heating system
The solar heating system used in this study is a typical solar water heater, consisted of a solar collector, storing tanks, and pump regulator as described in Figure 1.

2.1.1.Solar collector
The collector used in this paper is a SisTEM Tabular heat pipe Integrated Pressurized solar water heater, of 2.7m 2 superficies, facing south and inclined at 37°. The system is composed of 24 glass heat pipes each pipe is 1.9 m long and 0.55 m interior diameter, connected to a thermosiphon tank and build over a frame support shown in Figure 2. Glass heat pipe evacuated tube; Glass heat pipe evacuated tube consists of two 1930 mm Borosilicate layers 3.3 with 96% light absorption coefficient, separated by a vacuum, the outer tube is 47 mm large while the inner tube is 37 mm. It is quite similar to conventional solar vacuum tubes, however the difference between the two technologies is given by the closed special geometry (dome shaped) at the end of the tube. This special feature, helps increasing resistant to axial loads in pressurized storing systems. This enclosed area -inside the inner tubeis vacuumed and injected with a heat transfer fluid. The surface coating material of the inner tubes outer surface is an Al-Cu-Ss selective, it changes the solar radiations into heat, the absorbed solar radiation is then transferred to the heat transfer fluid within the tube, the liquid heats up, changes into gas, and rises up reaching the dome shaped condenser in the usage water tank, the heat transfer fluid primarily in the form of gas condenses on the inner surface of the condenser due to the contact with the cold water already inside the tank. Hence the condensing chemical returns in its liquid form back to the sun exposed base of the tube. This circulation aspect is valid as long as the system is heated by sun radiations. In comparison with vacuum tubes there is no water circulation inside the tube, thus the classification problem due to water is prevented: no water circulation means no risk of freezing or breaking the tube in cold temperatures. b.
Thermo siphon storage tank The heater is provided with a 167 Liter capacity tank. The inner tank is made of 2 mm Enameled sheet, so that the tank resists to corrosion. This system provides a quite different technology in water reservoirs, the classic methods using double wall, serpentine or heat exchangers inside the tank are no longer applicable. Therefore, a specially designed sealing ring has been developed to resist against pressure. The cold water entering the water tank, is heated by convection thanks to heated tubes, thus becomes ready to use as hot water. The pressure reducer is placed in the inlet of the system, working at a maximum 4bars to provide a quite useful water use, and help protecting it from pressure fluctuations. The control valve (temperature and pressure) helps preventing the systems overheat in summer. c.
Frame support: The new frame has modern and ergonomic design, safe against environmental effects (wind; rain, snow …), it is easy to assemble and compatible with any kind of ground or platform. It can be installed in the garden, top floors of the apartments and even farms.

2.1.2.Storage tank
For hot water storing we used ELBI'S high efficiency hot water cylinders, offering a remarkable storage capacity, and a satisfying in heating time performance during the pick hours. The ELBI BSV cylinder used in this study is a 195 L tank, easy to install in the solar heating system.
The heat exchanger is a coiled pipe with heated water passing through. The BSV series is vitreous enamel: the inner enamel coating helps protecting the cylinder from corrosion thanks to the Magnesium anode and Tester, since the galvanic corrosion attack the sacrificial area and instead of corroding the less anodic metals in the cylinder displayed on Figure 4.

Water pump
The Circulation pump connecting the collecting system and the storage tank is a 220 V Verco Shielding Circulation pump, controlled by a differential controller prototype to help circulate the heated water to the ELBI storing tank.

2.1.3.Resol DeltaSol Regulators
Resol provides energy community with many regulation prototypes in this work we worked with three different regulators connected to two different solar water heating systems to help assure the ultimate function of the datalogger developed. The regulators are the Resol DeltaSol C/4, DeltaSol BS and DeltaSol E.

a. Resol DeltaSol C/4 regulator
The Resol Delta Sol C/4 is a regulation and control unit used for system monitoring display, it can support up to 4 pt1000 temperature sensors, a speed control unit for circulation pump and two electro vans, solar operating hours counter and thermostat function [ Figure 5].

. Resol DeltaSol BS
The Resol DeltaSol BS controller provides a quite clear operating concept and is equipped with the illuminated combined display with system monitoring. Flashing symbols for sensors, pumps and values enable an immediate allocation of temperatures, temperature differences and active actuators; this makes adjusting and monitoring the solar system quick and easy.

c. Resol DeltaSol E
The Resol DeltaSol E is designed for solar and heating systems, it is already pre-programmed for 7 basic solar systems and up to 30 variations used to control large systems. Multiple adjustable functions and options are possible using 7 relay outputs, 13 sensor inputs for pt1000 temperature sensors, CS10 solar cell, V40 flowmeter and DIN digital entry. Due to its intelligent, easy configuration and integrated calorimeter, the controller also offers the control of complex systems up to 4 weather composted heating systems. All the Resol controllers are equipped with the Resol VBus for both data transfer and energy supply to external modules. The connection is carried out by the bias of VBus marked terminals [ Figure 6]. Resol provides different modules that can be connected to the data bus, for example Dataloggers DL2/DL3, where the data is both received and stored. Also, the KM1 communication module. The regulator can also be connected the user's computer using VBus/USB and VBus/LAN adaptors from Resol. These features are not included in the regulator's specifications and need to be bought separately. These modules can be really expensive, that helped immerge the need to develop our own low-cost data logger using simple devices already present in the lab.

2.1.4.VBus protocol
VBus protocol is a half-duplex bus system used by Resol controllers for communication purposes. The VBus physical interface comes in two flavors:  2 wire connection to provide the bus signal and partial power supply [ Figure 6]  4 wire connection to provide separate wire pairs for the bus signal and power supply The data provided by the Resol regulator, is received using the asynchronous serial port of Users' computers (COM) with the following parameters: 9600 baud rate, 1 start, 8 data and 1 stop bit, with no parity and no handshake. The VBus is a single master system since there is no possibility to recognize or repair collisions in case two modules send their respective data at the same time. The master in this case is the solar controller.
The VBus uses four different protocol versions (V1.0, V2.0, V3.0, V3.1), each one combined with a model class that inherits its specifications from the bus's common structure (header specifications) detailed on Figure 7. To access the data delivered by the Resol regulators, Resol provides different modules to facilitate data extraction, reading and storage:  KM1 communication module  DL2/DL3 dataloggers  VBus/ USB converters  VBus/LAN converters These modules can be quite expensive since the VBus protocol is specifically made for Resol regulators shown in Table 1, thus normal dataloggers can't help in our case. In this paper we present an alternative solution: build our own VBus communication and data storing device using Arduino board and IDE specifications.

Bio digesting unit
The solar heating system used in this study heats an Up flow Anaerobic Sludge Blanket (UASB) biodigester in which we added paper mill effluents and treated using mesophilic anaerobic digestion to extract methane gas useful for further power application after cogeneration [10].
While building the biodigester, many parameters had to be taken into account, mainly temperature. According to research carried out in the field of anaerobic digestion the optimum temperature for mesophilic bacteria is at 37°C, whereas it is 55°C for thermophilic bacteria [11].
To heat the 1.50 m long biodigester we immersed a 60cm coil exchanger limited by an inlet and outlet for hot water circulation. The exchanger is placed 10 cm above the digester's bottom surface. This surface contains an inlet of the effluent as well; however, the inlet of the digester is made of a pipe which contains holes of 1cm each, to help feed and agitate the effluents inside de digester continuously during the experiment. The biodigester is heated via the solar water heating system and the temperature inside is maintained at 37°C to assure the activity of the microorganisms for the mesophilic anaerobic digestion process [12].

Data logging
While developing the data acquisition system, many possibilities were present. however, the Arduino prototyping environment seemed more efficient due to its diversity in both hardware and software aspects [13]. It provides several development circuit boards using Atmel low power CMOS 8bit microcontrollers (AVR enhanced RISC architecture), capable of computing almost 300 000 code lines. A definitely sufficient amount for data collection and storage. Arduino boards come along with an open source, free integrated development environment (IDE) to help running most operating systems using C/C++ programming language [13]. The Arduino community is considered one of the largest communities on the web, providing solutions to hardware and software issues to developers all around the world [14].
Many sensors and devices already have costume libraries, others in process, hence assuring mostly successful data collection prototypes. Taking for example indoor environment data collection [15], temperature and humidity monitoring inside buildings [16], human's activity monitoring using WIFI and Zigbee [17], also balancing envelope and heating system parameters for retrofit analysis using building data [18]. Along with these studies -and others -it is shown that the Arduino platform can come handy and easy to use in most difficult applications, especially different data collection [19][20][21].
Today, there are many Arduino board types available in the market for cheap prices. The Arduino Mega 2560 is wildly used and documented among developers [13]. Its electrical and communication features made it adequate to our application detailed on Table 3. The mega 2560 is specially designed for more complex projects. It has 54 digital Input/Outputs -which 15 can be used as PWM outputs-16 analog pins, and hardware serial ports (UARTs), a 16 MHz crystal oscillator a USB cable for computer/board connection as well as power [ Figure 7]. The board is also provided with power jack to assure autonomous power supply for the board. Arduino Mega 2560 is compatible with a large number of shields initially designed to earlier Arduino board versions, easy to manipulate using the Arduino IDE 1.8.5, and assures -the mega 2560-a larger space for programing sketches [14].

2.3.1.VBus library
As many features, the VBus protocol has also its own library on Arduino, in order to help discretize the data received from the Resol DeltaSol regulators. The library should be included to the Arduino sketch to give the programmer a sense of the different reading structures. The VBus library contains many features including:  4 temperature readings  Water pump status and speed  Operation time  Alerts, schemes and time.
Once the data is received read and understood, it should be stored for further use.

2.3.2.Data storage
To store the data coming from the Resol DeltaSol C/4 regulator we connected a V.1 shield to the Arduino Mega, in which we inserted an SD card and a 3 volts lithium coin cell battery for the RTC power consumption.

a. MicroSD card
Generally, in this kind of applications, the data is stored on MicroSD cards, formatted in Fat16 or Fat32 format. MicroSD cards provide unlimited storage space, since time and sensors data are stored as plain text in a comma-delimited format, each one of these data points presents only a few bytes; We used in our research an 8 GB MicroSD card which costs almost 6$, cheap but capable of storing billions of measurements. The data can be retrieved by inserting the SD adaptor for MicroSD in any today's computer. Many libraries in the Arduino community can be used in prototyping MicroSD's based applications. For instance, the SD library by Sparkfun Electronics or William Greiman's SD Fat Arduino library [15]…. We can program the Arduino Mega to save data in many file formats including .txt or .csv, but it this case we choose to store them in an Excel file, to facilitate the extraction and graphical explore of our results. The VBus extracted data can also be stored using EEPROMS or SPI flash memories, however due to their limited memory capacity and additional programming necessity, we disregarded their use in our applications, but they can help as back up storing devices in case of electricity or communication failures [15].

b. Real time clock (RTC)
To keep track of the date and time during the water heating system operation, the DS1307 Real Time Clock on the V.1 storing shield came handy to assure this specification. DS1307 is a real time chip of Dallas electronics designed for time keeping, the time is quite accurate with a 1 min time drift per month, it is commonly backed up with the CR1220 battery coin cell for power consumption [ Figure 8].

2.3.3.Adaptation protocol
In this project, the data retrieved from the Resol DeltaSol C/4 regulator is unreadable in case we connected the regulator to the Arduino board even if we used the library since the VBus protocol in not supported by the UART format of the Arduino entry pins. Hence, we had to realize an adaptation circuit to change the VBus format given by the regulator to Serial format understandable by the Arduino [22]- [24]. Thus, using the RS485 electrical interface in this case was helpful for its similarity with the VBus communication signal [25].

Figure 9. RS485 communication protocol interface for data transmission and reception
The RS 485 serial port communication, is quite popular in monitoring and controlling systems applications, it can be quite advantageous for long distance communication and anti-jamming [26] [ Figure 9] , since it adopts half duplex communications which provides lot less connection cables than other serial communications such as RS422A detailed on Figure 10, and a higher communication distance -up to 1200 m [25]. The RS485 has the form of balance difference connecting, i.e., the sender has one end of receiving as well as one end of sending while the receiver has the same ends of sending and receiving. The same cables are used to either end detailed on Figure 10. We should note that the RS442A and RS485 have nearly the same electrical properties, the RS422A can communicate in full duplex but has twice the communication cables as the RS485 depicted on Figure 10  The signal VBus produces is similar to RS485 in its dual polarity aspect but not quite the same. The circuit used in Figure 11 helps process the signal and then turn it to a signal of 9600 baud rate, with 5V serial data suitable for interfacing an Arduino Mega 2560. Our adapting circuit is mainly based on comparators and resistors as illustrate in the Figure 11. The adaption circuit is built using a LM393 comparator, a diode bridge, pull up pull down resistors and rectification resistors.

a. LM393
The ST Microelectronics LM393 device consists of two independent low voltage comparators (operational amplifiers) designed to operate from a single supply over a wide range of voltages. The comparators integrated inside the LM393, have a unique characteristic as well: the common mode input voltage range includes ground even if it is operated from a single power supply voltage. The LM393 can come handy in many electronic based systems used to upgrade major plants.

b. Bridge rectifier
A bridge rectifier is a kind of full wave rectifier that uses four diodes (or more) in a bridge circuit to convert AC current into DC. The diode bridge rectifier used in this circuit helped minimize the cost and size of the rectifier (we won't use an expensive center tapped transformer).

RESULTS AND DISCUSSION
In the result section, we present the building process of the VBus data logger, starting with the program algorithm, coding language, implementation, adapting circuit and final form of the device. The results of the data logging are given in the results section.

Program algorithm
The algorithm used while coding the Arduino specifications is made of two main significant parts: reading the VBus data coming from the Resol DeltaSol regulator, and then storing the meaningful values on an SD card to be retrieved later when needed. The VBus Arduino library helped decipher temperature values given by the PT1000 sensors and later delivered by the regulator, while the SD library prepares the MicroSD to receive and store the data in a *csv file. Figure 12 therefore, gives the program algorithm.

Adaptor circuit
The adapting circuit built using simple electronic components, including resistors diodes connection cables and headers. We first tested the circuit on a breadboard to verify the utility of the device; once the values displayed on the serial monitor, we realized the PCB version of the circuit to maintain each component in its rightful place to prevent circuit disconnection [ Figure 14].

Data logging device
Once the circuit is made, we connected the GND and 5V pins of the Arduino board to the power header of the circuit, the RX1 pin of the Arduino mega to the RX output of the circuit, while the VBus cables from the Regulator are inserted inside the input header of the circuit displayed as Figure 14. Once the program is implemented on the Arduino board, we powered the device using a voltage adaptor (phone charger 9V), instead of the computer USB cable in order to give a monotonous aspect to the data logging system. Figure 14. VBus data storing device

3.3.1.Project costs
As mentioned before the datalogging system is made using simple components available in the market and at low prices as well, compared to the datalogger provided by the Resol Company, it came quite cheap [ Table 4]. Table 4 lists the prices of each components implemented on the datalogger device; costs are provided in US dollars current as of 2017, bought from different retailers. The datalogger has an expected cost saving of around 80% to 90% compared to Resol datalogging modules. This feature along with the fact that the data logger is an open source platform that allows further development in hardware and software aspects and provides a reliable performance compared to industrial dataloggers, shows the utility of Arduino based dataloggers in energy industry.

3.3.2.Application results
In this paper we present the results of the platform integration in three different Resol regulators, each regulator presents different temperature characteristics. The first data logger was connected to the Resol Delta Sol C/4 Regulator, controlling the bio digester presented in the methods section, while the second and third dataloggers were connected to the Resol Delta Sol BS and Resol delta Sol E respectively controlling a bigger bio digesting plant. a. Resol delta sol C/4 The first tests of the data logging system were conducted before turning on the solar heating system, taking into account one sensor at first then two …., to verify the quality of the data coming in from the regulator to the storing device. The temperature displayed on the LCD screen of the Resol DeltaSol Regulator was the same at the serial monitor of the Arduino IDE. We first commented all the other features of the regulator in the Arduino program, to leave only the first and second sensors (S1 and S2 on the regulator). The measures were taken every 10 minutes for 24 hours during 10 days: sensor 1 was left inside the lab while sensor 2 was measuring the temperature outside to assure the reliability of the data logger [ Figures 15-16]. The tests were conducted during the month of July 2018 in a temperature varying between 18°C and 30°C. Figure 15. Temperature values day1 to day 3 Figure 16. Temperature values day 4 to 10 Once the system was turned on the data storing device kept recording the different parameters of the solar heating system at a 5 min in November. The different temperature variables are given by the graphics Figure 17. We made another datalogger for the Resol Delta Sol BS regulator, used as a control unit for another solar system that heats a larger biodigester, however this time the data was stored using a MicroSD adapter for the Arduino Mega instead of the V.1 SD shield [ Figure 18]. The Resol DeltaSol BS regulator is quite similar to the DeltaSol C/4 regulator, in this case the activated parameters were three temperatures: the collector's temperature, the storing tank temperature and the water circulation temperature inside the exchanger; none of the other features were active (pump speed, relays). The results were as promising as the first datalogger and the temperature values on a typical day in July were stored simultaneously: in this case, three variables were stored instead of two shown in Figure 19 :  We tried to use the same datalogger for a Resol DeltaSol E regulator. However, the library provided for the VBus was not compatible with this version due to the complicated configuration of the E regulator. We had to modify the library source code (cpp file) to assure the correct readings of the variables given by the regulator. The new module is in its primary phases of development and will be discussed in later work. Hence, we used the datalogger as a serial through device that transfers the data from the regulator to a small computer in which we installed the Resol Software shown in Figure 21.

Analysis
Results from this study show that using electronic based prototype, i.e., Arduino, alongside macro energy plants can help develop and optimize their function. Many solar energy systems lack solar trackers, movement actuators, dataloggers or even data transmission systems. As a result, many parameters that could be studied are lost. However, the challenge remains in the quality and accuracy of these platforms, their availability on the market and even expenses. Thus, we encourage developers to provide the energy community with reliable and cost-effective devices to help monitor and explore data changes in solar energy plants. Using the Arduino based prototype helped minimize the overall cost of the three systems while maintaining the same or even better temperature data recording during a quite long period of time, a privilege that only the Resol dataloggers could provide compared to industrial or manufactured dataloggers. We should mention that the developed datalogger has some limitations that we are currently improving: this type of circuits can be really time consuming especially if the feature developed -VBus data reading-is new to the research field; to find the adequate libraries, program and circuit components specifications, finally deploy them in the system, can lead to many potential errors. Additionally, the Arduino hardware and software open source characteristics can lead to recursive errors in libraries and codes downloaded from the Internet that are continually repaired to adapt to our needs. These problems can cause program blocking at certain coding instructions if the libraries are not declared correctly or if the circuit specs are wrong -resistors values-. Also, we are trying to improve the RTC time synchronization for date and time variables to keep track of the defined measurements. We should note that power failures of the different systems or in the buildings where the systems are built could lead to data loss as well. We also added other variables to the storage protocol including two more temperature values connected to the Resol DeltaSol C4 regulator's pump by a differential controlling algorithm; the pump speed variations, relay states and systems alerts. In fact, trying the first, second and third Arduino based data loggers on different Resol regulators demonstrated quite promising results comparing cost, reliability and market availability with those of the of the existing Resol datalogging devices.

CONCLUSION
A new low cost datalogger for VBus data storage is built to keep track of temperature values extracted from different Resol DeltaSol regulators, the datalogger consists of two parts: a VBus to Serial adapter and a datalogging shield connected an Arduino Mega. The Arduino platforms come handy in such prototypes and assure more aspect of development: it is easy to use, cheap and accurate in major applications. The data logging device showed reliable storing and communication performance over a long time and different temperature fluctuations. The implementation of the datalogger in the solar energy system helped monitor the changes in crucial parameters of the heating system, as well as storing them for further improvement. Our team still works on improving the datalogging device for other applications.