Skip to Content
You are currently on the new version of our website. Access the old version .
  • Proceeding Paper
  • Open Access

1 September 2026

9 Pages

Artificial Neural Network Model for Predicting Transients in a Heating and Domestic Hot Water System with Data from ThingSpeak †

and
Department of Electrical Engineering, Electronics and Automation, University of Food Technologies, 4002 Plovdiv, Bulgaria
*
Author to whom correspondence should be addressed.
†
Presented at the International Conference on Electronics, Engineering Physics and Earth Science (EEPES2026), Bandirma, Turkey, 24–27 June 2026.

Abstract

Modeling an artificial neural network to predict the behavior of a heating and domestic hot water system in a residential building is the basis of this report. The heating system includes three types of energy sources: biofuel, solar, and electricity. During transitional seasons, such as spring and autumn, it is possible to use all three sources periodically or simultaneously, which leads to increased consumption and inefficiency in the system. In order to study the dynamics of the process and optimize the control, a monitoring system based on Raspberry Pi Pico W was developed. Data on the operating parameters of the boiler, tank, and radiator is transmitted in real-time to the ThingSpeak cloud platform, using the free access option that requires only registration. Due to the reinforced concrete structure of the building, the local Wi-Fi connection drops at times, so an additional router was added. Although individual values from the data are missing, they can be used to obtain graphs of the transient process. The data received in the platform does not arrive evenly due to the time required for transmission. The artificial neural network was created in MATLAB (v2025, MathWorks, Natick, MA, USA) and uses the raw data to predict changes in the processes. The missing fragments of the data have no impact, and a good match of the actual values with the predicted values was obtained for the tank and radiator, while for the boiler, the match was satisfactory.

1. Introduction

The emergence of inexpensive microcontrollers, Internet technologies, and modules for working with them (Internet of Things, IoT) has allowed for the rapid prototyping of products that would previously have been impossible. Today, every user can research, analyze, monitor, and record things in different domains of their life. For example, they can monitor the behavior of their pets, the behavior of their children, environmental and home parameters, work, and transient processes in various systems. Data are sent in real time to cloud platforms, from which they can be monitored and downloaded for processing and analysis at a later stage. From these, predictive models can be obtained, and from these, processes of optimization can be undertaken. Therefore, it is necessary that the data obtained are reliable and that there are no missing fragments in order to obtain an adequate model of the studied process. However, it is possible, even with missing data, to create a model in various ways through data processing. Such methods, used increasingly widely in various kinds of research, include artificial neural networks (ANNs), deep learning (DL), and random forest (RF). In recent years, much research has been conducted in this area as predictive models show good agreement with experimental data. The research conducted has shown a wide range of applications, especially in the study of thermal processes.
Artificial neural network models have been applied to solve difficult and complex thermal problems which cannot be solved through traditional approaches [1]. The performance of a trained ANN in solving heat transfer problems has been tested using regression analysis, obtaining mean square error, mean absolute error, coefficient of determination, and absolute standard deviation [2].
The use of machine learning for analyzing energy consumption data in two buildings was reported in [3], comparing the performance of ANN and random forests (RF). Neural network modeling for predicting heat exchanger performance is presented in [4], and the transfer functions of the heat exchanger were obtained using the System Identification Toolbox.
An artificial neural network with four neurons in the hidden layer has been used to study the parameters of the wood thermal treatment process [5]. Artificial neural network models have been used to model surface roughness in manufacturing processes [6].
In [7], the Internet of Things (IoT) and artificial intelligence (AI) were used to predict energy consumption in an educational laboratory. The collected sensor data were used to build an ANN model to predict the temperature in the laboratory.
In [8], artificial neural network models were used to simulate the thermal characteristics of a compact finned tube heat exchanger, and the trained network was able to predict the overall heat transfer rate between the liquid and air vapor.
Through the combination of deep learning technology and the principles of thermal engineering and automatic control, a deep learning-based primary control scheme for the central heating system was proposed in [9].
The ANN model in [10] was developed to effectively predict the performance of heating, ventilation, and air conditioning (HVAC) systems in order to optimize building energy systems. Deep learning methods with convolutional neural networks (CNN), i.e., GoogLeNet and SqueezeNet, as well as transfer learning, were used for apple variety identification in [11].
In this work, an artificial neural network model has been developed to predict transient processes in a real heating and domestic hot water system, using data obtained from the ThingSpeak cloud platform. The temperatures of the boiler, radiator, and tank are monitored, and the model will serve to optimize processes during the transition period in the spring and autumn. The scientific contribution of this work is expressed in the implementation and evaluation of an artificial neural network model for predicting transient thermal processes in a real hybrid heating and domestic hot water system based on a cloud-based IoT infrastructure. The emphasis is placed on the impact of incomplete and unevenly received experimental data on the quality of ANN-based prediction. The results obtained provide an experimental basis for assessing the applicability of ANN models under real operational conditions typical of IoT-based monitoring and control systems.

