Article

An Intelligent Weather Station Gonçalo Mestre 1,† , Antonio Ruano 2,3, *,† , Helder Duarte 2,† , Sergio Silva 1,† , Hamid Khosravani 2 , Shabnam Pesteh 2 , Pedro M. Ferreira 4,† and Ricardo Horta 5 Received: 20 October 2015; Accepted: 25 November 2015; Published: 10 December 2015 Academic Editor: Leonhard M. Reindl 1

2 3 4 5

* †

EasySensing—Intelligent Systems, Centro Empresarial de Gambelas, Pav A5, Campus de Gambelas, University of Algarve, 8005-139 Faro, Portugal; [email protected] (G.M.); [email protected] (S.S.) Faculty of Science and Technology, Campus de Gambelas, University of Algarve, 8005-139 Faro, Portugal; [email protected] (H.D.); [email protected] (H.K.); [email protected] (S.P.) Centre for Intelligent Systems, IDMEC, Instituto Superior Técnico, 1049-001 Lisboa, Portugal LaSIGE, Faculdade de Ciências, Universidade de Lisboa, Portugal; [email protected] Rolear SA, 8001-906 Faro, Portugal; [email protected] Correspondence: [email protected]; Tel.: +351-289-800-999; Fax: +351-289-800-066 These authors contributed equally to this work.

Abstract: Accurate measurements of global solar radiation, atmospheric temperature and relative humidity, as well as the availability of the predictions of their evolution over time, are important for different areas of applications, such as agriculture, renewable energy and energy management, or thermal comfort in buildings. For this reason, an intelligent, light-weight, self-powered and portable sensor was developed, using a nearest-neighbors (NEN) algorithm and artificial neural network (ANN) models as the time-series predictor mechanisms. The hardware and software design of the implemented prototype are described, as well as the forecasting performance related to the three atmospheric variables, using both approaches, over a prediction horizon of 48-steps-ahead. Keywords: weather station; self-powered device; neural networks; prediction; wireless communications; MOGA design

1. Introduction There are a number of different weather stations available in the market. They provide measurements of atmospheric parameters such as solar radiation, air temperature and relative humidity, wind velocity and direction, atmospheric pressure and rainfall, the first three variables being the most common. The atmospheric variables are measured by sensors that usually are connected to a data logger. These are powered by an external power supply, internal or external depending on the data logger. To avoid blackouts, some weather stations include a small size battery. One important point is that the conventional data loggers have a very limited storage size, and, in the case of a power shortage, they can lose some of their data. A conventional data logger is a passive device, meaning that they do not allow the addition of external routines and/or the reprogramming of the devices, with the objective of including control actions and prediction. Same data loggers are incorporated with programming options to change the acquisition parameters and the data availability. With the evolution of technology, a few weather stations have a wireless interface integrated or offer it as an optional part. This wireless part typically uses the IEEE 802.11 or the IEEE 802.15.4 standards for communication. The ones that originally do not have the option to perform wireless data communication can be attached to a device that converts the data logger communication interface into

Sensors 2015, 15, 31005–31022; doi:10.3390/s151229841

www.mdpi.com/journal/sensors

Sensors 2015, 15, page–page Sensors 2015, 15, 31005–31022

interface into a wireless communication, with the use of devices such as the NPort Z3150 (Moxa, Brea, USA) [1] or the Waspmote (Libelium, Zaragoza, Spain) [2] that can be programmed to reach that goal. a wireless communication, with the use of devices such as the NPort Z3150 (Moxa, Brea, CA, USA) [1] A major field of current research consists in developing intelligent systems capable of or the Waspmote (Libelium, Zaragoza, Spain) [2] that can be programmed to reach that goal. integrating environmental data, to improve efficiency in the use of resources and to enable A major field of current research consists in developing intelligent systems capable of integrating sustainable functioning of man-made utilities. This can be achieved by making an intelligent use of environmental data, to improve efficiency in the use of resources and to enable sustainable functioning environmental variables forecasts [3], for applications such as photovoltaic plants and of man-made utilities. This can be achieved by making an intelligent use of environmental variables micro-grids [4–6], where global radiation and air temperature forecasts play an important role, in forecasts [3], for applications such as photovoltaic plants and micro-grids [4–6], where global radiation agricultural applications [7,8] for greenhouse environmental control and irrigation management, in and air temperature forecasts play an important role, in agricultural applications [7,8] for greenhouse energy management in buildings [9,10], where predictions of solar radiation, air temperature and environmental control and irrigation management, in energy management in buildings [9,10], where relative humidity offer the possibility of important energy savings, as well as in sensor networks, predictions of solar radiation, air temperature and relative humidity offer the possibility of important with nodes powered by miniature solar harvesters, where forecasts of solar radiation reduces the risk energy savings, as well as in sensor networks, with nodes powered by miniature solar harvesters, where of temporary depletion and increases their utility [11]. These selected works, which are a small subset forecasts of solar radiation reduces the risk of temporary depletion and increases their utility [11]. of a much larger body of research, undoubtedly illustrate the need of a weather station that, besides These selected works, which are a small subset of a much larger body of research, undoubtedly measurement of atmospheric variables, provides their forecasts autonomously, and makes them illustrate the need of a weather station that, besides measurement of atmospheric variables, provides available wirelessly to the application at hand. their forecasts autonomously, and makes them available wirelessly to the application at hand. The intelligent weather station described in this paper is a follow-up of the work described The intelligent weather station described in this paper is a follow-up of the work described in [12]. in [12]. It measures three atmospheric variables: Global solar radiation, air temperature and relative It measures three atmospheric variables: Global solar radiation, air temperature and relative humidity. humidity. These measurements are carried at a user-specified time interval. In addition, it predicts These measurements are carried at a user-specified time interval. In addition, it predicts the evolution the evolution of each variable in a prediction horizon up to 48 steps-ahead. The prediction step can of each variable in a prediction horizon up to 48 steps-ahead. The prediction step can coincide with coincide with the measurement sampling time, or it can be a multiple of it. In the latter case, the the measurement sampling time, or it can be a multiple of it. In the latter case, the average value of average value of each variable is computed, over the prediction step. In the case presented here, the each variable is computed, over the prediction step. In the case presented here, the sampling time sampling time is 1 min and the prediction step is 5 min, which means that the maximum prediction is 1 min and the prediction step is 5 min, which means that the maximum prediction horizon is 4 horizon is 4 h. The system was built with the objective of being self-sufficient, regarding electrical h. The system was built with the objective of being self-sufficient, regarding electrical energy. In energy. In addition, to facilitate its deployment, it incorporates wireless communication based on the addition, to facilitate its deployment, it incorporates wireless communication based on the wireless wireless IEEE 802.15.4 [13] standard. The weather station functional and signal flow diagram is IEEE 802.15.4 [13] standard. The weather station functional and signal flow diagram is presented in presented in Figure 1. Figure 1.

Figure 1. Simplified weather station signal-flow diagram. Figure 1. Simplified weather station signal-flow diagram.

This article is organized as follows. The hardware and software implementation are presented This article is organized as follows. The hardware and software implementation are presented in Sections 2 and 3 respectively. In Section 4, the working prototype is described and in Section 5 the in Sections 2 and 3, respectively. In Section 4, the working prototype is described and in Section 5 the prediction functionality is discussed. Results are shown in Section 6. Finally, conclusions are drawn in prediction functionality is discussed. Results are shown in Section 6. Finally, conclusions are drawn Section 7. in Section 7. 2. Hardware 2. Hardware The weather station development began with the search and selection of the hardware. The weather station itdevelopment began the search selection the hardware. As As explained previously, was necessary that with a unit that couldand execute threeofpredictive models explained previously, was the necessary that a the unitimplementation that could execute three predictive models and in a in a multi-step fashion,itstore data, enable of wireless communication multi-step fashion, store the data, enable the implementation of wireless communication and that that provided an interface to connect other hardware, such as sensors. Besides the computational

