<!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 />
    <article-meta>
      <title-group>
        <article-title>Improvement of the electronic circuit for the breathing simulator</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nurzhan</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Duzbayev</string-name>
          <email>n.duzbayev@iitu.edu.kz</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhandaulet</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Musilimov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kozin</string-name>
          <email>l.kozina@iitu.edu.kz</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manat</string-name>
          <email>manattuyenbayev@gmail.com</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>International Information Technology University</institution>
          ,
          <addr-line>34/1 Manas St., Almaty, 050040</addr-line>
          ,
          <country country="KZ">Kazakhstan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Due to the recent COVID-19 pandemic, a large number of people are currently still struggling with the effects of the virus on the body. The human respiratory system has been particularly negatively affected. In a number of methods used for the rehabilitation of such patients, doctors recommend breathing exercises. The use of IoT technologies in medicine improves the efficiency of processes and allows achieving better results. The article provides an overview of successful examples of IoMT (Internet of Medical Things) projects using biofeedback, including for working with the respiratory system. The article is devoted to the transformation of the scheme for the project “Development of a software and hardware complex for monitoring and correcting respiratory functions based on multimodule technologies”, the purpose of which is to develop a modern breathing simulator, and describes in detail the changes made. As a result, an updated project scheme is presented.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;IoMT</kwd>
        <kwd>breathing simulator</kwd>
        <kwd>biofeedback</kwd>
        <kwd>Arduino Nano</kwd>
        <kwd>sensors</kwd>
        <kwd>PCA9685</kwd>
        <kwd>CCS811</kwd>
        <kwd>MAX301021</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Even though the COVID-19 pandemic has officially ended, many people are still suffering from the
