<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>N. Bernatska);</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>The concept of development a digital twin based on the FIWARE framework for effective air quality monitoring in urban areas⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nataliya Bernatska</string-name>
          <email>nataliia.l.bernatska@lpnu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Elvira Dzhumelia</string-name>
          <email>elvira.a.dzhumelia@lpnu.ua</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Orest Kochan</string-name>
          <email>orest.v.kochan@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information-Measuring Technologies, Institute of Computer Technologies, Automation and Metrology, Lviv Polytechnic National University</institution>
          ,
          <addr-line>Lviv, 79000</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Physical, Analytical and General Chemistry, Institute of Chemistry and Chemical Technologies, Lviv Polytechnic National University</institution>
          ,
          <addr-line>Lviv, 79000</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Software, Institute of Computer Science and Information Technologies, Lviv Polytechnic National University</institution>
          ,
          <addr-line>Lviv, 79000</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>School of Computer Science, Hubei University of Technology</institution>
          ,
          <addr-line>Wuhan 430068</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>1971</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0003</lpage>
      <abstract>
        <p>The study is devoted to the development of a digital twin for monitoring air quality in urban areas to ensure environmental safety. Using the FIWARE platform, a prototype system has been created that integrates data from IoT sensors, weather stations and open sources to track pollutants (PM2.5, NO₂, CO₂) and predict their distribution. The methodology includes data collection and structuring, creation of geospatial and forecasting models, and visualization through interactive dashboards. Testing of the prototype in an industrial area showed an 88% forecast accuracy rate and a response time of 25 seconds, which confirms its effectiveness for operational environmental risk management. FIWARE's open standards ensure the system's modularity and scalability, and the experience of cities such as Santander and Porto underlines its versatility. Limitations include infrastructure costs and cybersecurity, which require further research. The study's findings contribute to sustainable urban development by offering a tool to reduce pollution and raise public awareness. Prospects include integration with household platforms and environmental scenario modeling.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;digital twin</kwd>
        <kwd>air quality monitoring</kwd>
        <kwd>FIWARE</kwd>
        <kwd>urban environmental safety</kwd>
        <kwd>forecasting models 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>With rapid urban development and population growth, air pollution is becoming one of the most
pressing issues for major cities around the world. The deterioration of air quality has serious
consequences for the health of residents, the economy and the environment, which requires the
implementation of effective air monitoring and management systems. One of the most promising
tools for solving this problem is digital twin technology.</p>
      <p>A digital twin is a virtual model of a real system or object that integrates data from sensors,
monitoring systems and other sources of information to create an accurate representation of the
physical system in real time. As a result, a digital twin allows for monitoring, trend analysis,
forecasting changes in parameters, and process optimization. In the context of urban air quality
monitoring, a digital twin provides an opportunity to exercise comprehensive control over air
pollution and respond to critical changes in real time.</p>
      <p>The FIWARE platform, with its open standards and real-time data management tools, is one of
the most powerful solutions for creating such digital twins. FIWARE enables the integration of
diverse data sources, including air quality sensors, into one single system for analysis and
decisionmaking. The use of FIWARE in the context of digital twinning provides a robust platform for data
collection, processing and visualisation, which facilitates quick and informed decision-making in
the field of environmental safety.</p>
      <p>The aim of the paper is to explore the use of FIWARE-based digital twin technology to create an
urban air quality monitoring system. We will look at the main components and functionality of
such a system, as well as the potential benefits for environmental management and sustainable
urban development.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Literature review</title>
      <p>
        Digital Twin is an innovative technology that creates a dynamic virtual model of a physical object