2. Materials and Methods

2.1. Description of the Installed System

The heating and domestic hot water system (Hydro Term, Plovdiv, Bulgaria) is located in the city of Plovdiv, Bulgaria, and is installed in a three-story residential building with an unheated ground floor. Figure 1 presents a block diagram of the existing system. It can be divided into two separate independent units: one for heating and domestic hot water and a temperature-monitoring system with a cloud platform. The first unit consists of a bio-fuel boiler (pellets) with a capacity of 80 L, a tank with a capacity of 300 L and two coils, radiators, consumers (C), and a solar module consisting of two parts, namely, a collector and 30 solar vacuum tubes with a total area of 3.4 m2 (KIT Engineering, Plovdiv, Bulgaria). The heated volume of the building is 1280 m3. The system is used all year round and can be conditionally divided into summer and winter seasons. The spring and autumn seasons are transitional, and the boiler is partially used depending on the ambient temperature. For this period, an additional source of energy is provided, namely, voltage from the electrical network (~3P). The hot water from the boiler reaches the radiators and consumers via a circulation pump (P1) connected to this loop and controlled by the boiler controller. In Figure 1, solid arrows show the connection in the diagram, and dotted arrows show the wireless connection.
Figure 1. Heating system flow chart.
The solar module is connected to the tank all year round and is controlled by a differential thermostat (DT) that includes another circulation pump (P2) in this loop when a set temperature is reached. The sensors (S1, S2) for the differential thermostat are placed at the collector outlet and the middle of the tank. Essentially, the heating and domestic hot water system is a hybrid, as it uses three different energy sources: electricity, biofuel, and solar. In terms of process optimization, the most interesting is the transition process, and efforts to reduce consumption are focused there.
The second unit for monitoring thermal processes is composed of a control part called a server, a sensor module (SM), a home Wi-Fi router, a mobile phone, a computer (PC), and the ThingSpeak cloud platform. The control unit is based on the Raspberry Pi Pico W (v.Rev3.board) board, which offers additional advantages such as a compact size, a built-in Wi-Fi module, a large number of pins (23), and a low price (9 euros at “Comet” stores in Bulgaria) compared to similar devices. The sensor module is made up of three digital temperature sensors (DS1820) with a measurement accuracy of ±0.5 °C. The home Wi-Fi router is the basis of the home wireless network for connection to the Internet and the ThingSpeak cloud platform. The platform records data from the processes in the boiler, tank and one radiator. The data can be downloaded by the user at any time and place from a mobile phone or computer. It is important to note that the data does not arrive at a strictly defined interval, as the server needs time to send them to the platform.
Another problem that was noticed during the work is the failure of the wireless connection; hence, the data arrives at uneven intervals in the cloud platform. The data loss was partly due to the reinforced concrete structure of the building, and a second router was added to resolve this issue. Figure 2 shows the data of the three measured temperatures for a certain period obtained in ThingSpeak.
Figure 2. Data from the transition process obtained in ThingSpeak.
The figure indicates a lack of data, especially at the beginning of the system startup process, when it is most dynamic. The platform has the option to replace missing values in the data, but this feature was not used at this stage. In order to predict the behavior of the system and optimize it, an artificial neural network model for process prediction has been created in this work.