2 31006

Sensors 2015, 15, 31005–31022

requirements, it was also necessary to take into account the device power consumption since the unit must be self-powered. In order to fulfill all requirements, the Raspberry PI B+ [14] was selected. It is a mini-computer created by the Raspberry foundation, which will be denoted in the sequel as RPI. To work with an RPI, an Operating System (OS) is compulsory. The operating system must be installed on a Secure Digital (SD), which must be permanently inserted on the RPI. There is a wide variety of OSs available for the RPI, most of them Linux based. The main differences between operating systems are their base distribution and goal; some are developed to fulfill specific purposes as a media center or a web server, where others are multi-purpose. From the available options, the Raspbian OS [15], an OS based on the Debian GNU/Linux Distribution [16], compiled and optimized for RPI, was selected. This Linux distribution was chosen due to its stability, support and the fact that it is multi-purpose. With the weather station core selected, the development was shifted to the sensors employed to measure the atmospheric variables considered. The chosen sensors were the SHT75 [17] from Sensirion, to measure air temperature and relative humidity, and the SP-110 [18] from Apogee Instruments, to measure global solar radiation. The SHT75 sensor is a 4 pin digital output sensor that uses a unique capacitive sensor to measure relative humidity and a band-gap sensor to measure air temperature. It was chosen mainly for its resolution, 0.05% for relative humidity and 0.01 ˝ C for temperature. Another important factor was its stability over different atmospheric conditions. To obtain the most reliable data and to avoid problems with atmospheric conditions such as direct sun light exposure and rain, a solar radiation shield from Davis Instruments [19] was considered. For the global solar radiation measurements, the SP-110 pyranometer was employed. The SP-110 is a self-powered sensor with a sensitivity of 0.20 mV per W/m2 and a resolution of 5 W/m2 . The sensor has an analog output with a range from 0 mV to 250 mV. Since the RPI does not have analog ports, it was necessary to incorporate an analog to digital converter (ADC) to use this sensor. The chosen ADC uses an I2C interface and it has 12 bits of resolution [20]. Besides the sensors, a push button and a toggle button were also incorporated in the weather station design. The need for these buttons is due to the fact that the RPI does not have a power or reset button. Therefore a push button was added to work like a reset button: it makes changes to some configurations present in the RPI and restarts the device. The toggle button was added to provide power saving and debug modes on the weather station. Once the main hardware was selected, a power consumption study was performed on the unit. During the study, it was found that, during normal use, it would consume around 300 mA without any devices attached to it. After disabling some unnecessary software services, mostly related to the Ethernet, USB and HDMI interfaces, the consumption dropped to around 150 mA. Based on that, it was decided to have two types of modes: A power saving mode, where those services were turned off, saving power but disabling debugging; and a debug mode, where all the services were on and debugging was possible. The programming related to these buttons will be discussed in the Software section. As pointed out earlier, an important functionality of the device is its ability to communicate wirelessly using an IEEE 802.15.4 standard interface. To incorporate this feature, Xbeer RF Modules [21] with antennas were selected from Digi International. There are two types of these modules that can operate in Europe, each using a different frequency: 868 MHz [22] and 2.4 GHz [23]. The weather station was developed to allow the operation of both types, being only necessary to change the configuration. Since the RPI does not have a socket to accommodate the Xbee, a printed circuit board (PCB) was designed for that purpose. Besides the socket, the PCB includes the ADC and connections to plug the power, sensors and buttons. The developed board not only provides a place holder for the Xbee and enables the communication, but it is also ready to control its sleep state. This is particularly useful since this is a self-powered device and awaken 2.4 GHz or 868 MHz Xbee modules have a power consumption of about 37 and 60 mA, respectively. These values drop to around 0.05

31007

Sensors 2015, 15, 31005–31022

mA in sleep mode, justifying the use of sleep control. This board acts as a bridge between the external instrumentation and the RPI. It connects to the RPI via a ribbon cable. Besides the power saving options adopted, and to accomplish the self-powering goal, a solar panel and a battery were incorporated. To determine their energy capacity, it was assumed that the battery should be able to power the full system for at least 24 h, without any recharge, and the solar panel should be able to charge during the day the energy consumed overnight. From data collected through experiences and by considering safety margins, the requirements for the battery and the solar panel were determined as 10 Ah [24] and 12 V, 1.2 A [25], respectively. To increase the device sustainability and versatility, a charger prioritizing circuit was included. The objective of this implementation is to allow the user to connect the unit to the power grid, as backup. The prioritizing circuit is a micro-controller that is able to select between three power sources according to a priority list. The circuit has three inputs named V1, V2 and V3, being V1 the one with highest priority and V3 the one having least priority. At each instant, the selected power source is the one with highest priority that is valid according to its voltage. Valid voltages are configured during circuit development by recurring to the adjustment of voltage dividers. In the weather station circuit, the battery is connected to V1, meaning that only when the battery voltage drops below its cutoff voltage, V2 will be activated. When V2, the power grid, is activated, it will power the unit until the battery charge goes over a prescribed threshold, making V1 to return to its valid state. The third power input, V3, is not being used. The circuit selected to implement this behavior was the LTC4417 from Linear Technology [26]. 3. Software In the previous section, all core and peripheral hardware components selected for the development of the weather station were enumerated and described. To bring them all together and to create a weather station the software are key parts. As mentioned, a toggle button is used to select the mode of operation and a push button to restart the RPI. Associated with the toggle button there is a service that executes when the RPI is initiated. The service checks the state of the button and performs its actions accordingly. If the device is in debug mode no services are disabled and a web service is started. On the other hand if the device is in power saving mode the web server is not initiated and services related to the Ethernet, HDMI and USB bus are disabled. The state of this button is only verified when the device is initiated. The reset button is checked at every second by a service developed for that purpose. If the button is pressed between 10 and 15 s, the RPI restarts; if it is pressed longer, besides restarting it also resets the network configurations and the administrator password that gives access to the web page. A graphical overview of these services is shown in Figure 2. The web page is accessible by Ethernet when the RPI is running on Debug mode and, therefore, initializes the web server. The web page’s purpose is to allow changes in configurations, definitions and data visualization (measurements and predictions). Regarding the configuration section, it is possible to change the sampling interval, the prediction interval and some Xbee definitions. The sampling interval can be set from a minimum of 30 s to a maximum of 5 min. The prediction interval must be defined as a multiple of the sampling interval. It can only be set during the initial configuration of the weather station. The webpage also enables the user to change configurations in the Xbee module, such as destination addresses, sleep modes, encryption options, antenna type and additional configurations. Although the mentioned services are important for the unit to accomplish its objectives, the most important part of the weather station software is the data acquisition part. When the station is turned on, a service is initialized that reads the sensor values at the user-defined rate and transmits the data through the 802.15.4 wireless interface. The values are stored in the RPI using a Sqlite database and marked as sent if the destination device receives the values. Otherwise, if they are not received, they are marked as not sent and scheduled for retransmission later. Sqlite was chosen due to its simplicity and low processing requirements, as it does not possess a database engine and is simply based on

31008

Sensors 2015, 15, 31005–31022 Sensors 2015, 15, page–page

files and an interface library. The database is composed of three tables: Config, measurement and predicted values. The config table stores configuration parameters, the measurement table stores the predicted values. The config table stores configuration parameters, the measurement table stores the data acquired from the sensors and the predicted table stores the predictions. data acquired from the sensors and the predicted table stores the predictions.

Figure 2. Signal flow diagram of the reset and the power saving buttons monitor services. Figure 2. Signal flow diagram of the reset and the power saving buttons monitor services.

