IoT embedded linux system based on Raspberry Pi ...

48 downloads 0 Views 2MB Size Report
Sep 27, 2017 - IoT embedded linux system based on Raspberry Pi applied to real-time cloud ... b LAESE Laboratory, Telematics, Federal Institute of Ceará, Industrial District I, ... 0263-2241/ © 2017 Elsevier Ltd. All rights reserved. MARK ...
Measurement 114 (2018) 286–297

Contents lists available at ScienceDirect

Measurement journal homepage: www.elsevier.com/locate/measurement

IoT embedded linux system based on Raspberry Pi applied to real-time cloud monitoring of a decentralized photovoltaic plant

MARK



Renata I.S. Pereiraa, , Ivonne M. Duponta, Paulo C.M. Carvalhoa, Sandro C.S. Jucáb a b

Laboratory of Alternative Energies, Electrical Eng. Department, PICI Campus, Federal University of Ceará, 60455-760 Fortaleza, Brazil LAESE Laboratory, Telematics, Federal Institute of Ceará, Industrial District I, 61939-140 Maracanaú, Brazil

A R T I C L E I N F O

A B S T R A C T

Keywords: Cloud computing Data acquisition Internet of Things Raspberry Pi Renewable energy

In this project we propose, describe, implement and test the Renewable Energy Monitoring System (REMS), a new concept on data acquisition and transmission systems (DATS) applied to real-time cloud monitoring of a decentralized photovoltaic (PV) plant. To achieve this latest design, we went through various systems projects alongside the evolution of technology. From this practical experience and in agreement with Brazil’s policy of diversifying the electricity generation matrix, our proposal focuses on a multi-user remote system using Raspberry Pi and Internet of Things (IoT) concept. REMS is capable of sensing and modifying monitoring process management via remote firmware update through the developed Analog/Digital Converter Embedded System (ADCES) as well as communicating with a personal developed cloud server profile via RPi Embedded Linux System (ELS), thus not requiring a dedicated PC. The measured variables are PV voltage and current, ambient and PV module temperature, solar irradiance, and relative humidity.

1. Introduction Increasing use of decentralized renewable energy (RE) sources worldwide makes even more important to develop online monitoring systems for micro and mini-generation plants utilizing those sources. Data acquisition and online monitoring systems are usually found in large power plants, since complex monitoring and relatively high costs make those systems not practical for micro and mini power generation clients. Hence, to overcome this limitation and contribute to the propagation of RE micro and mini power generation systems, we propose the Renewable Energy Monitoring System (REMS), a new concept of an open source and low-cost data acquisition and transmission system using Raspberry Pi, multi-user cloud remote monitoring and Internet of Things, applied to decentralized RE plants. REMS architecture, based on the Internet of Things (IoT) and Cloud computing principles, consists of three main parts: 1. Analog/Digital Converter Embedded System (ADCES) which utilizes a SanUSB microcontroller, based on free software and hardware tool with the PIC18Fxx5x family including native USB interface. 2. Raspberry Pi (RPi) [1] Embedded Linux System (ELS). 3. Online Web Monitor for real-time cloud monitoring. REMS enables online supervision of measured variables using



analog and digital sensors. ADCES is in charge of reading analog sensors while RPi reads digital sensors. Data are stored in an online database and accessible as charts and tables through a free software Web Monitor also developed for this project. REMS is completely customizable for different plants allowing expansion and variation of analog and digital sensors. REMS can also perform remote updates to the PIC microcontroller firmware and configure ELS via Internet, reducing displacements time and costs. RPi is chosen due to its small size (similar to a credit card) and lowcost, compared to conventional PCs and data loggers, plus zero cost of free Linux software. We used RPi 2 model B, a sophisticated and easy to use low-power microprocessor with onboard electronics supporting a large number of input and output peripherals, considered the world smallest computer. Raspbian image (around 2 GB) has to be written on a SD card (minimum of 8 GB) using another computer and then connected to the RPi [2]. SD card works as the RPi hard drive. The extra capacity can be used for data storage. If a large amount of data and applications are required, a SD card with minimum of 16 GB should be chosen. RPi is suitable for beginners use, compared to other platforms, which are not appropriate to be used as a standalone processing system or are targeted to more advanced developers [3]. RPi in comparison to most of the others Linux-based embedded systems, such as Arduino Yún [4], Beagle Bone Black [5] and Intel

Corresponding author. E-mail addresses: [email protected] (R.I.S. Pereira), [email protected] (I.M. Dupont), [email protected] (P.C.M. Carvalho), [email protected] (S.C.S. Jucá).

http://dx.doi.org/10.1016/j.measurement.2017.09.033 Received 31 January 2017; Received in revised form 30 August 2017; Accepted 19 September 2017 Available online 27 September 2017 0263-2241/ © 2017 Elsevier Ltd. All rights reserved.

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Fig. 1. Proposed PaaS and REMS.

Fig. 3. Remote firmware and scripts updating.

systems, RPi use started at schools and universities [7], but now it is increasingly being applied on companies, research labs and independent designers projects. Languages such as C, C++, Python or Java are online accessible with material provided by the user community, in opposition to proprietary software that normally depends on the factory language. IoT, the communication between devices without the intervention of humans [8], understands each device as a small part of the Internet. Such small parts can in a practical way interact and communicate, maximizing modularization, comfort, convenience, safety, security, and energy-savings. Wireless technologies such as WiFi/3GPP, Bluetooth, Radio are being preferred for decentralized systems [9,10], but Ethernet cable is also an alternative for centralized systems. Cloud computing provides access to a shared pool of configurable computing resources, without requiring profound knowledge of the management technologies [11]. Cloud model simplifies installation, operation, and maintenance of information systems, increasing system effectiveness and reliability while reducing costs. Cloud systems can be classified according to development or service model. Cloud development models are: public, private, community or hybrid; cloud service models are: Platform as a Service (PaaS), Software