2.2. Multilayer Perceptron

Artificial neural network models for data processing are used to generate a model that structurally and functionally resembles the nervous system of a biological organism. Through them, the behavior of technological processes can be simulated, modeled, and predicted, and this is one part of the wide spectrum of their applications. At its core, an artificial neural network is a multilayered structure of neurons with a set of properties that adapt to the specific process of involving in processing the received data. The biggest advantages that this structure has for solving specific tasks are flexibility, training, organization, forecasting, and optimization. The basic structure of an artificial neural network is presented in Figure 3. It consists of an input layer, hidden layers, and an output layer. The neurons in each layer are connected to all neurons in the next layer by weight vectors. In Figure 3, these connections are represented by solid arrows.
Figure 3. Schematic diagram of a multilayer artificial neural network.
Depending on the type of connections, two large groups of network architectures are distinguished:
  • Straight networks, in which data are transmitted strictly from the input to the output neurons, without any feedback connections;
  • Recurrent networks, which can include feedback loops originating from the neurons of one layer and ending at the input of neurons from the same or previous layer.
Another important point is the choice of how the neural network will be trained. In this case, the Levenberg–Marquardt (LM) method, which is the default in MATLAB and is designed for small- and medium-sized neural networks, is used. At its core, this method gradually updates its parameter vector w [12,13]:
w k + 1 = w k + ∆ w ( k ) ,
where k is the step number of the gradient procedure. The objective function is represented as the sum of the squared errors (MSE) of the neural network:
J w = 1 2 1 M ∑ k = 1 M e k 2 ( w ) ,
where M is the training matrix (sample), and e k is the current error. The Hesse matrix is constructed as follows:
J w = ∂ e 1 ( w ) ∂ w 1 … ∂ e 1 ( w ) ∂ w n ⋮ … ⋮ ∂ e M ( w ) ∂ w 1 … ∂ e M ( w ) ∂ w n ,   a n d   e w = e 1 ( w ) e 2 ( w ) ⋮ e M ( w ) ,
The result is obtained according to the formula:
w n + k = w n − J T w J w + ξ w I − 1 J T w e ( w ) ,
where I is a unit matrix, and ξ w is a regularization vector of the form:
ξ w = ∑ k = 1 M e w ∇ 2 e k ( w ) ,
The Hessian is approximated by the expression:
H w = ∇ 2 E w = J T w J w + ξ w I ,
where ∇ is the gradient function.
The LM model in MATLAB was chosen because it is the fastest of all methods for small networks, and because it combines the steepest descent method (when far from the minimum) and the Gauss–Newton method (when close to the minimum).

3. Results and Discussion