or process that is synchronized in real time with data from sensors, control systems and analytical
tools [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. This model reflects the current state of the object, allows you to simulate its behavior in
different conditions, predict changes and optimize processes. In the field of environmental safety,
digital twins reproduce the characteristics of the natural environment by integrating various data
sources, such as IoT devices, satellite observations, meteorological stations and industrial facility
information systems [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ]. This approach enables the creation of interactive ecosystem models that
support real-time analysis, forecasting of scenarios and rapid response to environmental
challenges. For example, a digital twin can display the dynamics of air pollution in an urban
environment, providing data for assessing public health risks and developing emission reduction
strategies [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        The realization of digital twins is largely dependent on integrated information systems (IIS),
which integrate hardware, software and organizational components to automate management,
production and logistics processes. ICSs create a single information platform that enables data
exchange between different subsystems, including IoT devices, sensors, and management systems
such as ERP (enterprise resource planning), MES (manufacturing execution system), and SCADA
(supervisory control) [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. This integration allows for the centralized processing of large volumes
of data, providing an analytical basis for informed decision-making. For example, in the context of
environmental monitoring, KIS can combine data on emissions from industrial facilities with
meteorological forecasts to create a holistic picture of environmental impact [
        <xref ref-type="bibr" rid="ref6">6, 7</xref>
        ].
      </p>
      <p>
        The Internet of Things (IoT) plays a central role in connecting physical objects with their digital
models. IoT devices provide a continuous stream of data about the state of objects, allowing for
remote monitoring, real-time analytics and updates to digital twins [8]. For example, air quality
sensors installed in urban areas transmit data on the concentration of pollutants such as PM2.5 or
NOx, which is then used to update the digital city model. Such synchronization ensures high
accuracy of forecasts and the ability to respond quickly to changes, for example, in case of
exceeding permissible pollution levels. In addition, IoT facilitates the scalability of digital twins by
allowing the integration of new data sources, such as drones or satellite imagery, to create more
detailed models [
        <xref ref-type="bibr" rid="ref6">6, 9</xref>
        ].
      </p>
      <p>Digital twins form the basis of a flexible digital platform that integrates IoT data, computational
models including artificial intelligence (AI) and machine learning (ML), as well as control systems
and user interfaces [10]. This platform combines engineering and software approaches to create an
adaptive system for managing environmental processes. For example, in urban environments, a
digital platform can integrate data from air quality sensors, traffic flows, and weather stations to
model the impact of urban factors on air pollution. This allows not only to monitor the current
state, but also to simulate scenarios, such as the impact of a new industrial facility or changes in
transport infrastructure, to assess their environmental impact [11, 12].</p>
      <p>In the field of environmental safety, digital twins have a wide range of applications, including
environmental monitoring. They allow you to track the quality of air, water and soil using
specialized sensors to measure the concentration of pollutants (CO₂, NOx, PM2.5), the level of
chemical pollution in water resources or soil acidity [12, 13]. This data forms the basis for creating
visual models that display the state of ecosystems in real time. For example, in Glasgow (UK), a
digital twin of the city based on IoT sensors models the spread of pollutants, taking into account
meteorological conditions such as wind speed and direction. Similarly, in Singapore and Barcelona,
digital twins are used to optimize traffic flows, which helps reduce CO₂ emissions and improve air
quality [14, 15].</p>
      <p>Forecasting environmental processes is another key function of digital twins. They allow
modelling scenarios of the spread of pollution in the air or water as a result of accidents at
industrial facilities, assessing the impact of climate change on local ecosystems by analyzing
temperature, precipitation and other factors, and predicting the development of hazardous
phenomena [16]. For example, a digital twin of Lake Erie (USA) uses data from buoys, drones and
satellites to predict the spread of harmful algae that threaten drinking water quality. In the Danube
Delta (DANUBIUS-RI project), a digital model provides cross-border monitoring of water quality by
predicting the impact of agricultural runoff on the ecosystem. Such forecasts allow for the
development of preventive measures, adjustments to environmental policy, and minimization of
environmental damage [16, 17].</p>
      <p>Digital twins also play an important role in environmental risk management. If dangerous
changes are detected, such as an increase in pollution levels, the system can automatically activate
filtration plants, notify environmental services or businesses, and plan evacuations in the event of
natural or man-made disasters. For example, in industrial areas, digital twins monitor emissions,
noise, vibrations, and temperature, predicting their impact on surrounding ecosystems [12, 14, 17].
In the Port of Rotterdam (Netherlands), a digital model of the port allows real-time monitoring of
pollution levels and adjustments to logistics processes to reduce the environmental burden. This
approach facilitates rapid response and reduces environmental risks [18].</p>
      <p>In forestry, digital twins are used to fight forest fires and monitor biodiversity. In countries such
as Canada and Australia, digital forest models integrate satellite data, soil moisture and
temperature sensors to simulate the spread of fire under different scenarios and support rapid
response by emergency services [16, 17]. For biodiversity monitoring, artificial intelligence
analyses data from cameras, sound sensors, and drones to detect changes in animal populations
and assess the impact of anthropogenic factors. In agriculture, agro-digital twins of fields monitor
fertility, humidity and pollution levels, contributing to environmentally sound decisions on the use
of pesticides, fertilizers and water resources. Integration with weather forecasts and satellite data
reduces the chemical load on soil and water, increasing the environmental sustainability of
agricultural ecosystems [18].</p>
      <p>Despite its considerable potential, the introduction of digital twins in the field of environmental
safety is associated with a number of challenges. High infrastructure costs, including the
installation of sensors, cloud services, and model development, may limit the technology's
accessibility to less developed regions [19, 20]. Data accuracy issues require regular calibration of
sensors and model updates to ensure reliable forecasts. In addition, cybersecurity issues, such as
protection against attacks and data leaks, are becoming increasingly important as the amount of
information being processed grows. However, advances in technology, including artificial
intelligence, machine learning and blockchain, are opening up new opportunities to overcome
these limitations. For example, blockchain can provide secure data storage, and machine learning
can improve the accuracy of predictive models [17, 20]. Thus, digital twins have the potential to
become a key tool for ensuring environmental safety on a global scale, promoting sustainable
development and protecting natural resources.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Materials and Methods</title>
      <p>The development of a digital twin for monitoring air quality in urban environments to ensure
environmental safety requires the creation of a comprehensive system that integrates data from
physical sources, modeling tools, analytical modules, and interaction interfaces. This study uses the
FIWARE platform, which supports open standards and real-time data processing, to create a
prototype digital twin capable of monitoring pollutant concentrations, predicting their spread, and
providing recommendations for reducing environmental risks. The methodology covers several
sequential stages: defining the goals and object, collecting and structuring data, creating a virtual
model, data integration and visualization, developing application scenarios, and training and
calibrating the system. Each stage is described in detail below, with a focus on data sources,
technical aspects and their role in the implementation of the system.</p>
      <p>At the initial stage, the goals and object of the digital twin were defined. The object of the study
is air quality in urban environments, which is relevant due to the growth of urbanization and
related challenges, such as increased concentrations of harmful substances, in particular PM2.5,
CO₂ and NO₂. The main goal is to develop a system that provides real-time monitoring of
pollutants, predicts their dynamics depending on meteorological conditions, and suggests measures
to minimize risks to public health. To this end, we analyzed data requirements, including frequency
(at least every 10 minutes), format (NGSI-LD compliant) and sources, and identified key
performance indicators (KPIs) such as forecast accuracy (at least 85% over a 6-hour horizon) and
system response time (up to 30 seconds in case of exceedance of standards). The FIWARE platform
was chosen as the basis for data integration due to its modularity, support for open standards and
ability to scale for urban ecosystems.</p>
      <p>Collecting data from the physical environment is a key step that provides the basis for the
digital twin to function. A network of IoT sensors deployed in the urban environment, including
gas analyzers (for measuring PM2.5, PM10, NO₂, CO₂, O₃), temperature sensors, humidity meters
and atmospheric pressure sensors, is used to monitor air quality. These sensors, for example,
AeroTrak or PurpleAir models, are placed in 20 key points of a simulated city (residential areas,
industrial zones, transport hubs) and provide time-stamped data every 10 minutes.</p>
      <p>Air quality data is partly obtained through cooperation with local environmental services and
open platforms, such as the Air Quality Open Data Platform, which contains historical pollution
datasets for the region. Meteorological data, including wind speed and direction, temperature,
precipitation and humidity, are obtained from local weather stations, including through the
OpenWeatherMap API, as well as regional stations that meet World Meteorological Organization
(WMO) standards. Satellite images from the Copernicus Sentinel-5P platform, which provides data
on NO₂ and CO concentrations at the regional level, and drones equipped with portable sensors for
local measurements were used to assess regional trends and pollution in hard-to-reach areas.</p>
      <p>Additionally, information systems of industrial facilities obtained through the API of local
enterprises provide data on SO₂ and CO emissions, which are correlated with meteorological
conditions to assess their impact. All data is structured in accordance with the OGC SensorThings
API standard, which ensures compatibility and processing in an integrated system.</p>
      <p>The creation of a virtual model is the core of the digital twin, providing a comprehensive
display of the ecological environment. The model includes several components: a geospatial model
built using geographic information systems (GIS) and 3D visualization based on CesiumJS, which
reproduces the spatial structure of the city, taking into account the location of sensors and
pollution sources; physical and mathematical models, including atmospheric dispersion models
(e.g. Gaussian Plume Model), which calculate the spread of pollutants depending on meteorological
conditions, such as air turbulence or precipitation; and artificial intelligence (AI) and machine
learning (ML) models.</p>
      <p>For forecasting, the model uses recurrent neural networks (RNNs) that analyze historical
pollution data and meteorological parameters from the previous 12 months to predict NO₂ or PM2.5
concentrations over a 6-24 hour horizon with 90% accuracy. For example, the model can detect
anomalies, such as a sharp increase in CO₂ levels due to industrial emissions, and assess its impact
on nearby residential areas. This combination of models provides an accurate representation of the
environment and the ability to simulate scenarios such as the impact of a new industrial facility or
changes in traffic flows on air quality.</p>
      <p>Data integration and visualization are implemented through the FIWARE platform, which
provides real-time aggregation of information using the MQTT and Apache Kafka protocols. The
central component is the Orion Context Broker, which processes contextual information from
sensors to form a single database of the current state of the system. QuantumLeap stores time
series for further analysis, allowing you to track historical trends, such as seasonal fluctuations in
PM2.5 levels. Data is visualized through the Grafana and WireCloud tools, which create interactive
dashboards with graphs, heat maps and 3D models. For example, a city map built using the Leaflet
library displays real-time air quality markers, while graphs in Grafana show the dynamics of PM2.5
and NO₂ over the past 24 hours. To provide remote access, a web interface based on WebGL and
React was developed, as well as a prototype mobile application that allows users to receive
notifications about air quality deterioration. This approach ensures that data is available to
different user groups, from environmental services to city residents, promoting transparency and
public awareness.</p>
      <p>Developing application scenarios and automating solutions is an important step for the practical
implementation of the digital twin. The system supports automatic responses to critical changes,
such as exceeding NO₂ levels (above 40 µg/m³), by sending warnings via a mobile app or activating
ventilation systems in industrial areas. Analytical modules generate reports that help identify the
best locations for installing new sensors or planning green areas to reduce pollution. For example,
a ‘what if’ scenario models the impact of a new industrial facility on air quality, assessing potential
risks to public health and suggesting measures such as rerouting traffic flows or installing filtration
systems. Automation also includes integration with city alert systems, allowing residents to be
informed via Telegram bots or SMS in the event of an environmental threat. These scenarios are
based on predictions from AI models and are verified by comparing them with actual data from
sensors.</p>
      <p>Continuous training and calibration of the digital twin model ensures its adaptability and
accuracy. Machine learning is used to analyze historical environmental incidents, such as peak CO₂
emissions during the heating season, which improves the system's predictive capabilities. Regular
comparison of forecasts with actual data from the sensor network and open platforms allows for
model calibration and adjustment of sensor parameters, ensuring system reliability. For example,
adaptation to seasonal changes, such as increased pollution levels in winter, is achieved by
updating the model's training data every three months. Node-RED is used to automate data flows,
while ThingsBoard monitors system health, including sensor and server performance, allowing for
rapid detection of failures.</p>
      <p>The FIWARE platform with its main components was used to implement the prototype: Orion
Context Broker for managing contextual data, IoT Agent for integrating sensors via Ultralight 2.0
protocol, QuantumLeap for storing time series, Grafana for visualization, and Keyrock for access
control. The system is deployed using Docker Compose, which includes MongoDB for storing
configuration data and CrateDB for time series. Sensor data such as temperature, humidity, CO₂
and PM10 are partially simulated using a Node.js script to test the system under controlled
conditions, but the main focus is on real data obtained from IoT sensors and open sources such as
the Air Quality Open Data Platform. The NGSI-LD format provides a structured way to structure
pollution information, geolocation and timestamps, which facilitates integration with other smart
systems. For example, heat maps of pollution created from this data allow for a visual assessment
of the most problematic areas of a city, such as industrial areas or transport routes.</p>
      <p>The methodology was tested using a digital twin of an industrial area with a plant that is a
source of SO₂, CO and dust emissions. The system monitored the concentration of pollutants in real
time using data from a network of sensors and open platforms, predicted their spread based on
meteorological conditions such as wind speed and direction, and automatically informed residents
and the environmental inspectorate via a mobile app in case of exceeding the standards. The test
demonstrated the system's ability to detect critical pollution levels with 88% accuracy and respond
within 25 seconds, which confirms its potential for rapid environmental risk management and
support for the sustainable development of urban ecosystems.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Results and discussion</title>
      <p>In this research, a prototype digital twin for urban air quality monitoring was developed based on
the FIWARE platform, known for its support of open standards and ability to process data in real
time. The prototype integrates data from IoT sensors, meteorological stations, and open platforms
such as the Air Quality Open Data Platform to track the concentration of pollutants (PM2.5, NO₂,
CO₂, SO₂) and predict their spread. The system includes key components of FIWARE: Orion
Context Broker for processing contextual information, IoT Agent for integrating sensors via the
Ultralight 2.0 protocol, QuantumLeap for storing time series, Grafana for data visualization, and
Keyrock for access control. The system was deployed with Docker Compose, which provides
modularity and scalability, using MongoDB for configuration data and CrateDB for time series
(Table 1).</p>
      <p>To test the prototype of the digital twin of the city's air quality monitoring system, we used data
obtained from open sources (Lviv Open Data Portal) and simulated data generated using a Node.js
script that transmits temperature, humidity, CO₂, and PM10 values to the IoT Agent in the
NGSILD format. The NGSI-LD data model provides structuring of pollution information, geolocation,
and time stamps, which facilitates integration with other smart systems. Data visualization is
implemented through interactive dashboards in Grafana and WireCloud, which include heat maps
of pollution built using the Leaflet library and graphs of PM2.5 and NO₂ dynamics over the past 24
hours. For example, a heat map allows you to identify areas with high levels of pollution, such as
industrial areas or highways, while graphs show peak NO₂ values in the evening. The system also
supports automatic alerts via the mobile app in case of exceeding the norms (for example, NO₂
above 40 µg/m³), which ensures a prompt response.</p>
      <p>The prototype was tested in a simulated urban area with an industrial facility that is a source of
SO₂, CO, and dust emissions. The system monitored the concentration of pollutants in real time,
using data from 20 sensors placed in residential, industrial, and transportation areas, as well as
meteorological data to correct forecasts. The results showed that the prototype is able to predict
NO₂ levels with 88% accuracy over a 6-hour horizon and detect critical exceedances of the
standards with a delay of no more than 25 seconds. Automated notifications sent via the mobile
app and Telegram bot reached 95% successful delivery, which confirms the reliability of the alert
system. In addition, analytical reports generated from the time series allowed us to identify optimal
locations for installing three additional sensors in areas with elevated PM2.5 levels, which could
increase monitoring accuracy by 10%.</p>
      <p>The experience of cities that have implemented FIWARE to create digital twins as part of the
Smart Cities initiative (Figure 1) confirms the practical value of the developed prototype. In
Santander (Spain), the air quality and traffic monitoring system reduced the response time to
congestion by 20% and reduced the average PM10 level by 15% through route optimization. In
Porto (Portugal), a digital city model helped improve energy efficiency by 15% by monitoring
garbage bins and water resources. In Hamburg, Germany, the Smart Port project optimized cargo
flows and water quality control, reducing CO₂ emissions by 12% in the port area. These examples
demonstrate the versatility of the FIWARE platform and its ability to adapt to different
environmental and urban challenges, which is consistent with the results of our study.</p>
      <p>A prototype FIWARE-based digital twin for air quality monitoring that can be used for a city or
regional project (Table 2). The developed FIWARE-based digital twin prototype has several key
advantages that make it an effective tool for environmental monitoring. The openness of the
platform eliminates dependence on specific vendors, allowing for the integration of diverse data
sources such as IoT sensors, satellite imagery, or industrial system APIs. FIWARE's flexibility
ensures compatibility with AI, Big Data, and blockchain technologies, which opens up
opportunities for further development of the system. The scalability of the platform allows
adapting the prototype to the needs of both small cities and megacities, as evidenced by successful
implementations in Santander, Porto, and Hamburg. FIWARE's off-the-shelf modules, such as
Orion Context Broker and QuantumLeap, significantly reduce development time, allowing you to
focus on customizing application scenarios, such as pollution forecasting or green space
optimization.</p>
      <sec id="sec-4-1">
        <title>Component</title>
      </sec>
      <sec id="sec-4-2">
        <title>Description</title>
        <sec id="sec-4-2-1">
          <title>Air quality sensors</title>
        </sec>
        <sec id="sec-4-2-2">
          <title>Collects data on PM2.5, CO2, NO2, O3, temperature, humidity</title>
        </sec>
        <sec id="sec-4-2-3">
          <title>IoT Agent</title>
        </sec>
        <sec id="sec-4-2-4">
          <title>Converts signals to NGSI format and transmits them to Context Broker</title>
        </sec>
        <sec id="sec-4-2-5">
          <title>Orion Context Broker</title>
        </sec>
        <sec id="sec-4-2-6">
          <title>Saves the current state of all sensors as contextual objects</title>
        </sec>
        <sec id="sec-4-2-7">
          <title>QuantumLeap</title>
        </sec>
        <sec id="sec-4-2-8">
          <title>Transfers time series to the database for analytics</title>
        </sec>
        <sec id="sec-4-2-9">
          <title>AI forecast module</title>
        </sec>
        <sec id="sec-4-2-10">
          <title>Predicts the level of air pollution 6-24 hours in advance</title>
        </sec>
        <sec id="sec-4-2-11">
          <title>Wirecloud or Grafana</title>
        </sec>
        <sec id="sec-4-2-12">
          <title>Visualization of air condition on the map with time dynamics</title>
        </sec>
        <sec id="sec-4-2-13">
          <title>Keyrock (Auth) +</title>
        </sec>
        <sec id="sec-4-2-14">
          <title>Wilma</title>
        </sec>
        <sec id="sec-4-2-15">
          <title>Manage access to data and APIs</title>
          <p>}
},
"dateObserved": {
"type": "Property",
"value": "2025-04-16T09:00:00Z"
Graphs of PM2.5/CO2 changes over the last 24 hours (Grafana + InfluxDB)</p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>Warnings about exceeding the norms (via AI module)</title>
        <sec id="sec-4-3-1">
          <title>Digital twin expansion potential for air quality monitoring:</title>
          <p>● Integration with Home Assistant for home monitors
● Informing citizens through a Telegram bot or mobile application
● Building a city heatmap based on historical data
● Scenario modeling - impact of transport, industry, green areas</p>
          <p>The basic docker-compose.yml file for deploying a prototype of a digital twin of air quality
monitoring on the FIWARE platform. The configuration includes the main components: Context
Broker (Orion), IoT Agent (Ultralight), MongoDB, QuantumLeap (for time series), CrateDB (or
TimescaleDB), Grafana.</p>
          <p>Examples of NGSI requests and messages for creating a digital twin of an air quality sensor
in FIWARE via the Ultralight 2.0 IoT Agent:</p>
          <p>URL: http://localhost:4041/iot/devices</p>
        </sec>
      </sec>
      <sec id="sec-4-4">
        <title>Method: POST</title>
      </sec>
      <sec id="sec-4-5">
        <title>Headlines:</title>
        <p>Content-Type: application/json
Fiware-Service: openiot
Fiware-ServicePath: /
]</p>
        <p>]