Fig. 2. Serial connection between ADCES (SanUSB board) (a) and the RPi (b).

Galileo [6] shows advantages like better cost/benefit ratio, larger user community, standard programming language and communication, many input/output pins and graphic interface. Considered an easy Do-It-Yourself (DiY) platform for students who do not have experience with software development and embedded 287

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Table 1 REMS power consumption. REMS Component

Idle current consumption Ii (A)

Active current consumption Ia (A)

Idle (Wh/day) during 57 s/per minute

Active (Wh/day) during 3 s/per minute data sending

Total (Wh/ day)

RPi 2 Model B WiFi Dongle USB ADCES Resistive divider ACS712 Current Sensor LM35 Temperature Sensor LP02 Pyranometer DHT11 Sensor Total power consumption (P)

0.23 0.05 0.01 0.00 0.00 0.00 0.00 0.01

0.38 0.15 0.23 0.25 0.13 0.10 0.20 0.03

26.22 5.70 0.57 0.00 0.00 0.00 0.00 0.57 33.06

2.28 0.90 1.38 1.50 0.78 0.60 1.20 0.15 8.79

28.50 6.60 1.95 1.50 0.78 0.60 1.20 0.72 41.85

A wireless DATS for PV monitoring based on LabVIEW™ is proposed and implemented in [18]. Meteorological variables are measured by a microcontroller PIC unit and sent to a PC through RF antennas. The development of a PV monitoring unity is proposed in [19], based on National Instrument modules programmed on LabVIEW™. The system includes a unit for I-V curve measurement of a PV plant supplied by a car battery. A DATS for RE plants is presented in [20], also based on a local LabVIEW™ control. Wind and solar variables are measured and sent to a monitoring virtual interface, where the user can access the data graphics. According to the state of the art, most of the DATS designed for RE plants are implemented with LabVIEW™ interface running on a dedicated PC, allowing only local monitoring with expensive commercial data loggers and modules. We have previously developed some DATS, which are described next. The first DATS we developed utilizes a Delphi supervisory system and a low cost PIC microcontroller (SanUSB), analyzing data from a PV powered water pumping system to optimize plant operation. Measurements are carried out in 10 min intervals using a real-time clock and stored in local EEPROM memories; data recovery is made using the Delphi supervisory that generates graphs in a PC [21]. An improvement to this system is reported in [22] using a SCADA supervisory system. We used the same DATS of [21] to send data from a water pumping plant powered by a wind energy converter (WEC). Data are transmitted via a Modbus communication protocol from the microcontroller to the SCADA system and stored in a database. SCADA collects real-time wind speed samplings as well as hydraulic and electrical data, allowing graphic visualization. We also developed a DATS to implement wireless technology and remote monitoring, described in [23,24], utilizing a PIC microcontroller-based unit for local storage and data transmission to the Internet by a GSM modem connected to a dedicated PC. Correlations and performance tests used to compare data collected by the DATS with

Table 2 Implemented sensors. Variable

Sensor

Ref.

PV voltage PV current PV module Temperature Irradiance Ambient temperature Relative humidity

Resistive divider by 4.6 ACS712 – 5A LM35 Pyranometer LP02 DHT11

1 2 3 4 5

as a Service (SaaS) or Infrastructure as a Service (IaaS). We use PaaS, the use of tools and resources to provide services to end-users. Microsoft Azure [12] and Google Cloud Platform App Engine [13] are also classified as cloud PaaS. User is allowed to control the deployment of end applications, but not to control the operating infrastructure. As end-users share information in the same cloud server, data privacy and confidentiality are the major concerns. Cloud providers should guarantee to the customers that stored data are secure and encrypted, allowing only the owner to manage them. Developments of data acquisition and transmission systems (DATS) worldwide are found in the literature. An Arduino based DATS with local control and SD storage, supporting 16 sensors, for temperature measurement applied to solar systems is proposed in [14]. A generic low-cost and open source computer-based DATS for general data acquisition is also proposed in [15], using a dedicated PC with USB or Serial RS-232 for communication and requiring driver installation to generate a Virtual COM port; the system is LabVIEW™ (Laboratory Virtual Instrument Engineering Workbench) [16] compatible and the Analog/Digital (A/D) converter has a 16-bit resolution. A LabVIEW™ based system for PV simulation and monitoring is described in [17]. The developed software tool provides a fast and reliable real-time system for PV performance analysis through a commercial data logger connected to a local dedicated PC.

Fig. 4. Implemented sensors.

288

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Fig. 5. REMS general diagram.

Fig. 6. Data processing flow chart.