To obtain an accurate model predicting thermal processes through an artificial neural network, a sufficient set of experimental data is required. The data from the cloud platform were processed in MATLAB as input training vectors for the artificial neural network model.
The ANN model is composed of one input layer with a number of neurons corresponding to the length of the input experimental vectors, two hidden layers, and one output layer. In order to implement short-term training at a certain accuracy, the number of neurons in the hidden layers is chosen experimentally.
The number of parameters of the artificial neural network depends on the number of layers, the number of neurons in each layer, the type of connections between the neurons, and the presence of additional parameters (bias, attention, embeddings, etc.). In the present study, the neurons in the input layer correspond to the number of experimentally measured system temperature points. The heating system sensors record data at intervals of 20 s (Δt = 20 s) during a continuous four-day measurement period, which results in the 10,124 synchronized temperature points used to train the artificial neural network. The number of neurons in the two hidden layers is 200, which was determined experimentally based on several simulations. The goal is to adapt the experimental data to the ANN model, as a result of which the network can be trained in a relatively short time with an optimally good result.
Figure 4 shows the comparison of the experimental data from ThingSpeak for the boiler and the output of the artificial neural network. It can be seen that even when introducing a disturbance (a higher boiler temperature set), the ANN manages to predict it. It is also noticeable that when the signal frequency from the two-position regulator is lower, there is no good match at the output.
Figure 4. Experimental data from the boiler and ANN output.
On the other hand, the reservoir data shown in Figure 5 compared with the output of the artificial neural network shows a good match, which is due to the nature of the process.
Figure 5. Experimental data from the tank and ANN output.
The same is observed in Figure 6, where the experimental data from the radiator and the output of the artificial neural network are compared. The two short-term peaks are due to the operation of the radiator thermal head and the limiting of the temperature to the set value.
Figure 6. Experimental data from the radiator and ANN output model.
To avoid overtraining the network, the input data are divided into three parts. In this case, 70% of the experimental data are used for training, 15% are used for validation to stop training before overtraining can occur, and the remaining 15% are used for independent testing. The graphs show that in highly dynamic processes, such as the boiler temperature signal, the limited and unevenly distributed data affect the accuracy of the forecast. The transition from an established regime to a new set point of 50 °C is predicted smoothly by the neural network, while with sharper dynamics, the coincidence is more limited. In contrast, the temperature processes in the radiator and tank are characterized by smoother changes and greater thermal inertia, whereby the ANN model reproduces their behavior with higher accuracy. To compare the accuracy of the predictive model (ANN) with the real data, the root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) were calculated. For this purpose, it is necessary to perform additional processing in MATLAB. Since there are missing data in the array, they are output to the program as NaN (not a number) and cannot be used in calculations. Logical indexing is used to remove data pairs in which at least one of the elements is NaN. The results are summarized in Table 1.
Table 1. Calculated values from the errors from the real data and the ANN model.
The results show that the accuracy of the ANN-based model is strongly dependent on the dynamics of the studied thermal process and the quality of the available experimental data. With rapid transitions and two-position control, which are typical of the boiler, local deviations between the experimental and predicted data are observed, especially in intervals with missing or asynchronously incoming measurements. This behavior is expected and is due to the limited ability of the model to reproduce high-frequency variations with insufficient temporal density of the data. At the same time, the obtained results confirm that under slowly changing transient regimes, the ANN model is a suitable tool for the prediction and analysis of real IoT-based heating systems.

4. Conclusions

This publication presents a model of a multilayer artificial neural network for predicting the temperature change in a heating and domestic hot water system. The system is used year round, and in the spring and autumn seasons, the application is partially dependent on the climatic conditions during the year. The installed temperature sensors capture data with a sampling step of 20 s, as a result of which 10,124 synchronized temperature points were obtained from the outlet of the boiler, tank, and radiator, provided by the ThingSpeak cloud platform.
A multilayer artificial neural network with a Levenberg–Marquardt training algorithm was chosen as a predictive model. The network was adapted to the experimental data in order to predict the temperature change in the system. Due to a partial disconnection, some of the data was missing from the recording, especially at the beginning, due to the dynamic nature of the process. When comparing the experimental data with the output of the neural network, it can be seen that in the case of sharp fluctuations, the model cannot predict these changes with great accuracy.
On the other hand, in the case of smooth transients, the match is good. The values obtained for RMSE, MAE, and MAPE show a good match of the predictive model (ANN) with the real data after they are further processed. Despite the fastest method being chosen for training the neural network in MATLAB, and the appropriate network architecture being selected, the main problem is the quality of the connection when sending data.
At a later stage, an algorithm will be considered in which the data will be compressed and stored in the hardware part, and if there is a connection, the data will be sent to the platform. Another area in which work will be carried out involves extending the measurement period and implementing an artificial neural network in the microcontroller software for real-time forecasting.

Author Contributions

Conceptualization, N.K. and M.S.; methodology, N.K.; software, N.K.; validation, M.S.; formal analysis, M.S.; investigation, N.K.; resources, N.K.; data curation, N.K.; writing—original draft preparation, N.K.; writing—review and editing, M.S.; visualization, M.S.; supervision, N.K.; project administration, N.K.; funding acquisition, M.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by project “Robotic System with Artificial Intelligence Elements for the Management of Technological Objects and Processes in the Food Industry,” Contract No. 09/25-H, dated 23 July 2025, funded by the Science Fund of the University of Food Technology, Plovdiv, Bulgaria.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data supporting the findings of this study are available from the authors upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
IoTInternet of Things
ANNArtificial Neural Networks
DLDeep Learning
RFRandom Forest
HVACHeating Ventilation and Air Conditioning
CNNConvolutional Neural Networks