The predictions are computed by a program that is executed at every prediction interval. The The predictions are computed by a program that is executed at every prediction interval. The program is initiated by the cron service, a task scheduling service that exists in most Linux distributions. program is initiated by the cron service, a task scheduling service that exists in most Linux The predictions are computed by one of two algorithms: A Nearest Neighbors (NEN) algorithm or an distributions. The predictions are computed by one of two algorithms: A Nearest Neighbors (NEN) Artificial Neural Networks (ANN) based algorithm. algorithm or an Artificial Neural Networks (ANN) based algorithm. During thethe first day stationdoes doesnot notprovide provide any predictions During first dayofofdeployment, deployment, the the weather weather station any predictions as itas it does not have the necessary historical data. After acquiring a full day of data, it starts using the does not have the necessary historical data. After acquiring a full day of data, it starts using the NEN NEN algorithm to calculate the predictions of the relative air humidity, air temperature and global algorithm to calculate the predictions of the relative air humidity, air temperature and global solar solar radiation. keeps using this methodology until receives ANNparameters parametersfile filethrough throughthe the radiation. It It keeps using this methodology until it it receives ananANN 802.15.4 module. The parameters file is sent to the weather station by the receiver device, when enough 802.15.4 module. The parameters file is sent to the weather station by the receiver device, when dataenough has been acquired toacquired enable a to successful of the threeofANNs. When the When program the data has been enable a design successful design the three ANNs. the detects program existence a parameters it starts using ANNs make thetopredictions. The values detectsofthe existence of file, a parameters file, itthe starts usingapproach the ANNstoapproach make the predictions. The values acquired are maintained in the RPI for the number required to compute the acquired are maintained in the RPI for the number of days requiredoftodays compute the predictions. This predictions. This number, which is configurable through the webpage, depends on the maximum number, which is configurable through the webpage, depends on the maximum delay that is used at is used at the inputs of the forecasting algorithms. the delay inputsthat of the forecasting algorithms. 4. Prototype 4. Prototype To complete unit, it was necessarytotosearch searchand andselect select aa few few more more components To complete thethe unit, it was necessary componentstotoallow allowitsits outdoor deployment.To Tohold holdand and protect protect most electronic components, an IP box outdoor deployment. mostofofthe the electronic components, an65IPcompliant 65 compliant was used. According to the International Protection Rating, an IP 65 [27] box provides enough box was used. According to the International Protection Rating, an IP 65 [27] box provides enough protection outdoor environment,since sinceititoffers offers aa full full protection protection against protection forfor an an outdoor environment, againstdust dustand andwater waterjets. jets. The box encloses all the electronic devices, except the sensors that must be located outside The box encloses all the electronic devices, except the sensors that must be located outsidethe thebox. box. The radiation sensor does not require any special protection since it was developed to be directly The radiation sensor does not require any special protection since it was developed to be directly exposed to the environment. On the contrary, the temperature and humidity sensor is protected by a exposed to the environment. On the contrary, the temperature and humidity sensor is protected by a solar radiation shield, which protects the sensor while maintaining the relevant characteristics of the solar radiation shield, which protects the sensor while maintaining the relevant characteristics of the atmosphere. The prototype also has a mounting point to allow attaching it to a 2 m mast. atmosphere. The prototype also has a mounting point to allow attaching it to a 2 m mast. In Figure 3, it is possible to see the prototype of the meteorological station fully built and In Figure 3, it is possible to see the prototype of the meteorological station fully built and deployed. deployed. The station was deployed on the terrace of one of the University buildings, close to an The station was deployed on the terrace of one of the University buildings, close to an already working 5

31009

Sensors 2015, 15, 31005–31022 Sensors 2015, 15, page–page

data-logger based weather station. The site ofstation. deployment was chosen to allow comparison of the already working data-logger based weather The site of deployment was chosen to allow acquired data from both stations. comparison of the acquired data from both stations.

Figure 3. Two sides of the weather station prototype.

Figure 3. Two sides of the weather station prototype.

5. Predictive Models

5. Predictive Models

Two predictive models are used to generate forecasts of the three measured atmospheric