Data are collected by a PIC microcontroller and sent to an Android device through a Bluetooth modem; from the Android application, data are sent to a database via 3G/GPRS. As drawbacks, this system requires a SIM card with data transfer charging and can be installed only in places under phone coverage. We took a further step using an embedded WiFi modem (Wifly RN-

data from a commercial datalogger yielded a correlation factor greater than 0.9996. The system can be expanded to record data from other analog or digital sensors, controlling RE plants via a Matlab/Simulink program. In [25] we propose a DATS for a PV powered water pumping unity is developed using data transmission via Bluetooth for the first time. 289

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

monitoring systems for large systems: expensive commercial data loggers, local control, limited data storage and sensor connections, and long distances cable communication. Additionally, REMS opens the possibility of multi-user remote monitoring, respecting the ubiquitous behavior of the users. REMS is described is details in the next section, followed by presentation of the main experimental results obtained and our conclusions. 2. Material and methods Recent applications using RPi, IoT and Cloud Communication are found in the literature, showing versatility, applicability, usability, compactness, affordability and available support from creators and user community. A home automation system, providing two alternative user-friendly interfaces (Android and Web application), is demonstrated in [28]. The system is built to serve multiple users, using up-to-date and emerging technologies, such as Google Cloud Platform, to support the communication between the system main hardware components. A public cloud is considered in the proposed system since public clouds are usually free to users, as their set-up costs are covered by the provider. A research in [3] deals with monitoring and determining the confidence of fire in a building. A full system, using Sensor Web elements, is created and developed. A system for environmental monitoring using RPi

Fig. 7. Cloud updating.

XV) connected to the DATS, based on SanUSB, reported in [26,27]. A Web Monitor was developed in an online server with PHP programming language and a Structured Query Language (MySQL) database. DATS with the online server is autonomous and powered by a PV module. The application allows analyzing data via computational devices such as laptops, tablets and smartphones. Therefore, the Renewable Energy Monitoring System (REMS) that we propose has the objective of eliminating the disadvantages of online

Fig. 8. System check flowchart.

290

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Fig. 9. Web Monitor main menu.

Fig. 10. Main system menu.

developing, compiling, debugging and/or testing an application in the Cloud. Hence, any user (A, B or N) can create and configure in the Cloud in real time a monitoring profile, as well as perform firmware features configurations and control the REMS (Fig. 1). Another advantage of the proposed REMS is that using the online cloud service as an access point there is no need to unlock router ports and/or firewall. REMS consists of three main parts:

for data acquisition is reported in [29]. The system uses open source software and market available digital sensors, used to provide the required parameters for calibration laboratories. Measured data are shown in a front-panel display and in a Web page. RPi as a data acquisition system can also be applied as bicycle dashboard computer being comparable to some higher-priced and less portable on-board monitoring systems [30]. Such systems, using embedded computers with sufficient computing power can weight in total 100 g, while a new technology Laptop has normally 1300 g, which is not ideal for this application. Motivation is to analyze the riding quality of the cycling facilities using vibration measurements.

1. ADCES, which utilizes a SanUSB microcontroller, based on a free software and hardware tool with the PIC18Fxx5X family including native USB interface. 2. RPi [1] Embedded Linux System (ELS). 3. Online Web Monitor for real-time cloud monitoring.

2.1. REMS development The developed REMS collects data from a PV module installed in the city of Fortaleza (latitude: −03° 43′, longitude: −38° 32′, elevation: 21 m (69 ft)), Brazilian Northeast region. The city shows no significant seasonal meteorological variations due to its localization near the Equator line. REMS uses IoT concept, in which systems are capable of sensing and modifying the monitoring process management of micro and minigeneration power plants through online firmware update, as well as communicating with a developed cloud server profile, allowing creating different PaaS profiles. PaaS profiles (PaaS A, B or N) are free and automatically generated by an online server after the password registration by the user, allowing

REMS embedded software is free and can be obtained after the registration in the cloud server of a new profile in the PaaS. REMS is programmed to work in a decentralized and distributed way, allowing multiple users and multiple REMS communication at the same time and using the same cloud server. In the case of REMS configuration or modification, basic knowledge on installation of applications in the Linux operating system is necessary. ADCES consists of the SanUSB free development tool illustrated in Fig. 2(a). SanUSB is composed of software and hardware of the PIC18Fxx5x family with USB native interface [31]. This free tool is efficient in the development of projects because there is no need to 291

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Fig. 11. Generated chart for PV voltage, current and power on September 18th 2016.

(.hex files) and to update RPi scripts (.c files). To update ADCES, a wire connection between RPi pin 11 and ADCES pin 1 is necessary, as well as a WiFi dongle, as shown in Fig. 2. To allow remote updating at any time this wire should be kept connected, with no harm to the circuit operation because it is software commanded. Thus, the system is applicable to IoT projects, with remote access via Internet and not only Intranet. RPi 2 model B idle current consumption is around 230 mA and around 380 mA for active working time. RPi requires an energy source of 5 V/2 A to supply maximum total USB peripheral current draw of 0.6/1.2 A (switchable). REMS works 24 h per day, so the daily power consumption is around 42 Wh/day. Considering that REMS requires three seconds (s) for sending data to the server every minute, the active time is 4320 s/day and the idle time is 57 s per minute, totalizing 82,080 s/day. In this way, the power consumption (P ) during 24 h per day, can be estimated for each component by Eq. (1):