References

  1. Yang, T.K. Artificial Neural Networks (ANNs): A New Paradigm for Thermal Science and Engineering. J. Heat Transf. 2008, 130, 093001. [Google Scholar] [CrossRef] [Scilit]
  2. Kamble, L.V.; Pangavhane, D.R.; Singh, T.P. Heat Transfer Studies Using Artificial Neural Network—A Review. Int. Energy J. 2014, 14, 25–42. [Google Scholar]
  3. Salem, K.M.; Rey–Hernández, J.M.; Elgharib, A.O.; Rey–Martínez, F.J. Optimizing Energy Forecasting Using ANN and RF Models for HVAC and Heating Predictions. Appl. Sci. 2025, 15, 6806. [Google Scholar] [CrossRef] [Scilit]
  4. Ramli, N.M.; Abdullah, B. Neural Network Modeling of Heat Exchanger. IJSES 2019, 3, 10–15. [Google Scholar]
  5. Nguyen, H.V.T.; Nguyen, T.T.; Ji, X.; Do, T.L.K.; Guo, M. Using artificial neural networks (ANN) for modeling predicting haness change of wood during heat treatment. IOP Conf. Ser. Mater. Sci. Eng. 2018, 394, 032044. [Google Scholar] [CrossRef] [Scilit]
  6. Buj–Corral, I.; Sivatte–Adroer, M.; Rodero–de–Lamo, M.; Marco–Almagro, L. Selection of network parameters in direct ANN modeling of roughness obtained in FFF processes. Polymers 2025, 17, 120. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Essa, M.E.M.; El–Shafeey, A.M.; Omar, A.H.; Fathi, A.E.; Maref, A.S.A.E.; Lotfy, J.V.W.; El–Sayed, M.S. Reliable integration of neural network and internet of things for forecasting, controlling, and monitoring of experimental building management system. Sustainability 2023, 15, 2168. [Google Scholar] [CrossRef] [Scilit]
  8. Tan, C.K.; Ward, J.; Wilcox, S.J.; Payne, R. Artificial neural network modelling of the thermal performance of a compact heat exchanger. Appl. Therm. Eng. 2009, 29, 3609–3617. [Google Scholar] [CrossRef] [Scilit]
  9. Luo, C. Thermal energy storage thermal data processing for heating systems. Therm. Sci. 2023, 27, 1133–1140. [Google Scholar] [CrossRef] [Scilit]
  10. Odufuwa, O.Y.; Tartibu, L.K.; Kusakana, K.; Hohne, P.A.; Numbi, B.P. Application of artificial neural networks in predicting the performance of ice thermal energy storage systems. J. Energy Storage 2024, 95, 112547. [Google Scholar] [CrossRef] [Scilit]
  11. Alikhanov, J.; Georgieva, T.; Nedelcheva, E.; Moldazhanov, A.; Kulmakhambetova, A.; Zinchenko, D.; Nurtuleuov, A.; Shynybay, Z.; Daskalov, P. Deep learning-based identification of Kazakhstan apple varieties using pre–trained CNN models. AgriEngineering 2025, 7, 331. [Google Scholar] [CrossRef] [Scilit]
  12. Todorov, Y.; Terziyska, M.; Ahmed, S.; Petrov, M. Fuzzy-Neural Predictive Control Using Levenberg-Marquardt Optimization Approach. In 2013 IEEE INISTA; IEEE: New York, NY, USA, 2013; pp. 1–5. [Google Scholar]
  13. Damyanov, C. Non–Destructive Quality Recognition in Automatic Sorting Systems of Food Products, 2nd ed.; UFT Academic Publishing House: Plovdiv, Bulgaria, 2006. (In Bulgarian) [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.