Two predictive models are used to generate forecastsapproach. of the threeBoth measured atmospheric variables: variables: A NEN algorithm and an ANN-based compute one-step-ahead A NEN algorithm and an ANN-based approach. Both compute one-step-ahead predictions, and are predictions, and are iterated in a multi-step fashion to generate longer forecasts up to a given prediction horizon. These techniques are briefly described in this Section; further details can be found iterated in a multi-step fashion to generate longer forecasts up to a given prediction horizon. These in the references provided. techniques are briefly described in this Section; further details can be found in the references provided. NEN (fordetails, details, please please see uses pattern matching to compute the predictions. Two TheThe NEN (for see[28]) [28]) uses pattern matching to compute the predictions. parameters, d and n, are necessary: d corresponds to the number of full days used to search for Two parameters, d and n, are necessary: d corresponds to the number of full days used to search the for the matching patterns (neighbors); and n is the number of closest (in the Euclidean sense) neighbors best best matching patterns (neighbors); and n is the number of closest (in the Euclidean sense) neighbors that will be averaged to compute the one-step-ahead prediction. that will be averaged to compute the one-step-ahead prediction. Using two months of existing data (from 1 July 2014, until 31 August 2014), a number of Using two months of existing data (from 1 July 2014, until 31 August 2014), a number of experiments were executed in order to determine the best (n, d) pair for each measured variable. For experiments executed to determine the d) pair for Error each (RMSE) measured that, d andwere n were varied, in andorder for each combination thebest Root(n, Mean Square overvariable. the For that, d and n were varied, and was for each combination thespace Rootconsisted Mean Square instants of the prediction horizon computed. The search of d Error 21, 28,35over 7,14,(RMSE) the instants of the prediction horizon was computed. The search space consisted of d = {7, 14, 21, 28, 35} and n  1, 2, ,8,9 . From the experiments, it was concluded that for air relative humidity the pair and n = {1, 2, . . . , 8, 9}. From the experiments, it was concluded that for air relative humidity the pair (21, 4) should be used, (35, 4) for air temperature, and (14, 3) for global solar radiation. An illustration (21, 4) should be used, (35, 4) for air temperature, and (14, 3) for global solar radiation. An illustration for the air temperature model, using 35 days of data and all values of n, is presented in Figure 4. As for the air temperature model, using 35 days of data and all values of n, is presented in Figure 4. As it it can be seen, at the end of the prediction horizon the difference between n = 3 and n = 9 is can be seen, at the end of the prediction horizon the difference between n = 3 and n = 9 is about 0.1 ˝ C. about 0.1 °C. Although the pair (35, 4) is not the one that produces the lowest RMSE, it achieves good Although the pairon(35, is not the one that produces the lowest it achieves good performance performance the4)first steps, an acceptable performance at RMSE, the final steps, and allows fewer on the first steps, an acceptable performance at the final steps, and allows fewer computations to computations to generate the prediction, therefore also contributing to save some energy. generateThe the prediction, contributing save some ANN-basedtherefore approachalso uses, for modeltodesign, an energy. existing Multi-Objective Genetic The ANN-based approach uses, forapproach model design, existinginMulti-Objective Genetic Algorithm Algorithm (MOGA) framework. This can bean included a large set of design algorithms that combine different algorithms within derivative-based ones, which can bethat seen, for (MOGA) framework. Thisevolutionary approach can be included a large set of design algorithms combine instance, in [29–31]. Details on thewith use ofderivative-based the MOGA for model cancan be sought, forfor instance, different evolutionary algorithms ones,design which be seen, instance, in [32], Details thereforeon it will briefly described in [29–31]. the be use of the MOGAhere. for model design can be sought, for instance, in [32], therefore it will be briefly described here. The MOGA is used to design Radial Basis Function (RBF) Neural Network (NN) models, by selecting combinations of input variables (and 6 their lags), as well as the number of neurons, that optimize pre-specified model performance criteria. 31010

Sensors 2015, 15, page–page

The MOGA is used to design Radial Basis Function (RBF) Neural Network (NN) models, by selecting combinations Sensors 2015, 15, 31005–31022 of input variables (and their lags), as well as the number of neurons, that optimize pre-specified model performance criteria.

Figure Evolutionofofthe theRMSE RMSEofofthe theair airtemperature temperatureover overthe theprediction predictionhorizon horizonusing using dd == 35 35 for for all Figure 4. 4. Evolution all n values. n values.

The output of a RBF model is given by: The output of a RBF model is given by: 

l

i k  C ( j )

2 2

o  k   wl 1l  ´w|j|irks e ´ Cpjq||2 ÿ

In Equation (1), o  k 

2

2 2j

(1)

2σj2

j

(1) o rks “ wl `1 ` w j e j at instant k, i  k  is the jth input at that instant, denotes the output, j

C  j k, represents w In represents of the the linear weights, theinput vector (extracted the C Equationthe (1),vector o[k] denotes output, at instant i j [k] is the jth at that instant,from w represents associatedC(j) with the hidden and represents the thematrix) vectorof ofthe thecenters linear weights, represents theneuron vectorj,(extracted from the C matrix) of the centers  j is its spread, 2 associated the hidden neuron j, σ j is its spread, and || ||2 represents the Euclidean distance. Euclideanwith distance. AsAs dynamic RBFs are are used usedas asNonlinear NonlinearAuto-Regressive Auto-Regressive (NAR) dynamicmodels modelsare areconsidered, considered, the the RBFs (NAR) models. Denoting estimation((yy), can be be given givenas: as: ˆ ),at models. Denotingasasy ythe themodelled modelledvariable, variable, the estimation at instant instant k, can





` “ ‰ ˘ yˆyˆrks k “ ff yy kk´ddoo1 ,, . . .,,yyrkk ´ddoons



1





n



(2) (2)

InInEquation representsthe theRBF RBF model Equation which means that its argument Equation(2), (2), ff represents model Equation (1), (1), which means that its argument (the d  0 delays of of y) y) represent thethe network input, , being . As the objective is to determine thethe (the delays represent network input, i[k], being d ą 0. As the objective is to determine i k  oi oi evolution of of thethe variables over a prediction horizon, Equation (2)(2) is iterated over thatthat horizon. For k evolution variables over a prediction horizon, Equation is iterated over horizon. +1,For wekshall have: +1, we shall have: ` “ ‰ ˘ yˆ rk ` 1s “ f y k ` 1 ´ do1 , . . . , y rk ` 1 ´ don s (3) yˆ  k  1  f y k  1  do1  , , y k  1  don  (3) Depending on the indices of the delays, for the steps within the prediction horizon, we may not have measured values forindices one orofmore terms in of Equation (3). These must obtained Depending on the the delays, forthe theargument steps within the prediction horizon, webe may not using previous predictions. This way, the computation of the forecast over a given prediction horizon have measured values for one or more terms in the argument of Equation (3). These must be obtained using previous predictions. This way, the computation of the forecast over a given prediction horizon is an iterative process. is an iterative The designprocess. of models by the MOGA framework involves the determination of:



‚ ‚ ‚



7 number of delays to use, and their values; The inputs: In this case, this is translated in the The number of hidden neurons (l in Equation (1)); The model parameters: C, w and σ.

31011

The design of models by the MOGA framework involves the determination of:  The inputs: In this case, this is translated in the number of delays to use, and their values;  The number of hidden neurons (l in Equation (1)); Sensors 2015, 15, 31005–31022  The model parameters: C, w and σ . Before being evaluated in MOGA, each model has its parameters determined by a Before being evaluated in MOGA, model an has error its parameters determined Levenberg-Marquardt algorithm [33,34] each minimizing criterion that exploits bythea Levenberg-Marquardt algorithm [33,34] minimizing an error criterion that exploits the linear-nonlinear linear-nonlinear relationship of the RBF NN model parameters [35,36]. The initial values of the relationship of the RBF(C NN model parameters [35,36]. The initial the nonlinear parameters nonlinear parameters and chosen randomly, or with thevalues use ofof a clustering algorithm, w is σ ) are (Cdetermined and σ) are chosen randomly, or with the use of a clustering algorithm, w is determined as a linear as a linear least-squares solution, and the procedure is terminated using the least-squares solution, and[37] the procedure is terminated using early-stopping approach [37] within early-stopping approach within a maximum number of the iterations. The workflow of MOGA can a be maximum number seen in Figure 5. of iterations. The workflow of MOGA can be seen in Figure 5.

Figure5.5. MOGA MOGA Worflow Worflow (reprinted (reprinted from from [32]). [32]). Figure

MOGA requires that the data used to develop the models is divided into three data sets: a MOGA requires that the data used to develop the models is divided into three data sets: a training training set to estimate the model parameters, a testing set for terminating the training, and a set to estimate the model parameters, a testing set for terminating the training, and a validation set to validation set to compare the performance of the models obtained by the MOGA (as the MOGA uses compare the performance of the models obtained by athesingle MOGA (as the MOGA uses multi-objective a multi-objective formulation, its results are not solution, but a set of anon-dominated formulation, its results are not a single solution, but a set of non-dominated solutions). This also data solutions). This data division is automatically executed by an algorithm, AppoxHull, which division automatically by an algorithm, whichdata alsoare ensures thatin the vertices in ensuresisthat the vertices executed in the approximate convex AppoxHull, hull of the whole included the training the approximate convex hull of the whole data are included in the training set. For more details on set. For more details on ApproxHull, please see [38]. ApproxHull, pleaseofsee [38]. The design NNs by a MOGA is a time-consuming process. For this reason, it is executed in a The design of NNs by MOGA is a time-consuming process. is executed in a cluster of processors. It is aalso an iterative process, which meansFor thatthis thereason, resultsitobtained in one cluster of processors. It is also an iterative process, which means that the results obtained in one design design experiment enable the user to fine tune the parameters of a next experiment. experiment enable the user the to fine the parameters of a next experiment. As described before, firsttune predictions are obtained using the NEN algorithm, after storing As described before, the first predictions are obtained using the NENday, algorithm, storing one one day of data, i.e.,  n, d   1,1 . These values will be increased every until theafter desired values day of data, i.e., (n, d) = (1, 1). These values will be increased every day, until the desired values for for each model can be achieved. This way, all the processing is done at the weather station. each model can be achieved. This way, all the processing is done at the weather station. The usage of the ANN models requires their design, which is done externally. The process of The usage of the ANN models requires their design, which is done externally. The process of model design starts when one of two conditions is met: after a fresh start, when enough data is model design starts when one of two conditions is met: after a fresh start, when enough data is collected; or when a degradation of the forecasts is identified. The process is implemented by an collected; or when a degradation of the forecasts is identified. The process is implemented by an Hyper-Text Transfer Protocol (HTTP) based Web Service (WS) using a basic web server authentication. 8 It accepts a POST of data that is triggered by the Weather Station Receptor (WSR) device or by the weather station, when the conditions mentioned above are detected. After the POST of data, a simple protocol ensures that the weather station will receive the expected ANNs parameters.

31012

Sensors 2015, 15, page–page

Hyper-Text Transfer Protocol (HTTP) based Web Service (WS) using a basic web server Sensors 2015, 15, 31005–31022 authentication. It accepts a POST of data that is triggered by the Weather Station Receptor (WSR)

device or by the weather station, when the conditions mentioned above are detected. After the POST of data, a simple protocol ensures that the weather station will receive the expected ANNs parameters. WhenWhen the WS a POST of of data, it itmanages theANN ANN design tasks, thereceives WS receives a POST data, managesthe the authorization, authorization, the design tasks, and and offloads the ANN design work to another system. Additionally, an email notification of this event offloads the ANN design work to another system. Additionally, an email notification of this event is is sent tosent theto technical team. ForFor each weather station, taskisispossible possible time. the technical team. each weather station,only only one one design design task at at anyany time. newistask is created theit WS, it spawns two MOGA experiments for each WhenWhen a newatask created in the in WS, spawns two MOGA designdesign experiments for each variable. variable. Theparameters first uses thedetailed parameters detailed above, while in the second, some MOGA parameters The first uses the above, while in the second, some MOGA parameters are fine are fine tuned, depending on the results of the first execution. In this case, the RMSEs for the training tuned, depending on the results of the first execution. In this case, the RMSEs for the training and testing error are set as restrictions, as well as the model complexity. The number of neurons, the testingand error are set as restrictions, as well as the model complexity. The number of neurons, the number of inputs and the set of lags considered are also decreased, therefore reducing the search number of inputs and the set of lags considered are also decreased, therefore reducing the search space space of MOGA. When the second design is finished, the model parameters are sent back to the WS of MOGA. When the second design is finished, the model parameters are sent back to the WS that that notifies the technical team of the design conclusion. If the new ANN parameters are considered notifies the of the design If them the new ANN parameters are good, good, technical the processteam is validated and theconclusion. WS will send to the weather station. If theconsidered validation is the process validated the WS analyze will send to the weatheralternative station. IfMOGA the validation is faulty, faulty,isthe technicaland team must thethem problem, formulate experiments and the technical team must analyze the parameters problem, formulate alternative MOGA experiments afterwards afterwards submit validated to the WSR. A signal flow diagram of the WS and is presented Figure 6. parameters to the WSR. A signal flow diagram of the WS is presented in Figure 6. submitinvalidated

Figure 6. WS signal flow diagram. Figure 6. WS signal flow diagram.

6. Results 6. Results The intelligent weather station was deployed the terrace the buildings of the The intelligent weather station was deployed in theinterrace of oneofofone the of buildings of the Gambelas Gambelas campus of the University of Algarve, Faro, Portugal, between 22 February 2015, 03:00:00 campus of the University of Algarve, Faro, Portugal, between 22 February 2015, 03:00:00 + 00:00+ and and 7 April + 2015, 14:35:00 + 01:00. period, 12,800 of samples of the three atmospheric 7 April00:00 2015, 14:35:00 01:00. During this During period,this 12,800 samples the three atmospheric variables variables were collected. During the first 35 days, the forecasts within a prediction horizon of 48 steps were collected. During the first 35 days, the forecasts within a prediction horizon of 48 steps ahead ahead (4 h, as the prediction interval considered was 5 min), were obtained by the NEN algorithm. (4 h, as the prediction interval considered was 5 min), were obtained by the NEN algorithm. After After that, and with 10,000 values acquired for each variable, the neural network models were that, and with 10,000 values acquired for each variable, the neural network models were designed and transmitted to the weather station by the WS. The results of the forecasts fordesigned the three and transmitted to the weather station by the WS. The results of the forecasts for the three variables obtained variables obtained by the RBF models, for the last 1350 samples (approximately the last five days) by the RBF models, for the last 1350 samples (approximately the last five days) were compared with the 9 results obtained by the NEN, with the parameterizations already mentioned, as well as (n, d) = (2, 2) and (7, 4). The RBF models were designed with two iterations of MOGA. In the MOGA experiments executed for this work, the parameters employed in the first iteration were: number of neurons in the hidden layer limited between two and 30; number of input terms for each neuron between one and 15; number of RBF NN training trials 10; maximum number of training iterations 50; population size 100. The

31013

Sensors 2015, 15, page–page

were compared with the results obtained by the NEN, with the parameterizations already mentioned, well15, as31005–31022 (n, d) = (2, 2) and (7, 4). Sensorsas2015, The RBF models were designed with two iterations of MOGA. In the MOGA experiments executed for this work, the parameters employed in the first iteration were: number of neurons in the selected model are:and the 30; RMSE obtained in the training and test data sets,one and the hidden layerdesign limitedobjectives between two number of input terms for each neuron between and 15; number In of RBF NN training trials 10; number of training iterations 50; population model complexity. the second iteration, themaximum MOGA parameters have been restricted based on the size 100. Theon selected model design objectives are: the RMSE obtained in the and testwith data goals results obtained the non-dominated set. The previous objectives were set training as restrictions, sets, and the model complexity. In the second iteration, the MOGA parameters have been restricted determined as the average of the previous results in the non-dominated set, and a further objective, based over on the obtained on the non-dominated the RMSE theresults prediction horizon, was incorporated.set. The previous objectives were set as restrictions, with goals determined as the average of the previous results in the non-dominated set, and a furtherTemperature objective, the RMSE over the prediction horizon, was incorporated. 6.1. Atmospheric

ApproxHull found 696 vertices in the data convex hull. The number of samples for the training, 6.1. Atmospheric Temperature testing and validation sets were 2888, andhull. 964, The for MOGA yielded 83 ApproxHull founddata 696 vertices in the data 962 convex Therespectively. number of samples the training, non-dominated solutions. From these, a six-input model Equation (4) was selected: testing and validation data sets were 2888, 962 and 964, respectively. The MOGA yielded 83 non-dominated solutions. From these, a six-input model Equation (4) was selected:

y rks “ f py rk ´ 1s , y rk ´ 2s , y rk ´ 6s , y rk ´ 11s , y rk ´ 277s , y rk ´ 299sq y  k   f  y  k  1 , y k  2 , y k  6 , y k  11 , y k  277 , y k  299

(4) (4)

Figure 7 shows the measured values (in black) and the values estimated by the model (in red), Figure 7 shows the measured values (in black) and the values estimated by the model (in red), for the first 100 samples of the training, testing and validation sets, respectively. The RMSE values for the first 100 samples of the training, testing and validation sets, respectively. The RMSE values obtained withwith these data sets were 0.32,respectively. respectively. It may be observed an almost obtained these data sets were0.36, 0.36,0.31 0.31 and and 0.32, It may be observed that that an almost exactexact fitting has been achieved in all data sets, which is an excellent sign about the generalization fitting has been achieved in all data sets, which is an excellent sign about the generalization capability of the model. capability of the model.

Figure 7. Measured (black) and estimated (red) values of Temperature, for the first 100 samples of the

Figure 7. Measured (black) and estimated (red) values of Temperature, for the first 100 samples of the training (Top); testing (Middle); and validation (Bottom) data sets. training (Top); testing (Middle); and validation (Bottom) data sets.

10 Figure 8 shows the air temperature one-step-ahead predictions obtained by the NEN algorithm and the RBF ANN for the last 1350 samples, as well as the evolution of the RMSE along the prediction horizon. By comparing the top and middle plots, it is clear that the best performance is obtained by the RBF ANN model. Regarding the prediction error over the instants of the prediction horizon, the bottom plot shows that the RBF ANN, as expected, achieves also the best results. It may also be concluded that the NEN method performance is positively influenced by parameterizations that use

31014

Figure 8 shows the air temperature one-step-ahead predictions obtained by the NEN algorithm and the RBF ANN for the last 1350 samples, as well as the evolution of the RMSE along the prediction horizon. By comparing the top and middle plots, it is clear that the best performance is obtained by the RBF ANN model. Regarding the prediction error over the instants of the prediction horizon, the Sensors 2015, 15, shows 31005–31022 bottom plot that the RBF ANN, as expected, achieves also the best results. It may also be concluded that the NEN method performance is positively influenced by parameterizations that use more data. The NEN(35, 4) is comparable to the RBF in the end part of the horizon, but much worse more data. The NEN (35, 4) is comparable to the RBF in the end part of the horizon, but much worse over the first half. over the first half. Table 1 summarizes the one-step-ahead RMSE and presents the sum of the RMSE over the Table 1 summarizes the one-step-ahead RMSE and presents the sum of the RMSE over the prediction horizon instants, for the four models. It is evident, among the NEN parameterizations, prediction horizon instants, for the four models. It is evident, among the NEN parameterizations, that the best results are obtained by the selected one, (35, 4), and that the best performance overall is that the best results are obtained by the selected one, (35, 4), and that the best performance overall is achieved by the ANN model. achieved by the ANN model.

Figure 8. 8. One-step-ahead error for for the the NEN NEN algorithm algorithm (Top) (Top) and and the the RBF RBF ANN ANN (Middle); (Middle); considering considering Figure One-step-ahead error the last last1350 1350data datapoints. points.Evolution Evolutionofofthe theRMSE RMSE (Bottom), along prediction horizon instants, for the (Bottom), along thethe prediction horizon instants, for air air temperature forecasts obtained by the RBF model (black), and the NEN algorithm: Red (2, temperature forecasts obtained by the RBF model (black), and the NEN algorithm: Red (2, 2), blue (7,2), 4) bluegreen (7, 4) (35, and 4). green (35, 4). and Table 1. Root mean square square errors errors (RMSEs) (RMSEs) of of Temperature. Temperature. Table 1. 48

Model Model NEN (2, 2) NEN (2, 2) NEN (7,4)4) NEN (7, NEN (35,4)4) NEN (35, RBF RBF

RMSE1

RMSE1

2.17

2.17 1.93 1.93 1.39 1.39 0.30 0.30

RMSE RMSE i

48 ř

i 1

i“1

i

111.06

111.06 101.52 101.52 84.79 84.79 65.46 65.46

6.2. Atmospheric Relative Humidity AppoxHull found 1169 vertices in the data convex hull. The number of samples for the training, 11 testing and validation was 2888, 962 and 964, respectively. The MOGA yielded 83 non-dominated solutions. From these, a six-input model Equation (5) was selected: y rks “ f py rk ´ 1s , y rk ´ 2s , y rk ´ 7s , y rk ´ 8s , y rk ´ 12s , y rk ´ 17sq 31015

(5)

6.2. Atmospheric Relative Humidity AppoxHull found 1169 vertices in the data convex hull. The number of samples for the training, testing and validation was 2888, 962 and 964, respectively. The MOGA yielded 83 non-dominated solutions. From these, a six-input model Equation (5) was selected:

Sensors 2015, 15, 31005–31022

y  k   f  y  k  1 , y k  2 , y k  7 , y k  8 , y k  12 , y k  17

(5)

Figure measured values values (in (in black) black)and andthe thevalues valuespredicted predictedby bythe themodel, model,for forthe the Figure 9 depicts depicts the measured first testing and and validation validationsets, sets,respectively. respectively.The Thecorresponding correspondingRMSE RMSE first 100 100 samples samples of the training, testing values withthese thesedata datasets setswere were1.46, 1.46, 1.03 and 1.07, respectively. As air fortemperature, air temperature, values obtained with 1.03 and 1.07, respectively. As for an an almost perfect fitting obtained in cases. all cases. almost perfect fitting waswas obtained in all Figure 10 10illustrates illustratesthe theone-step-ahead one-step-aheadpredictions predictions obtained NEN algorithm the Figure obtained byby thethe NEN algorithm withwith the three three parameterizations and theANN, RBF ANN, the1350 lastsamples, 1350 samples, asas well the evolution the parameterizations and the RBF for thefor last as well theasevolution of theofRMSE RMSEthe along the prediction the four models. that, for relative humidity, the along prediction horizonhorizon for the for four models. PleasePlease notice notice that, for relative humidity, the chosen chosen NEN parameterization was (21, 4). NEN parameterization was (21, 4).

Figure 9. 9. Measured Measured (black) (black) and and estimated estimated (red) (red) values values of of relative relative humidity, humidity,for forthe thefirst first100 100samples samplesof Figure of the training (Top); testing (Middle); and validation (Bottom) data sets. the training (Top); testing (Middle); and validation (Bottom) data sets.

It may be seen that the NEN performance suffers, because relative humidity day-to-day patterns exhibit a stronger variability than air temperature. Figure 10 shows the corresponding result obtained by executing the RBF model (in red). The conclusions that were drawn for air temperature apply also to relative humidity: The best performance was obtained by the RBF NN model, and the parameterization (21, 4) achieved the best NEN results, which are better than those obtained by the RBF at the last few instants of the prediction horizon. Table 2 presents the summary of results for the relative humidity, considering the four models. As found for the Temperature, among the NEN parameterizations, the best results are obtained by the selected one, and the best performance overall is12 obtained by the ANN model.

31016

Sensors 2015, 15, 31005–31022 Sensors 2015, 15, page–page

Figure 10. One-step-ahead error for the NEN algorithm (Top) and the RBF ANN (Middle), Figure 10. One-step-ahead error for the NEN algorithm (Top) and the RBF ANN (Middle), considering considering the last 1350 data points. Evolution of the RMSE (Bottom), along the prediction horizon the last 1350 data points. Evolution of the RMSE (Bottom), along the prediction horizon instants, for instants, for air relative humidity forecasts obtained by the RBF model (black), and the NEN air relative humidity forecasts obtained by the RBF model (black), and the NEN algorithm: Red (2, 2), algorithm: Red (2, 2), blue (7, 4) and green (21, 4). blue (7, 4) and green (21, 4).

It may be seen that the NEN performance suffers, because relative humidity day-to-day patterns Table 2. RMSEs of Relative exhibit a stronger variability than air temperature. Figure 10Humidity. shows the corresponding result obtained by executing the RBF model (in red). The conclusions that were drawn for air temperature apply also 48 ř to relative humidity: The best performance was obtained by the RBF NN model, and the Model RMSE1 RMSEi parameterization (21, 4) achieved the best NEN results, which i“1 are better than those obtained by the RBF at the last few instants of NEN the prediction horizon. (2, 2) 14.34 742.17 Table 2 presents the summary of results for the relative humidity, considering the four models. NEN (7, 4) 11.32 632.72 As found for the Temperature, among the NEN8.52 parameterizations, NEN (21, 4) 497.36 the best results are obtained by the selected one, and the best performance overall by the ANN model. RBF 0.99is obtained409.43 Table 2. RMSEs of Relative Humidity.

6.3. Solar Radiation

48

RMSE  i 1 ApproxHull found 659 vertices.Model The numberRMSE of samples for the training, testing and validation i 1 was 2895, 965 and 966, respectively.NEN The(2, MOGA yielded solutions. From these, an 2) 14.34 168 non-dominated 742.17 11-input model Equation (6) was selected: NEN (7, 4) 11.32 632.72

˜ y rks “ f

NEN (21, 4)

8.52

497.36

rk ´ 2s , y rk ´ 3s , y rk ´ 409.43 5s , y rk ´ 8s , y rk ´ 34s , y rk ´ 1s , y RBF 0.99 y rk ´ 35s , y rk ´ 37s , y rk ´ 281s , y rk ´ 289s , y rk ´ 290s

¸ (6)

6.3. Solar Radiation

Figure 11 showsfound the measured values (in black) and thefor values estimated by the for the ApproxHull 659 vertices. The number of samples the training, testing and model, validation first 100 samples of the training, testing and validation sets, respectively. The RMSEs obtained was 2895, 965 and 966, respectively. The MOGA yielded 168 non-dominated solutions. From these,with these an data sets were 31.2(6)and respectively. Although the fittings are excellent, as for 11-input model71.35, Equation was38.18, selected: the other variables, regarding solar radiation the error in the training set is, in comparison, higher. 13 This was a consequence of an increase of cloudiness during those days, which resulted in increased uncertainty and consequent degradation of predictive performance. Please note that the RMSE in

31017

Figure 11 shows the measured values (in black) and the values estimated by the model, for the first 100 samples of the training, testing and validation sets, respectively. The RMSEs obtained with these data sets were 71.35, 31.2 and 38.18, respectively. Although the fittings are excellent, as for the other variables, regarding solar radiation the error in the training set is, in comparison, higher. This Sensors 15, 31005–31022 was a2015, consequence of an increase of cloudiness during those days, which resulted in increased uncertainty and consequent degradation of predictive performance. Please note that the RMSE in the training set set is expected to be higher than in in the other the training is expected to be higher than the othersets, sets,asasthe thetraining trainingset setincludes includes the the convex convex hull samples. hull samples. Figure predictions obtained by the algorithm with the Figure 12 12 shows showsthe theone-step-ahead one-step-ahead predictions obtained by NEN the NEN algorithm withthree the parameterizations, and by the RBF ANN model, for the last 1350 samples, as well as the evolution of three parameterizations, and by the RBF ANN model, for the last 1350 samples, as well as the the RMSE over the prediction horizon instants for all the models. Please notice that, for this variable, evolution of the RMSE over the prediction horizon instants for all the models. Please notice that, the chosen parameterization was (14, 4). By comparing topcomparing and middlethe plots maymiddle be concluded for this variable, the chosen parameterization was (14, the 4). By topitand plots it that the RBF ANN achieves the best results. This may be confirmed by looking at the bottom plot, may be concluded that the RBF ANN achieves the best results. This may be confirmed by looking at which illustrates the evolution of the RMSE, along the prediction horizon instants, obtained by the the bottom plot, which illustrates the evolution of the RMSE, along the prediction horizon instants, four models considered. Contrary to the previous weather variables, for solarvariables, radiationfor none of obtained by the four models considered. Contrarytwo to the previous two weather solar the NEN models achieves a comparable performance with the RBF ANN in any part of the radiation none of the NEN models achieves a comparable performance with the RBF ANN in any part prediction horizon. of the prediction horizon. Table shows the the one-step-ahead one-step-ahead RMSE the sum sum of of the the RMSE RMSE over over the the prediction prediction Table 33 shows RMSE as as well well as as the horizon instants, for all the models. As found for the two other variables, among NEN horizon instants, for all the models. As found for the two other variables, among the the NEN parameterizations, the the best best results results are are obtained obtained by by the the selected selected one, one, and parameterizations, and the the best best performance performance overall overall is achieved by the ANN model. is achieved by the ANN model.

Figure 11. Measured (black) and estimated (red) values of solar radiation, for the first 100 samples of the training (Top); (Top); testing testing (Middle); (Middle); and and validation validation (Bottom) (Bottom) data data sets. sets.

14

31018

Sensors 2015, 15, 31005–31022 Sensors 2015, 15, page–page

Figure 12. One-step-ahead error for the NEN algorithm (Top) and the RBF ANN (Middle), Figure 12. One-step-ahead error for the NEN algorithm (Top) and the RBF ANN (Middle), considering considering the last 1350 data points. Evolution of the RMSE (Bottom), along the prediction horizon the last 1350 data points. Evolution of the RMSE (Bottom), along the prediction horizon instants, instants, for solar radiation forecasts obtained by the RBF model (black), and the NEN algorithm: for solar radiation forecasts obtained by the RBF model (black), and the NEN algorithm: Red (2, 2), Red (2, 2), blue (7, 4) and green (14, 4). blue (7, 4) and green (14, 4). Table 3. RMSEs of Solar Radiation. Table 3. RMSEs of Solar Radiation. 48

Model Model

NEN (2, 2) NEN (7, 2) 4) NEN (2, NEN (14, NEN (7, 4)4) NEN (14, 4) RBF RBF

RMSE1 RMSE1

132.22 122.26 132.22 154.67 122.26 154.67 29.49 29.49

 RMSE 48 ř i 1

i

RMSEi

12,109 12,173 12,109 11,951 12,173 11,951 7850

i“1

7850

7. Conclusions 7. Conclusions In this paper, we have shown the hardware and software design of an intelligent weather station which, besides offering wireless communication and energy autonomy,design provides measurements In this paper, we have shown the hardware and software of not an only intelligent weather of atmospheric variables, but also their forecasts, over a prediction horizon. station which, besides offering wireless communication and energy autonomy, provides not only Two types of forecasting methodsbut arealso available in the weather a Nearest Neighbor measurements of atmospheric variables, their forecasts, over a station: prediction horizon. algorithm, which is completely local to the station, and another based on Artificial Neural Two types of forecasting methods are available in the weather station: a NearestNetwork Neighbor models, which, for their design, requires an auxiliary computer system to perform optimized model algorithm, which is completely local to the station, and another based on Artificial Neural Network design. It was shown that the forecasts obtained by the ANN models are substantially better than the models, which, for their design, requires an auxiliary computer system to perform optimized model ones given by the NEN algorithm. design. It was shown that the forecasts obtained by the ANN models are substantially better than the An accurate comparison of the prediction results with other approaches is difficult because the ones given by the NEN algorithm. data, as well as the prediction interval, are not the same and, typically, a prediction horizon of just An accurate comparison of the prediction results with other approaches is difficult because the one step is considered in these approaches. In order to have a general idea of the quality of the RBF data, as wellofas the prediction interval, are not the same and, typically, a prediction of just forecasts the intelligent weather station, compared with other solutions, it must firsthorizon be assumed onethat step is considered in these approaches. In order to have a general idea of the quality of the RBF similar predictions will occur when the prediction interval is changed. Assuming this, it can be forecasts of the intelligent weather station, compared with other solutions, it must first be assumed that 15

31019

Sensors 2015, 15, 31005–31022

similar predictions will occur when the prediction interval is changed. Assuming this, it can be pointed out that, in [5], different 1-step forecasting methods of solar radiation were compared, considering a prediction interval of 1 h. Their RMSEs lied between a range of [48.8 59.5] W/m2 . In our case, the RMSE is 29.5 W/m2 for a prediction interval of 5 min. In [4], considering also a prediction interval of 1 h, the mean absolute percentage error (MAPE) obtained for the solar radiation of one cloudy day is 9.65%, while this index, computed for the RBF results using the data used in Section 6.3, is 7.78%. In [3], one-step-ahead forecasts of air temperature and relative humidity are presented. Their RMSEs lie in the range of [1.58 1.63] ˝ C and [4.25 4.47]%, while in the ANN approach presented in this paper these values are 0.3 ˝ C and 0.99%. If any of the approaches referenced above would be applied for a specific site, a weather station would have to be installed in that location, models would have to be designed externally, using data that should be transmitted in real-time from that weather station, and one-step-ahead predictions would have to be computed, in real-time, externally. The intelligent weather station proposed in this work is a complete and autonomous solution to this problem, besides enabling to have excellent quality predictions over a user-defined prediction horizon, and not for a single step. As such, we anticipate that a commercial version of such a device will have a large range of practical applications, examples being in PV plants, energy building management systems as well as in agricultural applications. Acknowledgments: The authors would like to acknowledge the support of QREN SIDT 38798 and University of Algarve grant No. 032/2015. Author Contributions: All the authors belonged to the research team of QREN SIDT 38798, with the exception of Hamid Khosravani, who developed ApproxHull used in this work, and Shabnam Pesteh, who contributed to this work in her Master Thesis. Conflicts of Interest: The authors declare no conflict of interest.

References 1. 2. 3.

4. 5. 6.

7. 8.

9. 10. 11.

Moxa Inc. Nport z3150 Series User’s Manual. Available online: http://www.moxa.com/doc/man/ NPort_Z3150_Series_Users_Manual_v2.pdf (accessed on 6 December 2015). Libelium. Waspmote Overview. Available online: http://www.libelium.com/products/waspmote/overview/ (accessed on 6 December 2015). Das, M.; Ghosh, S.K. A probabilistic approach for weather forecast using spatio-temporal inter-relationships among climate variables. In Proceedings of the 2014 9th International Conference on Industrial and Information Systems (ICIIS), Gwalior, India, 15–17 December 2014; pp. 1–6. Chen, S.X.; Gooi, H.B.; Wang, M.Q. Solar radiation forecast based on fuzzy logic and neural networks. Renew. Energy 2013, 60, 195–201. [CrossRef] Inman, R.H.; Pedro, H.T.C.; Coimbra, C.F.M. Solar forecasting methods for renewable energy integration. Prog. Energy Combust. Sci. 2013, 39, 535–576. [CrossRef] Sharma, N.; Sharma, P.; Irwin, D.; Shenoy, P. Predicting solar generation from weather forecasts using machine learning. In Proceedings of the 2011 IEEE International Conference on Smart Grid Communications (SmartGridComm), Brussels, Belgium, 17–20 October 2011; pp. 528–533. Ferreira, P.M.; Ruano, A.E. Discrete model based greenhouse environmental control using the branch & bound algorithm. In Proceedings of the 17th IFAC World Congress, Seoul, Korea, 6–11 July 2008. Luo, Y.; Chang, X.; Peng, S.; Khan, S.; Wang, W.; Zheng, Q.; Cai, X. Short-term forecasting of daily reference evapotranspiration using the hargreaves-samani model and temperature forecasts. Agric. Water Manag. 2014, 136, 42–51. [CrossRef] Ferreira, P.M.; Ruano, A.E.; Silva, S.; Conceicao, E.Z.E. Neural networks based predictive control for thermal comfort and energy savings in public buildings. Energy Build. 2012, 55, 238–251. [CrossRef] Collotta, M.; Messineo, A.; Nicolosi, G.; Pau, G. A dynamic fuzzy controller to meet thermal comfort by using neural network forecasted parameters as the input. Energies 2014, 7, 4727–4756. [CrossRef] Renner, C.; Nguyen, P.A.T. A system for efficient dissemination of weather forecasts for sustainable solar-powered sensors. In Proceedings of the Sustainable Internet and ICT for Sustainability (SustainIT), Madrid, Spain, 14–15 April 2015; pp. 1–8.

31020

Sensors 2015, 15, 31005–31022

12. 13. 14. 15. 16. 17.

18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28.

29. 30.

31. 32.

33. 34. 35.

Ferreira, P.M.; Gomes, J.M.; Martins, I.A.C.; Ruano, A.E. A neural network based intelligent predictive sensor for cloudiness, solar radiation, and air temperature. Sensors 2012, 12, 15750–15777. [CrossRef] [PubMed] IEEE. IEEE Standard for Local and Metropolitan Area Networks. Available online: http://standards.ieee.org/getieee802/download/802.15.4k-2013.pdf (accessed on 6 December 2015). Foundation, R.P. Raspberry Pi—Model B. Available online: http://www.raspberrypi.org/products/model-b/ (accessed on 6 December 2015). Raspbian. Raspbian OS. Available online: http://www.raspbian.org/RaspbianDocumentation (accessed on 6 December 2015). Debian. Debian OS. Available online: www.debian.org (accessed on 6 December 2015). AG, S. Sht7x Datasheet. Available online: http://www.sensirion.com/fileadmin/user_upload/ customers/sensirion/Dokumente/Humidity/Sensirion_Humidity_SHT7x_Datasheet_V5.pdf (accessed on 6 December 2015). Apogee Instruments, Inc. Owner’s Manual—Pyranometer Model sp-110 and sp-230. Available online: https://www.apogeeinstruments.co.uk/content/SP-110manual.pdf (accessed on 6 December 2015). Davisnet. Radiation Shiled User´s Guide. Available online: http://www.davisnet.com/product_documents/ weather/manuals/07395-093_IM_07714.pdf (accessed on 6 December 2015). Tecnology, L. Ltc2309 Datasheet. Available online: http://cds.linear.com/docs/en/datasheet/2309fd.pdf (accessed on 6 December 2015). Inc, D.I. Xbee RF Modules. Available online: http://www.digi.com/products/wireless-wired-embeddedsolutions/zigbee-rf-modules/zigbee-mesh-module/ (accessed on 6 December 2015). Digi International Inc. Xbeer /Xbee-pror 868 RF Modules. Available online: http://ftp1.digi.com/ support/documentation/90001020_E.pdf (accessed on 6 November 2015). Digi International Inc. Xbeer /Xbee-pror RF Modules. Available online: http://ftp1.digi.com/support/ documentation/90000982_R.pdf (accessed on 6 November 2015). Yuasa. Np 10-6 Data Sheet. Available online: http://www.yuasabatteries.com/pdfs/NP_10_6_DataSheet.pdf (accessed on 6 December 2015). SunStore. 12v 20w Monocrystalline Solar Panel. Available online: http://www.sunstore.co.uk/12v-20wMonocrystalline-Solar-Panel.html (accessed on 6 December 2015). Tecnologies, L. Ltc4417 Datasheet. Available online: http://cds.linear.com/docs/en/datasheet/4417f.pdf (accessed on 6 December 2015). DSM & T. Ip Rating. Available online: http://www.dsmt.com/pdf/resources/iprating.pdf (accessed on 6 December 2015). Ferreira, P.M.; Pestana, R.; Ruano, A.E. Improving the identification of rbf predictive models to forecast the portuguese electricity consumption. In Proceedings of the IFAC Conference on Control Methodologies and Technology for Energy Efficiency (CMTEE 2010), Vilamoura, Portugal, 29–31 March 2010. Garro, B.A.; Sossa, H.; Vásquez, R. Back-propagation vs. particle swarm optimization algorithm: Which algorithm is better to adjust the synaptic weights of a feed-forward ann? Int. J. Artif. Intell. 2011, 7, 208–212. Nawi, N.; khan, A.; Rehman, M.Z.; Aziz, M.; Herawan, T.; Abawajy, J. An accelerated particle swarm optimization based levenberg marquardt back propagation algorithm. In Neural Information Processing; Loo, C., Yap, K., Wong, K., Teoh, A., Huang, K., Eds.; Springer International Publishing: Berlin, Germany, 2014; Volume 8835, pp. 245–253. Zhang, W.; Niu, P.; Li, G.; Li, P. Forecasting of turbine heat rate with online least squares support vector machine based on gravitational search algorithm. Knowl. Based Syst. 2013, 39, 34–44. [CrossRef] Ferreira, P.; Ruano, A. Evolutionary multiobjective neural network models identification: Evolving task-optimised models. In New Advances in Intelligent Signal Processing; Ruano, A., Várkonyi-Kóczy, A., Eds.; Springer: Berlin/Heidelberg, Germany, 2011; Volume 372, pp. 21–53. Levenberg, K. A method for the solution of certain problems in least squares. Q. Appl. Math. 1944, 2, 164–168. Marquardt, D. An algorithm for least-squares estimation of nonlinear parameters. SIAM J. Appl. Math. 1963, 11, 431–441. [CrossRef] Ruano, A.E.B.; Jones, D.I.; Fleming, P.J. A new formulation of the learning problem for a neural network controller. In Proceedings of the 30th IEEE Conference on Decision and Control, Brighton, UK, 11–13 December 1991; pp. 865–866.

31021

Sensors 2015, 15, 31005–31022

36. 37. 38.

Ferreira, P.M.; Faria, E.A.; Ruano, A.E. Neural network models in greenhouse air temperature prediction. Neurocomputing 2002, 43, 51–75. [CrossRef] Haykin, S. Neural Networks: A Comprehensive Foundation, 2nd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 1999. Ruano, A.; Khosravani, H.R.; Ferreira, P.M. A randomized approximation convex hull algorithm for high dimensions. In Proceedings of the 2nd IFAC Conference on Embedded Systems, Computational Intelligence and Telematics Control (CESCIT), Maribor, Slovenia, 22–24 June 2015. © 2015 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons by Attribution (CC-BY) license (http://creativecommons.org/licenses/by/4.0/).

31022

An Intelligent Weather Station.

Accurate measurements of global solar radiation, atmospheric temperature and relative humidity, as well as the availability of the predictions of thei...
NAN Sizes 0 Downloads 10 Views