remove the microcontroller for the firmware update, opposite to other developing systems which usually use a specific burning hardware and work via cable. Additionally, SanUSB tool is multiplatform, running on Windows®, Mac OSX and Linux as well as plug and play, being automatically recognized by operating systems without the need to install any driver [32]. Hence, this tool enables that the compilation, recording and real simulation of a program can be made quickly and efficiently from the microcontroller connection to a computational system via USB, which in this application is a RPi 2 model B (Fig. 2(b)) and even through the RPi Internet connection. The serial communication by emulation of a virtual COM port may be done quickly and efficiently from the moment in which the microcontroller is connected directly to a computer via USB [33]. RPi can be directly implemented in electronics projects mostly due to its general purpose input/output (GPIO) pins [34] with digital I/O support, I2C and SPI protocols, to perform communications with sensors. Communication variety allows RPi to communicate with a larger number of peripherals and the use of the access library Wiring Pi [35] written in C facilitates to program and setup the GPIO pins using a command-line utility “gpio”. There are two forms of communication between ADCES and RPi in this project: serial communication and USB interface. To perform serial communication between a PIC microcontroller and the RPi ELS, ground (GND), GPIO 14 (TX) and GPIO 15 (RX) pins are used. In the developed project, the computer to burn the SanUSB PIC microcontroller is the RPi, whose connection pins to burn via USB and serial communication are shown in Fig. 2. Hence, a graphic interface and a burning software to directly transfer the firmware from the embedded Linux system interface to the ADCES PIC using Human Interface Device (HID) protocol communication via USB port was developed. The proposed ADCES is also an embedded system RISC and allows online firmware updating from the Cloud, according to Fig. 3. Files can be sent to update ADCES firmware

P = (Ia·V ·24·Ta) + (Ii ·V ·24·Ti )

(1)

where P is the power consumption in Wh/day, Ia is the active current consumption in A, V is the system voltage (5 V), Ta is the active working time (4320 from 86,400 s/day = 5%/day), Ii is the idle current consumption in A and Ti is the idle working time (82,080 from 86,400 s/ day = 95%/day). The power consumption of the developed system is then described in Table 1. As a laboratory first phase implementation, we used an USB energy source connected to the grid, which can be considered a drawback. To eliminate this disadvantage, a next step intends to use a PV powered REMS plus battery. There are different ways for reading an external variable with the RPi’s GPIO pins; the decision depends on the type of sensor and electronic connection. RPi has as disadvantage the lack of a built-in A/D converter; hence, if analog sensors are chosen, the convertion of measured data into digital is necessary. 292

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

PV Voltage (V)

Irradiance (W/m²) 1400 1200 1000 800 600 400 200 0

20

1,250 W/m²

18.8 V

15 10 5 0 0

2

4

6

10 12 14 16 18 20 22 (h)

8

0

2

4

6

PV Current (A) 2.4

40 35 30 25 20 15 10 5 0

1.6 1.2 0.8 0.4 0 0

2

4

6

8

10 12 14 16 18 20 22 (h)

39.5 W

0

2

4

Ambient Temperature (ºC) 34

10 12 14 16 18 20 22 (h)

PV Power (W)

2.1 A

2

8

6

8

10 12 14 16 18 20 22 (h)

Relative Humidity (%) 85

33ºC

83%

80

32

75

30

70

28

65

26

60

26ºC

24

60%

55 0

2

4

6

10 12 14 16 18 20 22 (h)

8

0

2

4

6

8

10 12 14 16 18 20 22 (h)

PV module Temperature (ºC) 57ºC

60 50 40 30 20 0

2

4

6

Aug 24

8 Aug 25

10

12

Aug 26

14 Aug 27

16

18

Aug 28

20

22 (h)

Aug 29

Fig. 12. Charts generated on the Web Monitor from August 24th to 29th 2016.

an input voltage of 4–20 VDC, presents an output signal of 10 mV/°C with a measurement range of −55 to 150 °C and 0.5 °C accuracy. The sensor is connected to the ADCES and sends measured data via serial interface to RPi. A Hukseflux LP02 pyranometer (4) is used for irradiance measurements. As LP02 output signal is in the range of 4–20 mA, a conditioning circuit is required to adjust this value to a maximum of 5 VDC, so ADCES is in condition to read and process the signal. In this application, a circuit based uses an IC LM324 amplifier. For temperature and relative humidity measurement, a DHT11 digital sensor (5) is used and connected directly to RPi. Ambient temperature ranges from 0 to 50 °C with an accuracy of 2 °C; relative humidity from 20 to 90% with an accuracy of 5%. ADCES then treats and transmits data via serial to ELS in a sequence of predefined characters. RPi script, in C language, extracts analog values and concatenates with digital ones in a string along with a checksum to verify data integrity.

That is the reason we use a PIC microcontroller in the present project to A/D conversion (ADCES). ADCES is programmed to read analog sensors like PV current and voltage, ambient temperature and solar irradiance. The use of an extra board allows system expansion for further sensor integrations; serial communication with RPi allows firmware burning via the developed Cloud Web Monitor, making the system fully remotely controllable and modifiable. Sensors implemented in the PV plant are described in Table 2 and identified in Fig. 4. As the PV module has a 20 V output, and the microcontroller can only receive an input of 5 V, the use of a resistive divider (1) is necessary. To measure PV current, an AC712 (2) IC is used, consisting of a precise (1.5 percent error), low-offset, linear Hall sensor circuit. PV module temperature analysis is important because delivered power drops as the temperature increases for the same irradiance level [36]. For this measurement, a LM35 sensor (3) is used at the center of the module, due to the greater heat concentration in this part; LM35 with 293

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

PV Voltage (V)

Irradiance (W/m²) 20

1200

18.6 V

1,000 W/m²

1000

15

800

10

600 400

5

200 0 0

2

4

6

8

0

10 12 14 16 18 20 22 (h)

Nov 01

Nov 02

Nov 03

Nov 05

Nov 06

Nov 07

0

2

Nov 04

4

6

10 12 14 16 18 20 22 (h)

Nov 01

Nov 02

Nov 03

Nov 05

Nov 06

Nov 07

Irradiance (W/m²) 1200

8

Nov 04

PV Voltage (V) 20

1,000 W/m²

18.4 V

1000

15

800 600

10

400

5

200 0

0 0

2

4

6

8 10 12 14 16 18 20 22 (h)