consequences of the virus. The impact of the virus on various body systems is discussed in this study
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. One of the body systems most affected by the virus is the human respiratory system. For example,
this research [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] notes that the overall prevalence of post-COVID breathlessness is 26% and more. In
addition, the deteriorating environmental situation that many large cities are currently facing also
negatively affects the condition of the human respiratory system and aggravates the course of
associated diseases. This aspect is discussed in detail in this study [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Taking into account all of the
above, it is obvious that the medical community is faced with the task of restoring the health of such
patients. In particular, breathing exercises demonstrate effectiveness in improving the condition of
patients [4].
      </p>
      <p>Various information technologies are becoming increasingly used in medicine. For example, the
use of IoT technologies to solve medical problems has even received a special term “IoMT” (Internet
of Medical Things). The potential of this direction is huge, which is proved by the interest of the
scientific community expressed in the number and quality of scientific publications on this topic [5].
Different studies reflect positive examples of IoMT projects [6, 7]. A significant advantage of using
IoT technologies is the opportunity to receive biofeedback. The obtained data and their subsequent
analysis further expand the possibilities and positive effect of the technologies implementation. For
example, a number of studies have proposed solutions for detecting diseases based on data obtained
from monitoring the functioning of the respiratory system, such as observations of coughing,
breathing, sneezing, speech behavior, and others, and the subsequent application of ML algorithms
[8, 9, 10, 11], as well as for advanced monitoring of patients' conditions [12].</p>
      <p>Within the framework of the project "Development of a software and hardware complex for
monitoring and correcting respiratory functions based on multimodule technologies" a breathing
simulator is being developed, including real-time monitoring of the patient's body parameters and
wireless transmission of the received data to the doctor's device, which is designed to provide full
control over the training process and thus improve the final results. Previously, the article [13]
covered the development of the electronic circuit for this project, however during the work on the
project the circuit was significantly improved, which in turn allows improving the rehabilitation
process. This article provides a detailed description of the changes made during the improvement
process and an explanation of the reasons for the need for these changes. As a result, the new and
improved scheme is presented.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Breathing simulator scheme improvement</title>
      <p>An important aspect of any device is its improvement. This can involve addressing various factors
such as design, internal structure, and enhancement of existing functions. As current article will
discuss the reasons and methods for improving the circuit design of a breathing device, to achieve
this, a block diagram (Figure 1), which illustrates the connection system between the elements of the
breathing device's circuit, should be examined.</p>
      <p>The control element manages the sensors through specific communication protocols, sends
control signals to set the movement and positions of servo drivers, and using wireless
communication, sends and receives commands from the user. To begin the analysis, the operating
algorithm of this system should be considered (Figure 2).</p>
      <p>When power is supplied, it's necessary to check if all components are functioning. For example,
they may start to light up. If not, it’s important to inspect the components themselves, as well as their
connections. If they are working, the main tasks of the circuit can proceed. When data is transmitted,
it may happen that the data isn’t being sent. In that case, the software should be checked; if the data is
being sent, the user might send a command to change the position of the servo driver. If all blocks are
working correctly, the program should execute successfully. Otherwise, both the hardware and
software should be inspected.</p>
      <p>Now it is necessary to break down how these functions are implemented in the first circuit, review
the test results, analyze them, and improve them if possible. Initially the block diagram of the first
version of the project should be examined (Figure 3). It includes several functional blocks that can be
improved by testing them and analyzing their role and tasks.</p>
      <sec id="sec-2-1">
        <title>2.1. Arduino NANO</title>
        <p>In the block diagram in the Figure 3, the main control element is the Raspberry Pi Zero. This is a
single-board computer based on the Linux system that can perform large calculations. Raspberry Pi
Zero has a large number of inputs and outputs, which makes it a fix for complex projects. It has huge
capabilities, an external processor, several ports such as USB, miniHDMI. Huge resources, computing
power, as well as powerful support for the Linux system, were used little during testing. Having
analyzed the role of Raspberry Pi Zero, it was concluded that the task of controlling element includes:
1.
2.
3.</p>
        <sec id="sec-2-1-1">
          <title>Receiving and processing information from sensors.</title>
          <p>Sending information to the software developed for this study.</p>
          <p>Receiving commands from the servo drive control application that the doctor will send.</p>
          <p>It turns out that for the complete operation of the control unit, it’s needed to work in real time and
work with the periphery. All calculations will be done in software. Also, when working with
Raspberry Pi Zero, it turned out that the energy consumption does not allow long-term operation on
batteries for mobile devices, which is a breathing simulator. Microcontrollers are great for solving
these problems. There are several types of microcontrollers such as STM32, ESP32, ESP8266,
Arduino. Since it was decided to make this unit much simpler, STM32 is not suitable, due to the
complexity of programming on it. ESP32 is known for having built-in Wi-Fi and Bluetooth in the
boards, but for research there is no need for a network connection, and the huge energy consumption
also interferes. The ESP8266 is the same. Arduino remains, among which there is an Arduino Nano
microcontroller, which provides everything necessary for this study.</p>
          <p>Arduino Nano (Figure 4) is a microcontroller based on ATmega328, which was developed for
automation tasks. It works in the Arduino IDE programming environment. There are many libraries
for working with various sensors, released by the developers of these sensors themselves.</p>
          <p>Table 1 provides a comparative analysis of the characteristics of Raspberry Pi Zero and Arduino
Nano.</p>
          <p>Comparing these two elements, the following conclusion was reached. Arduino Nano is more
suitable for solving simple tasks and tasks that require real-time operation, such as working with
sensors. The Raspberry Pi Zero, in turn, is much more powerful than the Arduino Nano, but its
enormous power will be superfluous in this study. Arduino Nano has a lower class than Rasbperry Pi
Zero, but this Arduino Nano microcontroller was chosen for the reasons listed below:</p>
          <p>Dimensions of the microcontroller allow the control part to be made much smaller than in the
previous version.</p>
          <p>Development on this microcontroller will be facilitated by the presence of a large number of
libraries and examples for various tasks. The speed of program execution will be much
higher, due to the properties of the C/C++ programming language.</p>
          <p>The risk of an error is reduced due to frequent switching on because the microcontroller will
execute the code with which it will be flashed. For this reason, the control unit will not be
busy performing any other tasks.</p>
          <p>The role of the control unit is reduced so that the computing part remains in the software.
The only tasks of the control unit remain receiving data, sending data, receiving commands
from the user.</p>
          <p>The control element works with servo drivers. However, there are 8 of them, and some solutions
are needed to control them. In the first version, such a solution was 2n7000 transistors due to their
simplicity of operation. They work in such a way that when a signal is sent to the control electrode,
the energy passes through the transistor and goes to the servo driver. And here several problems
appear at once:</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>1. Inaccurate positioning of servo drivers due to the use of a transistor. 2. Also, the control signal was generated by the control unit, which took up resources. 3. To control 8 servo drives, many such transistors were needed. After analyzing these results, it was decided to use a PCA9685 port expander instead of transistors.</title>
          <p>2.2. PCA9685</p>
          <p>The PCA9685 is a PWM controller for controlling up to 16 independent outputs with I2C interface.
It is presented in Figure 5 [15].</p>
          <p>PCA9685 is more suitable due to more precise selection of the transistor position and minimal load
for Arduino NANO. In turn, 2n7000 is much cheaper, but requires more control from Arduino Nano
to control.</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.3. Sensors</title>
        <p>When building a breathing simulator system, the cornerstone is the sensors. To do this, it’s required
to choose which sensors exactly will be, and also develop general software for the system to work
with all the sensors. After that, the sensors must be adjusted.</p>
        <p>Each sensor will monitor a specific parameter that is important for monitoring the patient's
breathing. Consideration must begin with the air parameters, and the sensor that monitored it in the
first version of the circuit.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3.1. Air quality monitoring</title>
        <p>Air quality monitoring will include monitoring of CO2, volatile organic compounds in the air. In the
first version of the scheme, the digital sensor CCS811 was chosen (Figure 6). It works via the I2C
interface, which allows it to be connected to the PCA9685 and work on two wires. This sensor has not
been changed, as it copes with its task perfectly. In addition, it is small.</p>
      </sec>
      <sec id="sec-2-4">
        <title>2.3.2. Monitoring of temperature, humidity, and pressure</title>
        <p>The HTU21 sensor [17] (Figure 7a) was selected for monitoring temperature and humidity, and the
BME280 (Figure 7b) for pressure. These sensors coped with their task, but their functions can be
performed by the BMP280 sensor [18] (Figure 7c), which, although more expensive, will take up less
space, but will reduce the volume of the data queue coming to the Arduino Nano. Also, an important
factor in replacing these sensors is the MAX30100 sensor.</p>
        <p>a
b
c</p>
      </sec>
      <sec id="sec-2-5">
        <title>2.3.3. Monitoring of heart rate and saturation</title>
        <p>Saturation and heart rate in the first version of the circuit were monitored by MAX30100. When
working with it, an error or "bug" appeared, in which the saturation value could be displayed
incorrectly. The MAX30100 sensor (Figure 8a) hung up because of the FIFO cyclic buffer, which did
not allow the other sensors to work normally. When changing the number of sensors, the error
disappeared. But when improving, this sensor was replaced with a more improved version
MAX30102 (Figure 8b). A comparative characteristic is represented in Table 3.</p>
      </sec>
      <sec id="sec-2-6">
        <title>2.4. Threshold signal</title>
        <p>One of the problems identified during testing was that when critical values of saturation and heart
rate were reached, there were no notifications about this. To solve this problem, a piezo element
("buzzer") was added (Figure 9), which, when critical values were reached, would receive a signal to
emit a sound [20].</p>
      </sec>
      <sec id="sec-2-7">
        <title>2.5. Power handling</title>
        <p>The next change was made to the power supply. To power the first version of the circuit, it was
necessary to work with a DCDC converter and several batteries. The circuit requires 5V power
supply for most elements, except for several sensors that operate on 3.3V, and the power supply must
be stable for several hours of operation. For this, a 20,000 mAh Power Bank was selected, which
allows for stable 5V power supply. For sensors operating on 3.3V power supply, an ASMS 1117-3.3
stabilizer was added, which has sufficient data for working with sensors and the required dimensions.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Results</title>
      <p>Thus, the project scheme was transformed. The comparison results of testing Raspberry Pi Zero and
Arduino Nano are presented in Table 4.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>This article describes in detail the changes made to the scheme of the project "Development of a
software and hardware complex for monitoring and correcting respiratory functions based on
multimodule technologies" to improve it and explains the reasons for them. Each block of the circuit
was analyzed, individual elements were tested. The main changes were made to the control units and
servo drives. The control unit was the most important for improvement because its characteristics are
important for autonomous operation. Although the Raspberry Pi Zero has great resources, but
compared to the Arduino Nano it is less appropriate for this study. In the future, when changing the
task, for example, communication with the network, it is possible to integrate ESP32 or ESP8266, as
very well-proven microcontrollers. Also, global changes affected the control of the servo drives
themselves, which simplifies the task for the microcontroller, only specifying the address in I2C for
stable operation of the servo drives. The introduced changes contribute to the performance of the
circuit. By making it modular, the circuit became easier to repair and test new software algorithms.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>This research is funded by the Science Committee of the Ministry of Science and Higher Education of
the Republic of Kazakhstan (Grant No. AP19680049).</p>
    </sec>
    <sec id="sec-6">
      <title>Declaration on Generative AI</title>
      <sec id="sec-6-1">
        <title>The authors have not employed any Generative AI tools.</title>
        <p>[4] Tarigan, Amira P., et al. "Effectiveness of upper arm and breathing exercises to improve
inflammatory markers in severe COVID-19 patients." Narra J 4.1 (2024).
[5] Dwivedi, Ruby, Divya Mehrotra, and Shaleen Chandra. "Potential of Internet of Medical Things
(IoMT) applications in building a smart healthcare system: A systematic review." Journal of oral
biology and craniofacial research 12.2 (2022): 302-318.
[6] Panda, Subhashree, et al. "An IoT-driven COVID and Smart Health Check Monitoring</p>
        <p>System." The Open Biomedical Engineering Journal 18.1 (2024).
[7] Dong, Shuqin, et al. "Remote Respiratory Variables Tracking With Biomedical Radar-Based IoT</p>
        <p>System During Sleep." IEEE Internet of Things Journal (2024).
[8] Belkacem, Abdelkader Nasreddine, et al. "End-to-end AI-based point-of-care diagnosis system
for classifying respiratory illnesses and early detection of COVID-19: A theoretical
framework." Frontiers in Medicine 8 (2021): 585578.
[9] Bagad, Piyush, et al. "Cough against covid: Evidence of covid-19 signature in cough
sounds." arXiv preprint arXiv:2009.08790(2020).
[10] Ritwik, Kotra Venkata Sai, Shareef Babu Kalluri, and Deepu Vijayasenan. "COVID-19 patient
detection from telephone quality speech data." arXiv preprint arXiv:2011.04299 (2020).
[11] Fan, Dou, et al. "A Contactless Breathing Pattern Recognition System Using Deep Learning and</p>
        <p>WiFi Signal." IEEE Internet of Things Journal (2024).
[12] Rajarajan, S., et al. "IoT-Enabled Respiratory Pattern Monitoring in Critical Care: A Real-Time
Recurrent Neural Network Approach." 2024 10th International Conference on Communication
and Signal Processing (ICCSP). IEEE, 2024.
[13] Duzbayev, Nurzhan T., et al. "Development of the Electronic Circuit and Printed Circuit Board
for the Breathing Simulator." DTESI (workshops, short papers). 2023.
[14] Arduino Nano, URL: https://arduino.ru/Hardware/ArduinoBoardNano.
[15] PCA9685, URL: https://robotchip.ru/obzor-pca9685.
[16] CCS811 digital sensor, URL: https://robotchip.ru/obzor-datchika-kachestva-vozdukha-ccs811.
[17] HTU 21 GY21 sensor, URL:
https://3d-diy.ru/wiki/arduino-datchiki/datchik-temperatury-ivlazhnosti-gy-21.
[18] BMP280 sensor, URL: https://3d-diy.ru/wiki/arduino-datchiki/sensor-bmp280.
[19] MAX30100, URL:
https://lastminuteengineers.com/max30100-pulse-oximeter-heart-ratesensor-arduino-tutorial.
[20] Arduino Master, URL: https://arduinomaster.ru/uroki-arduino/pishhalka-pezodinamik-arduino.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>Chen.</given-names>
          </string-name>
          "
          <source>The Impact of COVID-19 on Different Human Systems and Related Research Progress." Highlights in Science</source>
          , Engineering and Technology 
          <volume>91</volume>
          (
          <year>2024</year>
          ):
          <fpage>145</fpage>
          -
          <lpage>150</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Zheng</surname>
          </string-name>
          ,
          <string-name>
            <surname>Bang</surname>
          </string-name>
          , et al.
          <article-title>"Prevalence, risk factors and treatments for post-COVID-19 breathlessness: a systematic review and meta-analysis</article-title>
          .
          <source>" European Respiratory Review 31.166</source>
          (
          <year>2022</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Tariq</surname>
          </string-name>
          ,
          <string-name>
            <surname>Hasan</surname>
          </string-name>
          , et al.
          <article-title>"State-of-the-Art Low-Cost Air Quality Sensors, Assemblies, Calibration and Evaluation for Respiration-Associated Diseases: A Systematic Review</article-title>
          .
          <source>" Atmosphere 15.4</source>
          (
          <year>2024</year>
          ):
          <fpage>471</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>