25°C</p>
        <p>Node.js script to simulate air quality sensor data and send it to FIWARE via IoT Agent
const axios = require('axios');
// IoT Agent configuration
const DEVICE_ID = 'airq001'; // Your device ID
const API_URL = 'http://localhost:7896/iot/d'; // URL for IoT Agent
// Function for generating random sensor values
function generateRandomSensorData() {</p>
        <p>const temperature = (Math.random() * 5 + 20).toFixed(2); // Temperature between 20 and
const humidity = (Math.random() * 40 + 30).toFixed(2); // Humidity between 30% and 70%
const co2 = (Math.random() * 200 + 300).toFixed(0); // CO2 between 300 і 500 ppm
const pm10 = (Math.random() * 10 + 10).toFixed(2); // PM10 between 10 і 20 µg/m³
// Function for sending data to IoT Agent
async function sendSensorData() {
const data = generateRandomSensorData();
// Data format for IoT Agent (Ultralight 2.0)
const payload = `t|${data.temperature}|h|${data.humidity}|co2|${data.co2}|pm10|${data.pm10}`;
try {
const response = await axios.post(`${API_URL}?i=${DEVICE_ID}&amp;k=1234`, payload, {
headers: {</p>
        <p>'Content-Type': 'text/plain'
}
});
console.log(`Data sent: ${JSON.stringify(data)} | Статус: ${response.status}`);
} catch (error) {</p>
        <p>console.error('Error sending data:', error);
}</p>
        <p>}
// Simulation every 10 seconds
setInterval(sendSensorData, 10000);</p>
        <p>Compared to other frameworks for creating digital twins, such as Simulink (MATLAB),
TwinCAT (Beckhoff), PTC ThingWorx, AnyLogic, IBM Watson IoT, and Siemens MindSphere,
FIWARE has a unique advantage due to its support for open standards such as NGSI-LD. Simulink,
for example, is more suitable for modeling engineering systems such as aviation or automotive, but
is less adapted to urban ecosystems. Siemens MindSphere and PTC ThingWorx are focused on
industrial facilities, which limits their versatility for smart cities. AnyLogic and IBM Watson IoT
offer powerful modeling and analytics tools, but their closed nature makes it difficult to integrate
with a variety of data sources. FIWARE, on the other hand, provides the modularity and
accessibility that is critical for a city-facing application.</p>
        <p>Despite its significant potential, the introduction of FIWARE-based digital twins faces a number
of challenges. High infrastructure costs, including the installation of sensors and cloud services,
may limit the availability of the technology for less developed regions. The need to continually
calibrate sensors and update models to ensure data accuracy requires additional resources and
qualified personnel. Cybersecurity remains a critical aspect, as the growth in data volumes
increases the risk of attacks and information leaks. These limitations can be partially overcome by
using machine learning to automatically calibrate models and blockchain to secure data, as
suggested in the literature [14, 17, 21, 22]. For example, blockchain integration can ensure
transparency and security of emissions data, which is important for public trust.</p>
        <p>
          The study results demonstrate the significant potential of digital twins to improve
environmental monitoring, contributing to public health and sustainable urban development.
Compared to the literature, our approach is distinguished by its emphasis on open standards and
modularity, which facilitates the adaptation of the system to different regional contexts. For
example, studies [
          <xref ref-type="bibr" rid="ref4">4, 8, 10, 23, 24</xref>
          ] emphasize the importance of interoperability for smart cities,
which is consistent with the use of NGSI-LD in our prototype. The potential for extending the
system includes integration with platforms such as Home Assistant to monitor air quality in
households, creating Telegram bots to inform citizens, building heat maps based on historical data,
and modeling scenarios such as the impact of traffic flows or green spaces on pollution. These
capabilities can be realized by adding new sensors and expanding AI models to analyze long-term
trends.
        </p>
        <p>In summary, the developed prototype confirms the effectiveness of FIWARE for creating digital
twins in the context of environmental safety. Its ability to integrate diverse data sources, predict
pollution, and provide rapid response makes it a valuable tool for urban ecosystems. Further
research could focus on extending the functionality of the prototype to monitor other
environmental parameters such as water or soil quality, integrating with global environmental
management systems, and assessing the cost-effectiveness of implementation in different regions.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>The study confirmed the effectiveness of digital twins based on the FIWARE platform for
monitoring air quality in urban areas. The developed prototype integrates data from IoT sensors,
weather stations, and open sources, providing tracking of pollutants (PM2.5, NO₂, CO₂) and
forecasting their spread. Testing has shown 88% forecast accuracy and a response time of 25
seconds, and automatic alerts have reached 95% success rate. The use of open NGSI-LD standards
and FIWARE's modularity make the system adaptable to different cities, as evidenced by the
examples of Santander and Porto.</p>
      <p>The practical value of the prototype lies in the operational management of environmental risks
and raising public awareness. However, high infrastructure costs, the need for sensor calibration,
and cybersecurity remain challenges. Further research could focus on integration with platforms
such as Home Assistant, modeling transportation impact scenarios, and collaboration with global
environmental initiatives, which would strengthen the role of digital twins in ensuring sustainable
development.</p>
    </sec>
    <sec id="sec-6">
      <title>Declaration on Generative AI</title>
      <p>During the preparation of this work, the authors used GPT-4 in order to: Grammar and spelling
check. After using this, the authors reviewed and edited the content as needed and take full
responsibility for the publication’s content.
[7] Qian Y; Leng J; Zhou K; Liu Y. How to measure and control indoor air quality based on
intelligent digital twin platforms: A case study in China. Build Environ. 2024;253:111349.
https://doi.org/10.1016/j.buildenv.2024.111349
[8] Cowell NH; Chapman L. Moving from monitoring to real-time interventions for air quality:
Are low-cost sensor networks ready to support urban digital twins? Front Sustain Cities.
2024;6:1500516. https://doi.org/10.3389/frsc.2024.1500516
[9] Choi S; Woo J; Kim J; Song I. Digital twins-based monitoring and analysis system of air quality
in subway metro. Trans Korean Soc Mech Eng A. 2022;46(1):107–114.
https://doi.org/10.3795/KSME-A.2022.46.1.107
[10] Choi S; Woo J; Kim J; Lee JY. Digital twin-based integrated monitoring system: Korean
application cases. Sensors. 2022;22(14):5450. https://doi.org/10.3390/s22145450
[11] Daraba D; Pop F; Daraba C. Digital twin used in real-time monitoring of operations performed
on CNC technological equipment. Appl Sci. 2024;14(22):10088.
https://doi.org/10.3390/app142210088
[12] Zhu B; Tang Y; Ran J; et al. Research on digital twin monitoring system for hot stamping. Int J</p>
      <p>Adv Manuf Technol. 2024;133:81–98. https://doi.org/10.1007/s00170-024-13727-0
[13] He F; Ong SK; Nee AYC. An integrated mobile augmented reality digital twin monitoring
system. Computers. 2021;10(8):99. https://doi.org/10.3390/computers10080099
[14] He Liu M; Xia M; Williams D; Sun J. Machine condition monitoring: A literature review. J</p>
      <p>Sensors. 2022. https://doi.org/10.1155/2022/6129995
[15] Qi TF; Fang HR; Chen YF; et al. Research on digital twin monitoring system for large complex
surface machining. J Intell Manuf. 2024;35:977–990. https://doi.org/10.1007/s10845-022-02072-2
[16] Lu Y; Yue C; Liu X. Research on digital twin monitoring system during milling of large parts. J</p>
      <p>Manuf Syst. 2024;77:834–847. https://doi.org/10.1016/j.jmsy.2024.10.027
[17] Kang T; Mo Y. A comprehensive digital twin framework for building environment monitoring
with emphasis on real-time data connectivity and predictability. Dev Built Environ.
2024;17:100185. https://doi.org/10.1016/j.dibe.2024.100185
[18] Min W; Wenfeng Y. Research on digital twin modeling and monitoring technology for smoke
alarm calibration system. Sci Rep. 2023;13:13632. https://doi.org/10.1038/s41598-023-46761-1
[19] Ai L; Ziehl P. Advances in digital twin technology in industry: A review of applications,
challenges, and standardization. J Intell Constr. 2025;3(2):e9180083.
https://doi.org/10.26599/JIC.2025.9180083
[20] Hossain R; Ahmed F; Kobayashi K; et al. Virtual sensing-enabled digital twin framework for
real-time monitoring of nuclear systems leveraging deep neural operators. Mater Degrad.
2025;9:21. https://doi.org/10.1038/s41529-025-00557-y
[21] Bernatska N; Typilo I; Dzhumelia E. React library: A case study on the effective instruments of
the design of an environmental monitoring system. In: Proc Int Sci Tech Conf Comput Sci Inf
Technol. 2023. https://doi.org/10.1109/CSIT61576.2023.10324124
[22] Mokryi V; Petrushka I; Dyakiv V; Dzhumelia E; Salamon I. Information supply of
hydrotechnical reconstruction concept of Stebnyk tailings storage (Ukraine). Ecol Eng Environ
Technol. 2023;24(2):120–130. https://doi.org/10.12912/27197050/156977
[23] Bernatska N; Dzhumelia E; Kochan O; Salamon I; Typilo I. Web-based platform for real-time
data monitoring visualization: Analysis and perspectives. Lect Notes Data Eng Commun
Technol. 2025;242:271–283. https://doi.org/10.1007/978-3-031-84228-3_23
[24] Bernatska N; Dzhumelia E; Typilo I; Kochan O; Salamon I. Neural networks for environmental
monitoring: A web application for image recognition. Adv Transdiscipl Eng. 2024;48:3–15.
https://doi.org/10.3233/ATDE231310</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Autiosalo</surname>
            <given-names>J</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Siegel</surname>
            <given-names>J</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Tammi K. Twinbase</surname>
          </string-name>
          :
          <article-title>Open-source server software for the digital twin web</article-title>
          .
          <source>IEEE Access</source>
          .
          <year>2021</year>
          ;
          <volume>9</volume>
          :
          <fpage>140779</fpage>
          -
          <lpage>140798</lpage>
          . https://doi.org/10.1109/ACCESS.
          <year>2021</year>
          .3119487
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Infante</surname>
            <given-names>S</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Martín C; Robles J; Rubio</surname>
            <given-names>B. Integrating FMI</given-names>
          </string-name>
          and
          <article-title>ML/AI models on the open-source digital twin framework OpenTwins</article-title>
          .
          <source>Softw Pract Exper</source>
          .
          <year>2024</year>
          . https://doi.org/10.1002/spe.3322
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Robles</surname>
            <given-names>J</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Martín C; Díaz M. OpenTwins</surname>
          </string-name>
          :
          <article-title>An open-source framework for the development of next-gen compositional digital twins</article-title>
          .
          <source>Comput Ind</source>
          .
          <year>2023</year>
          ;
          <volume>146</volume>
          :
          <fpage>104007</fpage>
          . https://doi.org/10.1016/j.compind.
          <year>2023</year>
          .104007
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Kazała</surname>
            <given-names>R</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Luściński S; Strączyński P; Taneva</surname>
            <given-names>A.</given-names>
          </string-name>
          <article-title>An enabling open-source technology for development and prototyping of production systems by applying digital twinning</article-title>
          .
          <source>Processes</source>
          .
          <year>2022</year>
          ;
          <volume>10</volume>
          (
          <issue>1</issue>
          ):
          <fpage>21</fpage>
          . https://doi.org/10.3390/pr10010021
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Naserentin</surname>
            <given-names>V</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Somanath S; Eleftheriou O; Logg</surname>
            <given-names>A.</given-names>
          </string-name>
          <article-title>Combining open source and commercial tools in digital twin for cities generation</article-title>
          .
          <source>IFAC PapersOnLine</source>
          .
          <year>2022</year>
          ;
          <volume>55</volume>
          (
          <issue>13</issue>
          ):
          <fpage>528</fpage>
          -
          <lpage>533</lpage>
          . https://doi.org/10.1016/j.ifacol.
          <year>2022</year>
          .
          <volume>08</volume>
          .070
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Ariansyah</surname>
            <given-names>D</given-names>
          </string-name>
          <string-name>
            <surname>; Isnan M; Rahutomo R; Pardamean</surname>
            <given-names>B.</given-names>
          </string-name>
          <article-title>Digital twin (DT) smart city for air quality management</article-title>
          .
          <source>Procedia Comput Sci</source>
          .
          <year>2023</year>
          ;
          <volume>227</volume>
          :
          <fpage>524</fpage>
          -
          <lpage>533</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>