Dec 01

Dec 02

Dec 03

Dec 05

Dec 06

Dec 07

0

Dec 04

2

4

6

8

10 12 14 16 18 20 22 (h)

Dec 01

Dec 02

Dec 03

Dec 05

Dec 06

Dec 07

Dec 04

Fig. 13. Charts generated on the Web Monitor from the 01st to the 07th of November and December 2016.

700

21 18 15 12 9 6 3 0

606 W/m² 16.4 V

600 500 400 300 200 100

0

2

4

6

8

10

12

PV Voltage

14

16

18

20

22

Irradiance (W/m²)

PV Voltage(V)

PV Voltage and Irradiance on cloudy day

0 (h)

Irradiance

Fig. 14. PV Voltage and Irradiance for a cloudy day (December 05th 2016).

is used. Another alternative can be the open source IoT Eclipse Cloud platforms [37] with MQ Telemetry Transport (MQTT), a machine-to-machine (M2M)/IoT connectivity protocol [38], extremely simple and lightweight messaging protocol for high-latency or unreliable networks. Data processing flow chart is shown in Fig. 6. Online server storage and online database capacity, as well as number of sensors, frequency of data sending and entire data collection period are important to define the adequate number of monitoring systems to deploy in field. RPi provides local storage for backup (SD card extra capacity) in case of database connection failure; hence, Internet data transmission speed is not a critical aspect. In the developed project, REMS server database has capacity of 84.44 MB and the online server has capacity of 2 GB; 365.65 MB of the server capacity is used for Web server hosting. Considering one post per minute (string with six sensor values) with size of 150 bytes, data for an

For longer term data storage with original resolution [29], an independently parallel crontab task (internal Linux scheduler) is used to schedule the script and run it periodically at fixed adjusted intervals to build URL string with the sensor values. Finally, ELS sends URL string to a PHP page that acts as a communication interface between the hardware and the MySQL database. Using the PHP Web Monitor, data are stored in a Cloud server to generate online graphics that can be remotely accessed by the users (Fig. 5). In this step, a free server for sending and receiving data is initially used. Although free servers have a number of limitations, such as unavailability due to an instable connection, keeping data for only 30 days and not supporting updating of scripting languages like PHP or MySQL database, they can be used for development and initial testing. In a second project phase, to avoid these problems and keep data security, a paid server (US$ 27/year with US$ 9/year domain register) 294

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

PV module Temperature (ºC) 64 60 56 52 48 44 40 36 32 28 24 20 16

62ºC

49ºC

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

Jan 01

Jan 02

Jan 03

Jan 04

Jan 05

Jan 06

Jan 08

Jan 09

Jan 11

Jan 12

Jan 13

Jan 14

20

21

22

23 (h)

Fig. 15. PV Temperature on January 2017.

from router to WiFi devices are encrypted. Only the indented recipient can process and read data from the signal, granting security to the communication channel. Viewing the monitoring of logs is made from the structured database MySQL, which can be consulted by any computing device connected to the Internet via password. Queries can be made at any time by updating the page every 30 s. To access the monitoring system, the user must enter the address: http://sanusb.org/ftpmonitor/ and then the system authentication form is displayed. Configuration via a communication interface offers major advantages over a sending configuration and data insert directly on the database since the last setting does not allow communication with Internet free hosting servers. Another function of the Web Monitor is ADCES firmware and ELS scripts remote updating. The use of the Web Monitor allows sending files to the server with language extensions C (.c), Python (.py), Shell scripts (.sh) and hexadecimal (.hex). The file to be sent is named with the user password together with a counter. The counter starts with “0” and at every upload the counter is incremented. Considering the password “test”, the first file is called “test0”, “test1” is the second and so on. The counter number is always kept unless the password is changed. The developed Web Monitor for sending files to the server (http:// sanusb.org/rs/sanusb.php) has the following steps (Fig. 7):

uninterrupted period of 391 days can be stored. 2.2. Developed Web Monitor This section describes the Web Monitor developed in free software, using PHP [39] and Apache [40] with open source MySQL database [41] for PV plant monitoring. The monitoring process is divided into the following steps (Fig. 5): 1. Data acquisition via sensors: PV voltage and current, PV module and ambient temperature, irradiance and relative humidity. 2. Data sending from ADCES to ELS; conditioning of the received data. 3. Data transmission to Cloud server to generate graphics; data handling according to user need. The Web application is developed with PHP programming language for building graphics, due to the advantages of free software, dynamism and practicality. This language is able to interact with the Web world, fully improving Websites that have static pages. Additionally, PHP do not create redundant copies of data, what reduces the amount of information stored on the database and avoid them to became corrupted. PHP code runs on the server and the results are sent to the browser, already displaying the rendered page, without consuming computer resources. PHP can be used together with Hyper Text Markup Language (HTML) code for Web page development and Apache, an open source and free Hypertext Transfer Protocol (HTTP) multiplatform server. Query data stored in the online database via smartphones or PCs is possible using the Web page. Whereas Ethernet standard is the solution most widely used in priority systems for interconnectivity of networks, costs of monitoring systems for micro network WiFi with free software tend to reduce; additionally, installation practicability of wireless applications is higher. Sampling time delay for viewing on the server is almost zero, so the system can be considered a real-time application. A disadvantage of WiFi use in decentralized plants is the need of a WiFi modem or router. Typical WiFi Routers (2.4 GHz band) reach up to 92 m outdoors [42]. So, when the plant is remotely located, a mechanism to increase Wifi speed and range is needed. Multi-user, multiple-input, multiple-output technology, better known as MU-MIMO, allows WiFi routers to communicate with multiple devices simultaneously. This functionality decreases the time each device has to wait for a signal and dramatically speeds up the network. MU-MIMO technology is ideal for real-time services such as videoconferencing and online games. A beneficial side-effect of MU-MIMO is that data sent

1. Insert the password used to rename the file to be sent to the server. 2. Browse the file to be sent. 3. ‘Send’ button performs the file transfer to the server. There are two fundamental options for ensuring communication between cloud server and client (ELS): Pull and Push. In the present project, Pull option is implemented via a file read/write mechanism on the server. In this case, the device will periodically check if there were changes to the index stored in the file on the Web server in the Cloud. If yes, the requested command is executed, otherwise, queries continue until there are changes. A disadvantage of Pull communication is that the user needs to send several requests to the server, with the intention of knowing if there is any update of the information (pulling); this methodology increases the processing of the user’s device and generates discomfort, because in most cases there is no exact time for the information to be updated. A solution is to invert the roles, making the server wake the client whenever a new message arrives. This model is known as Push, a communication model between client-server where the server initiates the communication, sending data to a client without explicitly 295

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

module noon temperature reach 33 °C and 57 °C, respectively. A characteristic of the relative humidity is that it drops while the ambient temperature increases; hence ambient temperature shows minimum values around 26 °C increasing to maximum values around 33 °C, while relative humidity varies from 83% to 60% during the day. Analyzing data from September to December 2016 similar charts are obtained due to the stable meteorological conditions close to the Equator line. As shown by the curves in Fig. 13, daily PV voltage from the 1st to the 7th of November and December 2016 present similar values between 6 am and 4 pm. Irradiance reaches around 1000 W/m2 at noon in both months; PV voltage in November and December reaches 18.6 V and 18.4 V, respectively. On a cloudy day (December 5th) a PV voltage reduction is measured (Fig. 14): maximum irradiance reaches 606 W/m2 around noon resulting in a PV voltage of 16.4 V. The sunshine hours for Fortaleza are from 6 am to 4 pm. Local meteorological conditions allow stable solar irradiance from 8 am to 2 pm (between 800 and 1250 W/m2). However, in this period high PV module temperatures are measured, which reduces the PV module efficiency [36]. Using data from January 2017 as an example, Fig. 15 shows that PV module temperature can reach values from 49 °C at 8 am to 62 °C at noon.

requesting it. This technology for asynchronous sending of notifications by the server is the most implemented model in IoT and also used in several operating systems like iOS, using the Apple Push Notification Service (APNS), Windows Phone with Microsoft Push Notification Service (MPNS) and Android using Google Cloud Messaging (GCM) or Firebase Cloud Messaging (FCM), the new version of GCM [43]. Hence, using Pull mechanism for updating via Cloud, Shell Script running on ELS is responsible for checking the server at discrete time intervals. The program verifies and updates the server, downloads the updated file and then runs a specific task depending on the file extension. If a “.hex” file comes, ELS writes the file to the ADCES through the wire connection between RPi pin 11 and ADCES pin 1. If a “.c” file comes, ELS compiles the script and then run the compiled file in the background. In the case of a shell script or a file created in Python, ELS runs directly the file in the background. Fig. 8 shows details of the system check operation. In the “Monitoring” tab (Fig. 9), each sensor data can be seen in a graphic; there is also the possibility of accessing graphics and monitoring logs of all configured sensors, as well as export and print information to different formats (PNG, JPEG, PDF and SVG for graphics, PDF and XLS for logs), allowing filter by periods of time. “General Graphics” tab shows daily average, highest and lowest values recorded for each sensor. “Administration” option provides a list of users and sensors configured in the system and facilitates the management of different database indicators, as well as maintenance functions and support necessary for proper system operation. New users receive a system notification after registration: monitoring program sends an e-mail with the new user data and the initial password set by the administrator. In the first system access, password change is mandatory for checking security and system integrity. In the “Research team” tab, Curriculum Vitae of each research participant can be obtained. Fig. 10 shows the main Menu of the Web interface, with data from each sensor during the system working period (5 am to 5 pm). By choosing an option, a graphic with instantaneous values of the selected sensor, stored in the database, is generated (Fig. 11). In addition to this sensor information, data from other related sensors are also shown; for instance, if “Voltage” is selected, PV current and power are also displayed. By selecting the variable under the chart (Fig. 11(a)), data can be activated or deactivated. The screen provides a graphic with minute-by-minute measurements of the chosen sensor. Logs (Fig. 11(b)) can also be accessed with all collected data. Web Monitor offers the possibility to query the stored data in the online database using smartphones or PCs. Highcharts is used as a library made in Java Script for generating charts, restarted every 30 s (Fig. 11(c)) automatically; if the user needs to restart the chart before, just click on the browser option or F5. To view stored data for a specific day, just select a valid date (Fig. 11(d)). Chart is updated by displaying an hourly average of the sensor data. The System allows to print or export the chart structure, in addition to the logs corresponding to the selected sensors (Fig. 11(e)).

4. Conclusions REMS is expected to reduce costs associated with commercial hardware and software, allowing online distribution and free usage. Additionally, REMS allows online burning of the developed Analog/ Digital Converter Embedded System (ADCES) using a PIC microcontroller and a Raspberry Pi (RPi) Embedded Linux System (ELS). Firmware and scripts updating via ELS connection to the Internet through a WiFi modem is also possible. When the plant is remotely located, WiFi signal must be available. Hence, a drawback is that in decentralized plants a WiFi modem or router is required. An advantage of the proposed platform is that there is no need to unlock ports and/or firewall when using multi-user cloud service. To guarantee secure data storage and database confidentiality, cryptography should be implemented. The developed Web Monitor is effective due to the online consultation and real-time operation of the PV plant. The use of open source and multiplatform software (Linux, Windows®, and Mac OSX) for online microgeneration monitoring systems allows greater user interaction and accessibility due to the possibility of free distribution. Hence, the proposed REMS can be expanded to data recording from other types of analog or digital sensors as well as for other types of applications using RE sources. Basic C language and Linux programming knowledge are required to implement modifications. Low cost of hardware and zero cost of Linux embedded software are two important advantages, added to the ability to use ADCES and ELS for learning programming languages, embedded systems and integration with microcontrollers for use in applied projects in the areas of Electronics, Robotics and Information Technology. In the present project, REMS was applied to collect PV voltage and current, ambient and PV module temperature, solar irradiance and relative humidity from a PV plant. Data collected and sent to the database can be accessed by users as charts and logs through the developed Web Monitor via Internet connected computational devices.

3. Results As an application for the developed Web monitor a PV module supplying a 50 W load is used, with the following specifications: Model YL95P-17b 2/3, Maximum Power 95 WP, Efficiency 14.3%, open circuit voltage (Voc) 22.5 V and short circuit current (Isc) 5.59 A. Fig. 12 shows daily curves for the period from August 24th to 29th 2016 for the following variables: solar irradiance; PV voltage, current and power; ambient temperature; relative humidity and PV module temperature. As expected on typical sunny periods, at noon there is a maximum irradiance value around 1250 W/m2 resulting in PV voltage of 18.8 V, current of 2.1 A, and maximum power of 39.5 W. Ambient and PV

Acknowledgements The authors would like to thank CAPES for scholarship awarded to the first and second authors, CNPq for scholarship awarded to the third author, and UFC and IFCE for the availability of laboratories and equipment.

296

Measurement 114 (2018) 286–297

R.I.S. Pereira et al.

Energ. Sol. - CBENS, 2008. [22] F.T. Brito, S.C.S. Jucá, P.C.M. Carvalho, R.W.R. Souza, Sistema de supervisão em baixo custo de uma planta de bombeamento de água acionada por gerador eólico, in: III Congr. Bras. Energ. Sol. - CBENS, 2010. [23] S.C.S. Jucá, P.C.M. Carvalho, F.T. Brito, A low cost concept for data acquisition systems applied to decentralized renewable energy plants, Sensors 11 (2011) 743–756, http://dx.doi.org/10.3390/s110100743. [24] F.T. Brito, S.C.S. Jucá, P.C.M. Carvalho, Controllogger: a remote monitoring system for decentralized renewable energy sources, in: Renew. Energy Power Qual. J., 2012, pp. 1–4. [25] R.I.S. Pereira, P.C.M. Carvalho, S.C.S. Jucá, F. Sampaio, A.S.C. Alencar, Monitoramento Online Para Microgeração Utilizando Fontes Renováveis De Energia, in: Semin. Nac. Produção E Transm. Energ. Elétrica - XXII SNPTEE, 2013, pp. 1–9. doi:10.1017/CBO9781107415324.004. [26] S.C.S. Jucá, R.I.S. Pereira, P.C.M. de Carvalho, WiFi data acquisition system applied to a photovoltaic powered water pumping plant, Sensors Transd. (2014) 1–8. [27] R.I.S. Pereira, P.C.M. Carvalho, S.C.S. Jucá, WiFi Data Acquisition System and online monitoring applied to thermoelectric microgeneration modules, Renew. Energy Power Qual. J. (2015) 1–6. [28] I. Korkmaz, S.K. Metin, A. Gurek, C. Gur, C. Gurakin, M. Akdeniz, A cloud based and Android supported scalable home automation system, Comput. Electr. Eng. 43 (2015) 112–128, http://dx.doi.org/10.1016/j.compeleceng.2014.11.010. [29] A.J. Lewis, M. Campbell, P. Stavroulakis, Performance evaluation of a cheap, open source, digital environmental monitor based on the Raspberry Pi, Meas. J. Int. Meas. Confed. 87 (2016) 228–235, http://dx.doi.org/10.1016/j.measurement. 2016.03.023. [30] M. Ambrož, Raspberry Pi as a low-cost data acquisition system for human powered vehicles, Measurement 100 (2017) 7–18, http://dx.doi.org/10.1016/j. measurement.2016.12.037. [31] S.C. Silveira Jucá, Aplicações práticas de Eletrônica e microcontroladores em sistemas computacionais, 2016. [32] SanUSB Group, SanUSB Tool, 2016. < http://sanusb.org/ > (Accessed January 17, 2017). [33] S.C.S. Jucá, P.C.M. de Carvalho, F.T. Brito, SanUSB: educational software development for the microcontrollers technology education, Ciências Cognição. 14 (2009) 134–144. [34] Raspberry Pi Foundation, An Introduction to GPIO and physical computing on the Raspberry Pi, 2015. < https://www.raspberrypi.org/documentation/usage/gpioplus-and-raspi2/ > . [35] G. Projects, Wiring Pi: GPIO Interface library for the Raspberry Pi, (n.d.). < http:// wiringpi.com/ > . [36] E.M. do Sacramento, P.C.M. Carvalho, J.C. de Araújo, D.B. Riffel, R.M. da C. Corrêa, J.S. Pinheiro-Neto, Scenarios for use of floating photovoltaic plants in Brazilian reservoirs, IET Renew. Power Gener. 9 (2015) 1019–1024, http://dx.doi.org/10. 1049/iet-rpg.2015.0120. [37] IoT Cloud Platform Stack, 2016. < https://iot.eclipse.org/cloud/ > (Accessed January 22, 2017). [38] MQTT, MQTT, 1999. < http://mqtt.org/ > (Accessed January 22, 2017). [39] What is PHP?, 1994. < http://php.net/manual/en/faq.general.php > (Accessed January 20, 2017). [40] Apache, Apache, 1995. < https://www.apache.org/ > (Accessed January 25, 2017). [41] MySQL, 2011. < https://www.mysql.com/ > (Accessed January 20, 2017). [42] B. Mitchell, What is the Range of a Typical WiFi Network? 2016. < https://www. lifewire.com/range-of-typical-wifi-network-816564 > (Accessed January 31, 2017). [43] SAP, SAP HANA Cloud Platform Internet of Things Services, (n.d.). < https://help. hana.ondemand.com/iot/frameset.htm > .

References [1] Raspberry Pi, 2012. < https://www.raspberrypi.org/ > (Accessed January 20, 2017). [2] S. Group, Aplicações Práticas de RPi com microcontroladores PIC, n.d. [3] V. Vujovic, M. Maksimovic, Raspberry Pi as a Sensor Web node for home automation, Comput. Electr. Eng. 44 (2015) 153–171, http://dx.doi.org/10.1016/j. compeleceng.2015.01.019. [4] Arduino Yún, 2013. < https://www.arduino.cc/en/Main/ ArduinoBoardYun > (Accessed January 20, 2017). [5] Beagle Bone black, 2013. < http://beagleboard.org/bone > (Accessed January 20, 2017). [6] Intel Galileo, 2013. < https://software.intel.com/en-us/iot/hardware/ galileo > (Accessed January 20, 2017). [7] D. Moure, P. Torres, B. Casas, D. Toma, M.J. Blanco, J. Del Río, A. Manuel, Use of low-cost acquisition systems with an embedded linux device for volcanic monitoring, Sensors (Basel). 15 (2015) 20436–20462, http://dx.doi.org/10.3390/ s150820436. [8] K. Ashton, That “Internet of Things” thing, RFiD J. (2009) 4986. < http://www. itrco.jp/libraries/RFIDjournal-ThatInternetofThingsThing.pdf%5Cnpapers3:// publication/uuid/8191C095-0D90-4A17-86B0-550F2F2A6745 > . [9] J. Liu, Y. Li, M. Chen, W. Dong, D. Jin, Software-defined internet of things for smart urban sensing, IEEE Commun. Mag. 53 (2015) 55–63, http://dx.doi.org/10.1109/ MCOM.2015.7263373. [10] S. Andreev, O. Galinina, A. Pyattaev, M. Gerasimenko, T. Tirronen, J. Torsner, J. Sachs, M. Dohler, Y. Koucheryavy, Understanding the IoT connectivity landscape: a contemporary M2M radio technology roadmap, IEEE Commun. Mag. 69 (2015) 32–40. [11] C. Rong, S.T. Nguyen, M.G. Jaatun, Beyond lightning: a survey on security challenges in cloud computing, Comput. Electr. Eng. 39 (2013) 47–54, http://dx.doi. org/10.1016/j.compeleceng.2012.04.015. [12] Microsoft, Microsoft Azure, 2010. < https://azure.microsoft.com/en-us/getstarted/ > (Accessed January 22, 2017). [13] Google, Google App Engine, 2008. < https://cloud.google.com/appengine/ > (Accessed January 22, 2017). [14] H.E. Gad, H.E. Gad, Development of a new temperature data acquisition system for solar energy applications, Renew. Energy 74 (2015) 337–343, http://dx.doi.org/10. 1016/j.renene.2014.08.006. [15] F.J. Ferrero Martín, M. Valledor Llopis, J.C. Campo Rodríguez, J.R. Blanco González, J. Menéndez Blanco, Low-cost open-source multifunction data acquisition system for accurate measurements, Meas. J. Int. Meas. Confed. 55 (2014) 265–271, http://dx.doi.org/10.1016/j.measurement.2014.05.010. [16] N. Instruments, LabVIEW, 1986. < http://www.ni.com/labview/ > (Accessed January 24, 2017). [17] A. Chouder, S. Silvestre, B. Taghezouit, E. Karatepe, Monitoring, modelling and simulation of PV systems using LabVIEW, Sol. Energy. 91 (2013) 337–349, http:// dx.doi.org/10.1016/j.solener.2012.09.016. [18] M. Benghanem, Measurement of meteorological data based on wireless data acquisition system monitoring, Appl. Energy 86 (2009) 2651–2660, http://dx.doi. org/10.1016/j.apenergy.2009.03.026. [19] N. Forero, J. Hernández, G. Gordillo, Development of a monitoring system for a PV solar plant, Energy Convers. Manage. 47 (2006) 2329–2336, http://dx.doi.org/10. 1016/j.enconman.2005.11.012. [20] E. Koutroulis, K. Kalaitzakis, Development of an integrated data-acquisition system for renewable energy sources systems monitoring, Renew. Energy 28 (2003) 139–152, http://dx.doi.org/10.1016/S0140-6701(03)81847-7. [21] S.C.S. Jucá, P.C.M. Carvalho, F.T. Brito, A.T. Aquino, Sistema de Supervisão e Aquisição de Dados Aplicado a Bombeamento Fotovoltaico, in: II Congr. Bras.

297

Suggest Documents