Next Article in Journal
Smartphone-Based Task Scheduling in UAV Networks for Disaster Relief
Previous Article in Journal
Augmenting Knowledge for Individual NVR Prediction in Different Spatial and Temporal Cross-Building Environments
Previous Article in Special Issue
High-Capacity Multiple-Input Multiple-Output Communication for Internet-of-Things Applications Using 3D Steering Nolen Beamforming Array
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design of a Real-Time Monitoring System for Electroencephalogram and Electromyography Signals in Cerebral Palsy Rehabilitation via Wearable Devices

1
Faculty of Mechanical and Electrical Engineering, Kunming University of Science and Technology, Kunming 650500, China
2
Computer Center, Kunming University of Science and Technology, Kunming 650500, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(15), 2902; https://doi.org/10.3390/electronics13152902
Submission received: 18 June 2024 / Revised: 17 July 2024 / Accepted: 18 July 2024 / Published: 23 July 2024
(This article belongs to the Special Issue Advances in Wireless Communication for loT)

Abstract

:
Cerebral palsy is a disorder of central motor and postural development, resulting in limited mobility. Cerebral palsy is often accompanied by cognitive impairment and abnormal behavior, significantly impacting individuals and society. Time, energy, and economic investment in the rehabilitation process is substantial, yet the rehabilitation outcomes often remain unsatisfactory. Additionally, some patients have limited sensory perception during rehabilitation training, making it challenging to effectively regulate exercise intensity. Traditional evaluation methods are mostly based on recovery performance, lack guidance at the neurophysiological level, and have an unequal distribution of medical rehabilitation resources, which pose great challenges to the rehabilitation of patients. Based on the issues mentioned above, this paper proposes a real-time cerebral signal monitoring system based on wearable devices. This system can monitor and store blood oxygen, heart rate, myoelectric, and EEG signals during cerebral palsy rehabilitation, and it can track and monitor signals during the rehabilitation treatment process. The system includes two parts: hardware design and software design. The hardware design includes a data signal acquisition module, a main control chip (ESP32), a muscle electrical sensor module, a brain electrical sensor module, a blood/heart rate acquisition module, etc. It is primarily for real-time signal data acquisition, processing, and uploading to the cloud server. The software design includes functions such as data receiving, data processing, data storage, network configuration, and remote communication and enables the visual monitoring of data signals. The system can achieve real-time monitoring of electromyography, electroencephalography, and blood oxygen levels, as well as the heart rate of patients with cerebral palsy, and adjust rehabilitation training in real-time during the rehabilitation process. At the same time, based on the real-time storage of the original electromyography and electroencephalography data, it can provide auxiliary guidance for later rehabilitation evaluation and effective data support for the entire rehabilitation treatment process.

1. Introduction

Cerebral palsy is a group of persistent syndromes of central motor and postural developmental deficits and activity limitations, which result from non-progressive injuries to the developing fetal or infant brain [1,2,3,4]. In recent years, cerebral palsy has been one of the most common disorders leading to motor dysfunction in children, and cerebral palsy disorders can have a tremendous impact on the development of the individual, the family, and the socio-economy [5]. Traditional rehabilitation treatment requires the rehabilitation physician and the patient to engage in one-on-one rehabilitation sessions. This method requires the rehabilitation physician to bear a heavy workload, and the patient also needs to frequently travel to large hospitals, increasing the economic burden on the patient’s family. At the same time, the process of rehabilitation therapy involves a certain degree of uncertainty; the duration of rehabilitation exercises is difficult to grasp [6,7]. Both excessively long and excessively short exercise times can impact the effectiveness of rehabilitation; furthermore, individual differences among children are significant, making accurate assessment of their conditions more challenging during the treatment and rehabilitation process [8,9].
Surface electromyography (sEMG) or dynamic electromyography (dEMG) is the recording of one-dimensional time series of electrical signals induced and measured by a surface electromyograph from the surface of the muscle during muscle activity, reflecting the bioelectrical changes in the neuromuscular system [10,11]. Clinically, surface electromyography is an effective way to evaluate the effect of rehabilitation training; surface electromyography can effectively grasp improvement in the condition of children with spastic cerebral palsy and can provide guidance for their rehabilitation training, and the changes in sEMG signals can be analyzed in the process of rehabilitation and functional training of muscle fatigue to make the treatment targeted and effective [12,13].
The electroencephalogram (EEG) is a pattern obtained by amplifying and recording the spontaneous biological potentials of the brain from the scalp using a precision electronic instrument. It represents the spontaneous and rhythmic electrical activity of brain cells as recorded by electrodes, providing medical personnel with valuable information about brain activity [14,15]. EEGs can be used for diagnosing and evaluating various diseases, and its role in rehabilitation training systems based on the brain–computer interface has become increasingly important [16,17].
Based on the real-time monitoring system for cerebral signals using wearable devices in cerebral palsy rehabilitation, joint monitoring of electromyographic and electroencephalogram signals can simultaneously assess the muscle activity of patients and the functional state of the brain [18,19]. This provides accurate rehabilitation guidance and enhances understanding of the correlation between the two through signal monitoring and comparison, leading to a deeper understanding of the neuromuscular system’s function and the principle of mutual regulation and providing a more scientific basis for rehabilitation theory and practice. Real-time monitoring of blood oxygen and heart rate can help to better control the body muscles of patients during the rehabilitation process, adjusting the intensity and duration of rehabilitation and reducing the uncertainty in rehabilitation. Simultaneously, recording both parameters can provide better control over the rehabilitation progress over time.
This paper proposes a means of collecting muscle and brain signals by integrating muscle sensors and brain inductors, transmitting the signals to an ESP32 MCU in the form of digital signals through analogue-to-digital conversion pins for signal processing. The processed signals and data are then transmitted to the Internet of Things platform via the wireless communication function of the MCU module. A mobile application was developed to detect data from the IoT platform for front-end signal collection and remote detection. This enables accurate monitoring and evaluation of real-time changes in muscle and EEG signals during the rehabilitation training process of patients with cerebral palsy. Such monitoring is crucial for developing personalized rehabilitation programs and evaluating rehabilitation effects.
The wearable monitoring device designed in this paper aims to dispense with the large size of traditional monitoring devices, their poor wearability, their low wearable comfort, and their high cost, as well as the need for more patients to go to medical institutions for monitoring, the fact that patients are unable to achieve remote monitoring, and the low prevalence of factors, fulfilling the need to design an integrated miniaturized device [20]. It can be applied to monitor daily rehabilitation in ordinary patients, reducing the cost of collecting EMG and EEG signals and providing them with more convenient and efficient assistance. The sensor uses a dry electrode sensor and is made of soft and breathable material, which does not affect normal daily life activities, while ensuring that it remains comfortable when worn for a long time, thus greatly improving the convenience of signal monitoring and wearing comfort. The aims are to achieve all-weather monitoring, capture more physiological data, and provide a more comprehensive data basis for medical analysis and diagnosis. Its remote monitoring and real-time feedback function and real-time storage of data signals are convenient for doctors and guardians to monitor and diagnose conditions, which greatly improves the efficiency of medical services and provides users with more personalized services. At the same time, the data transmission and storage processes have characteristics of confidentiality to ensure the security and privacy of user data.

2. Overall System Design Scheme

The system mainly includes a sensor module for collecting signal data, a core chip for transmitting monitoring data to the cloud platform, a hardware device display, cloud data reception, a remote app subscription for monitoring signal data, and real-time storage. The signal data acquisition module collects the original myoelectric signals, EEG signals, blood oxygen levels, and heart rate signals. It transmits them through the communication connection between the module and the main control board. The core chip caches data and uploads them to the cloud platform server in real-time. The remote end obtains cloud detection signal data by developing a computer app, displaying real-time data and data change trends, and storing the data for subsequent processing and analysis. The overall design scheme of the system is shown in Figure 1.

3. Hardware Design of the System

The data signal acquisition module of the system consists of muscle electrical sensors, brain electrical sensors, and blood/heart rate acquisition sensor modules. The collected real-time signal is received and transmitted through the ESP32 chip module. The hardware acquisition part is designed to be small and wearable, and it is placed on the detected object for data collection and transmission.

3.1. Introduction to Hardware Sensor Modules

The main control chip ESP32: This system uses ESP32 as the main control chip; ESP32 MCU has a 32-bit dual-core processor, an internal integration of traditional Bluetooth, low-power Bluetooth, and a Wi-Fi module function. It is a general-purpose WiFi-BT-BLE MCU module [21], is powerful and versatile and can be used for low-power sensor networks and demanding tasks, is well suited for wearable device environments that require continuous signal acquisition over long periods of time, and has high data transfer rates, industry-leading specifications, and great advantages in terms of performance in high integration, wireless transmission distance, power consumption, and network connectivity [22,23].
Muscle electrical sensor module: This module adopts a dry electrode EMG sensor, using dry electrode leads, eliminating the need for a traditional gel electrode. The signal it captures is of good quality, with a long service life, and is easy to use. Therefore, it is more suitable for various scenarios. The sensor integrates filtering and amplification circuits to amplify the weak human surface EMG signals within the range of ±1.5 mV by 1000 times, and noise is effectively suppressed through differential input and analogue-filtering circuits [24]. With 1.5 V as the reference voltage and a range of 0–3.0 V, its output waveform can effectively observe subcutaneous muscle activity, which is very useful in the field of pharmaceutical research and other areas.
EEG sensor module: This module uses a single-channel Taurus brainwave sensor module. With the use of a 32-bit processing chip, this module is powerful for computing speed and performance. By using the module’s internal integration of hardware filtering and software filtering and the integration of the 50 HZ trap filter, it is possible to filter out environmental interference to improve the quality of the signal, and its integrated analogue front-end and the ADC directly output digital signals [25]. As a result, difficulty is greatly reduced, with high-resolution results and support for wet and dry electrodes, and it is convenient to wear.
The blood/heart rate acquisition module adopts the MAX30102 module, which integrates biological sensors for blood oxygen and pulse detection, as well as heart rate monitoring. The module integrates LEDs and optical components for red and infrared light and adopts a 1.8 V power supply standard with an I2 C communication interface for data transmission [26].

3.2. Hardware System Platform Design

The system utilizes the ESP32 main chip to integrate data collected by each sensor. It then displays real-time measurement signals on the TFT screen, enabling real-time visibility detection by the detector. The EEG signal module and the EEG acquisition electrodes are first connected through the supporting leads for data signal acquisition and processing. Communication between the EEG module and the main chip is carried out through the Bluetooth module, making the hardware device more wearable. The transmitting end of the Bluetooth module is configured on the EEG module, and the receiving end is connected to the UART of the ESP32 chip for data transmission of the EEG signals.
The muscle electrical signal acquisition module collects signals through matched dry muscle electrodes. The muscle module is connected to the ADC pin of the main control chip via an external Dupont wire. Considering the particularity of collecting muscle electrical signals, the connection of Dupont wires is more suitable. The MAX30102 blood oxygen/heart rate module and TFT display are integrated into the PCB board to collect blood oxygen and heart rate data and display real-time data. The hardware system design diagram is shown in Figure 2.

4. Remote Communication Server Construction

4.1. MQTT Server Communication

As a lightweight communication protocol, MQTT is extensively used for Internet of Things (IoT) communications. Remote system monitoring is achieved through the publication and subscription of the MQTT protocol [27,28]. The hardware acquisition side serves as the data publisher, releasing signal data to the server, while the remote monitoring platform acts as the subscriber, receiving server data. This form of communication is illustrated in Figure 3 below. Sensors transmit collected heart rate, blood oxygen, myoelectric, and EEG data to a cloud server using the MQTT protocol. Programs are then used to develop apps or computer software that subscribe to messages via the MQTT protocol for network data monitoring. Additionally, databases can be established, and information can be stored in the cloud [29].
The process of publishing and subscribing through MQTT communication is illustrated in Figure 4. When the system is in use, the client requests a connection to the server; the server responds to the connection and then establishes a heartbeat response. The publisher publishes specific data signals on a specific topic, and the subscriber subscribes to the corresponding topic to achieve remote data transmission. The data transmission volume level is at the QoS2 level to ensure the reliability of data transmission. After the data are published, the server will respond that it has received the data. If no data are received, the publisher will continue to publish, and the server will release the received response for data publication. The server instructs the publisher to complete the publication, ensuring that signal data in the transmission process is not lost. The underlying connection protocol between the client and the server is TCP for connecting with the server. The TCP protocol provides ordered, reliable, bidirectional byte stream transmission [30]. The client and server only need the IP address and port number to achieve access and connection.

4.2. MQTT Server Construction

The MQTT protocol, as a lightweight communication protocol, is widely used in IoT communication, and the remote data transmission of this system is carried out through the MQTT protocol. The system needs to be monitored remotely and in real time, the MQTT server is built on the AliCloud platform, and data are transmitted remotely through the public IP and port for remote access. The server is built using EMQX, a distributed MQTT messaging server framework deployed in AliCloud, which has the characteristics of high throughput and low latency and can handle a large number of messages and connections well, which is very suitable for the remote communication platform of a real-time monitoring system with a large amount of data [30].
In the Ubuntu system, you can install EMQX via the APT source. First, configure the EMQX APT source; then, install EMQX; and finally, start the server. Enter the following commands on the server:
curl-s https://assets.emqx.com/scripts/install-emqx-deb.sh (accessed on 16 May 2024)| sudo bash // Configure the EMQX Apt source.
sudo apt-get install emqx // Perform the EMQX installation.
sudo systemctl start emqx // start the server
Through the above commands, a good MQTT server will be deployed on the Alibaba Cloud platform. It will be built in the background of the Alibaba Cloud platform server to open ports 1883, 8883, and other port numbers for peripheral connections. Following these steps, the server will be built, and startup will be completed, after which server configuration can be carried out. Open the background of the server to reset the account password; after entering the server, setting up client-side authentication is necessary to ensure the security of the connection. Create a client in the access control; the authentication is in the form of a built-in database, and user authentication is the client’s name and password authentication. User management through client authentication to add and change the user of the external device can be connected to the user name and password of the connected device; external devices only need to set the correct user name and password to be connected to the server to publish and subscribe to the theme. In client authentication, add and change users on external devices through user management. Set the user name and password for the connected device; the external device only needs to input the correct user name and password to connect to the server for message publishing and subscription. Two connected users, the hardware client ESP-32 and the software client KHD-1, have been added, as shown in Figure 5. To add more connected devices, create them accordingly, which significantly enhances security.
Through the above commands, a good MQTT server will be deployed on the AliCloud platform. A server will be built in the background of the AliCloud server to open ports 1883, 8883, and other port numbers for peripheral connections. Following these steps, the server will be built, and startup will be completed, after which server configuration can be carried out. Open the background of the server to reset the account password; after entering the server, setting up client-side authentication is necessary to ensure the security of the connection. Create a client in the access control. The authentication is in the form of a built-in database, and user authentication is the client’s name and password authentication. User management through client authentication to add and change the user of the external device can be connected to the user name and password of the connected device; external devices only need to set the correct user name and password to be connected to the server to publish and subscribe to the theme. In client authentication, add and change users on external devices through user management. Set the user name and password for the connected device; the external device only needs to input the correct user name and password to connect to the server for message publishing and subscription. Two connected users, the hardware client ESP-32 and the software client KHD-1, have been added, as shown in Figure 5. To add more connected devices, simply create them accordingly, which significantly enhances security.
The external device can access the server after filling in the corresponding information, and the connection display, as shown in Figure 6, can be seen in the background of the server, which displays the client ID, user name, connection status, connection time, and other information. At the same time, some user machines can be kicked by other management.

5. Work Flow of the System

The specific workflow when the device is used is shown in Figure 7. After the device is powered on, the system initializes and connects to the network using the pre-set name and password of the target WiFi. If the connection fails, the program attempts to connect in cycles. After the connection is successful, the sensor connects and communicates. The sensor is connected to the main control chip through a Bluetooth serial port, ADC pin, and IIC pin with the EEG sensor, myoelectric sensor, and MAX30102 sensor, respectively. The data can be transmitted to the main control chip through the serial port only after the scanning connection between the receiving module and the sending module of Bluetooth is successful; after receiving the sensor data, the control chip displays the signal data on the TFT display. The system then connects to the server to send a theme-specific packet to the server when the connection is successful. When remote monitoring is required, open the software of the upper computer and enter the IP address, password, subscription topic, and port number of the server in the connection interface to connect to the server. If the connection fails, a connection error will be displayed. After the connection is successful, subscribe to the message of the specific topic of the server, parse the message packet of the corresponding topic, and display the data on the software interface. Set up a folder to store the real-time signals collected after the monitoring equipment powers down.

6. Signal Acquisition and Its Principles

6.1. Blood Oxygen and Heart Rate Signal Acquisition Principle and Filtering

6.1.1. Acquisition Principle

The MAX30102 method for measuring blood oxygen and heart rate is based on the Lambert–Beer law theorem. According to the principles of light reflection and transmission, different tissues, such as bones, muscles, skin, and blood, have varying absorption rates for light [31]. However, within the same tissue type, the absorption rate is generally consistent. When a column of monochromatic light is vertically irradiated into the skin of a person’s body, changes in blood volume within the vessels result in corresponding changes in absorbed light. During cardiac contraction, an increase in blood volume leads to greater absorbed light intensity and reduced reflected light intensity. Conversely, during diastole when blood volume decreases in the vessels, there is a decrease in absorbed light intensity and an increase in reflected light intensity [32]. Photoplethysmography (PPG) signals are obtained through photodetectors; calculations for blood oxygen levels and heart rate are then derived from these PPG signals [33].
The specific expression of the Lambert–Beer law principle is as follows:
A = log ( I 0 I ) = ε c l
where A represents absorbance; I represents transmitted light intensity; I 0 represents incident light intensity; ε represents the molar absorptivity coefficient; l represents path length through the absorbing substance; and c is the concentration of light-absorbing substances.
During the PPG signal acquisition process, bone tissues do not exhibit significant changes in their response to incident lights over time intervals. However, only variations due to changes in vascular bed volumes are observed, which results in a variation in optical density with respect to time, leading to the presence of the DC component along with the AC component, as shown in Figure 8 below:
The heart rate measurement formula, as shown in Figure 8, only requires the measurement of two peak times, T . Therefore, the heart rate calculation formula is
H e a r t   R a t e = 60 f
where f is the frequency, and f = 1 T .
The MAX30102 is equipped with two LEDs, one emitting red light and the other emitting infrared light. The differential absorption rates of human oxyhemoglobin and deoxyhemoglobin for these distinct wavelengths are evident, enabling the derivation of a polynomial relationship for blood oxygen saturation by combining the PPG signals from both sources.
R = A C r e d / D C r e d A C i r e d / D C i r e d
where A C r e d represents the AC signal of red light, D C r e d represents the DC signal of red light, A C i r e d represents the AC signal of infrared light, and D C i r e d represents the DC signal of infrared light.
Obtain the following fitting formula for blood oxygen:
S p O 2 = a R 2 + b R + C
where a and b are related to the sensor’s structure, sensitivity, and measurement conditions. For the Max30102 blood oxygen saturation sensor, the parameter calibration is a = 45.060 , b = 60.354 , and C = 94.845 .
The collection of the above PPG signals is often mixed with much noise, especially when the operating state of the equipment in this system needs to be measured in the environment with movement, which will produce artefacts caused by movement and cause great errors in the calculation of blood oxygen/heart rate. To make the measurement results more accurate, an adaptive filtering algorithm is introduced to filter the PPG signals and improve the accuracy of monitoring.

6.1.2. LMS Adaptive Filtering

Least Mean Square, LMS, is a standard adaptive filtering algorithm based on gradient descent. The algorithm has less computation, high efficiency, and a simple structure and is suitable for implementing algorithms in microprocessors. The LMS algorithm uses the square error to represent the mean checking calculation, which can reduce the error between the actual signal and the expected signal [34]. Its basic structure diagram is shown in Figure 9.
At time k , X ( k ) represents the input signal vector, y ( k ) represents the output signal, and d ( k ) represents the desired output signal of the filter. Its feedback value is the mean square error E ( e ( k ) 2 ) of the difference e ( k ) between the expected signal and the output signal, which adjusts the weight coefficient of the adaptive filter, reduces the error of the output signal, and makes the output at the next time closer to the expected value.
The input signal X ( k ) of the LMS adaptive filter at time k is
X ( k ) = [ x ( k ) , x ( k 1 ) , x ( k M + 1 ) ] T
The filter weight vector W ( k ) at time k is
W ( k ) = [ w ( k ) , w ( k 1 ) , w ( k M + 1 ) ] T
where M is the order of the system.
Then, the output signal of the LMS adaptive filter is
y ( k ) = W T ( k ) X ( k )
The error e ( k ) of the system is
e ( k ) = d ( k ) y ( k ) = d ( k ) W T ( k ) X ( k )
where d ( k ) represents the desired output signal of the filter, and y ( k ) represents the output signal.
Its mean square error is
δ = E [ e ( k ) 2 ] = E [ d ( k ) 2 ] 2 E [ d ( k ) W T ( k ) X ( k ) ] + E [ W T ( k ) X ( k ) X T ( k ) W ( k ) ]
The gradient descent method is used to adjust the vector value of the weight coefficient of the adaptive filter. The iterative formula of the weight vector W is as follows:
W ( k + 1 ) = W ( k ) + μ ( δ )
where μ is the step factor, μ > 1 ; when μ is large, the convergence rate is slow, but the error between the output and the input is large. When μ is small, the convergence rate is slow, but the precision error of the iterative process is small.
In order to reduce the operational complexity of the LMS algorithm, the transient variance of the system is used instead of the original mean square error, and the gradient value of the filtering system is calculated as follows:
δ = ( e 2 ( k ) ) W ( k ) = [ 2 e ( k ) e ( k ) w 1 ( k ) , 2 e ( k ) e ( k ) w 2 ( k ) , ....2 e ( k ) e ( k ) w M M ( k ) ] T = 2 e ( k ) X ( k )
Through the above formula, the vector value of the adaptive filter weight coefficient is updated to
W ( k + 1 ) = W ( k ) + μ ( δ ) = W ( k ) + 2 μ e ( k ) X ( k )
To compare the effect of adding a device algorithm on the measurement schedule during the experiment, subjects were selected to wear the device without adding the adaptive filtering algorithm, and their 100 s heart rate and blood oxygen data were statically tested; that is, the subjects’ wearing positions did not move. Then, the subjects were tested for 100 s of their heart rate and blood oxygen data; that is, the subjects were allowed to move their wearing positions, and, at the same time, a professional measuring instrument, the Lepu oximeter, was used to measure and compare. To facilitate statistical comparison, the average heart rate and blood oxygen levels within 5 s of each measurement were calculated separately. After the end of the experiment, the line chart of the collected blood oxygen and heart rate was drawn, and the results are shown in Figure 10 below.
As can be seen from the figure, the blood oxygen and heart rate measured under static conditions are almost consistent with those measured by the Lepu oximeter. Input2: However, when moving, there were significant errors, leading to inaccuracies in the measurement results.
After the PPG signal filtering algorithm was added, experimental verification was carried out. The experimental methods were consistent as above, and the measurement objects were consistent. The experimental results were as follows, as shown in Figure 11. It can be seen that the measurement results in the motion state were close to the results of the Lepu oximeter, and it was hardly affected by the motion.
Through a comparison of the above experimental results, it is possible to conclude that the acquisition by adding a filtering algorithm could effectively reduce the influence of movement on the accuracy of acquisition, and the measurement results after adding a filtering algorithm were almost consistent with the acquisition effect of the static and Lepu oximeter.

6.2. Principle of Myobrain Signal Acquisition

Surface EMG signals are electrical impulses generated by the cell body and dendrites of motor neurons in the central nervous system under the stimulation of synapses. They are transmitted along the axons of neurons to the junction between nerves and muscles at the end, producing a series of effects on muscle fibers [35], making muscle fibers generate muscle force, which causes potential changes in muscle contraction. The potential difference can then be measured using an external electrode. Emg reflects the electrophysiological characteristics of the whole muscle; its amplitude is 0–1.5 mv, the frequency of useful signals is 0–500 HZ, and the main energy is concentrated in 20–150 HZ. When collecting the EMG signal, the weak electrical signal is amplified through the amplifier circuit through the electrode to obtain the EMG diagram [36]. The specific collection principle is shown in Figure 12.
An EEG is the overall activity of brain nerve cells, including ion exchange, metabolism, and other comprehensive external performances [37]. An EEG’s electrical signal potential is very low, only less than 100 μV, susceptible to interference by other electromagnetic fields. The collection of EEG electrical signal-sensor electrodes and environment requirements are very high. In this paper, a single-lead EEG acquisition device was adopted [38]. The EEG measuring electrode was placed at Fp1 on the left side of the forehead, and two reference electrodes were worn at A1 and A2 on both earlobes, as shown in Figure 13 in the international 10–20 standard lead system.

7. Verifying the Experimental Design of the Equipment

7.1. Systematic Experimental Design

The experimental method for this system is to test the accuracy of the data collection of the hardware system and the effectiveness of remote real-time monitoring, as well as evaluate the stability of the software system, etc. The TFT display screen, Max30102 blood oxygen/heart rate module, muscle electrical module interface, and brain electrical Bluetooth-communication-receiving module are integrated on the PCB board to create an integrated device. It is convenient to control and wear the device, in which the EEG module and the myoelectric module are in the form of external attachments, mainly considering the wearing situation of the device. The device’s power supply is provided by the charging bank attached to the back. The specific physical model of the device is shown in Figure 14.
During the experiment, the tester used a specific elastic band to correctly position the various parts of the device on the body. When monitoring muscle signals, the dry electrode of the sensor needed to be tied to the skin surface of the measured muscle with a wearable elastic band. Three metal electrodes were distributed on the dry electrode module, which are, respectively, the reference electrode and the measurement electrodes of the electromyography sensor. When wearing the electrode, the three metal electrodes needed to follow the contraction direction of the muscle. In the case of the flexor radialis digitorum, the way the electrodes were worn is shown in Figure 15a. When performing EEG signal monitoring, the measured site and electrode were scrubbed with a wet tissue in order to reduce the resistance of the skin surface and increase the measurement accuracy. After wiping, the two reference electrodes of the EEG sensor were placed on the earlobes of both ears, the measuring electrode was placed on the left side of the forehead, and the module switch was turned on to pair with the Bluetooth of the main control board. When the indicator light of the module changed from blinking to stable, it indicated that the Bluetooth connection was successful, and the EEG module could collect the EEG data and upload it to the main control chip, as shown in Figure 15b. Blood oxygen and heart rate were collected by the red light of the LED light of the module, so one only needed to gently place their finger on the measuring position of the module to measure blood oxygen and heart rate. After collecting the data, they were transmitted to the main control board via the I2C protocol. The overall wearing effect is shown in Figure 15c, where the position of the main control box could be adjusted to a suitable location according to the measurement requirements. After completing the wearing process, the next step was to turn on the device switch to power it on. The device automatically connected to the target Wi-Fi and the connection server. The next step was to open the monitoring software in the background for remote signal data monitoring.

7.2. Analysis of Test Results

The procedure included the following directions. After the monitor opens the monitoring software, the system will pop up with the MQTT connection interface, as shown in Figure 16. On the connection screen, you need to enter the IP address, port number, signal level, subscription subject, and name of the access server. After inputting these details, click the Connect button. The sentence you provide will appear to be “mqtt server connection success”, after the server connection is successful. Click the Subscribe button. The monitor can then read data packets from the hardware platform in real-time in the subscription window. The system will print the received data values and data formats, while the data will be stored in the background in the form of new text. After the collection is complete, clicking “Unsubscribe” will end the connection to the device. At the same time, the system can use the topic publishing mode to publish messages about a specific topic to the server. The specific window is shown in Figure 16, which contains information such as connection details and received data packets.
The data to be tested in this experiment include the accuracy of blood oxygen and heart rate collection, the electromyographic signal, the electroencephalogram signal, and real-time and effectiveness evaluation of the device through the software’s display interface. Through the monitoring data of the experiment, the effect of the monitoring data is shown in Figure 17. Figure 17a shows the displayed heart rate and the waveform diagram drawn, and the heart rate of the person being tested at this time can be obtained as 68 beats/min. The change trend of heart rate values is shown in the figure. The waveform display in the figure shows that the value is relatively stable, and it is almost consistent with the monitoring results of the Lepu blood oxygen instrument, and the monitoring results are relatively reliable. Figure 17b shows the real-time blood oxygen data and waveform display. It can be seen from the numerical display that the blood oxygen value at this time is 98%, the changing trend of blood oxygen value can be well seen in the waveform figure, and the monitoring stability is good from the waveform trend in the figure.
The monitoring of EEG and EMG data in the experiment was primarily evaluated by displaying the numerical waveform of the raw data. Figure 18a shows the monitored EMG values. Adjustments were made to the EMG data values to facilitate the display of data on the software interface. When there was muscle activity, a specific amplitude of signal data was generated. In Figure 18a, the waveform was almost maintained at about 500 mV when no muscle activity existed. When there was muscle activity, it can be seen that the data had apparent fluctuations in showing signal amplitude. The monitor could judge muscle activity and its intensity based on the waveform amplitude displayed by the software, thereby analyzing the muscle’s activity state. Figure 18b shows the original signal of the EEG data collected by the sensor. The corrected versions of EEG waves collected in the original signal EEG data include gamma wave, delta wave, β wave, α wave, and other waves of different frequencies. However, the observer cannot directly determine the types of EEG waves collected in the signal data. However, storing EEG signals can provide rich data support for subsequent EEG research on patients. Since Figure 18a shows the original signal data waveform, the numerical display of EEG signals has also been slightly adjusted to better visualize the wave pattern in the software.
After system collection, the data will be stored in the corresponding file of the computer in the form of text, which is convenient to import and analyze data in the data processing software. The specific storage format is shown in Figure 19 below. Part of the recorded data is depicted in the figure. The original data of blood oxygen, electromyography, heart rate, and the electroencephalogram are recorded in the figure, separated by commas to facilitate data observation and processing.
After collecting the data, some stored data from the upper computer software is drawn in MATLAB to visualize the waveform. Figure 20a below shows the original signal diagram of EEG data. It can be observed that the original EEG data is non-stationary; its characteristics change with time, displaying a certain level of randomness, and the waveform is complex and variable. It can be concluded that the collected EEG signals are reliable, and specific EEG characteristics can be derived from them only after applying specific EEG processing methods in the later stage. Figure 20b is the original data diagram of the EMG. As can be seen from the figure, since the acquisition voltage range of sensing is within the range of 0–3000 mV, it can be observed that when there is muscle activity, there will be noticeable signal amplitude changes, which can reflect the EMG characteristics well during movement.
This system’s data collection and transmission are reliable and stable based on the above test results. The system can display data waveforms on the host computer, and the remote monitor can grasp the real-time monitoring data of the patient’s blood oxygen and heart rate at any time, allowing for a timely understanding of the patient’s training status and making adjustments and plans for training intensity as needed. At the same time, the backup storage of complex neurophysiological signals, such as brain signals, is convenient for subsequent signal analysis, providing detailed assessment and guidance for disease recovery.

8. Conclusions

With the continuous development of Internet of Things (IoT) technology and embedded systems, the application of IoT in medical monitoring is becoming increasingly extensive. To make the collection of physiological signals, such as EMG and EEG signals, more convenient and affordable for patients with cerebral palsy during rehabilitation, and to provide a more scientific basis for the rehabilitation process, this paper uses the ESP32 chip to design a real-time EEG signal-detection system based on the IoT platform for patients with spastic cerebral palsy. The system is used for real-time monitoring and recording of muscle signals, brain signals, blood oxygen levels, and heart rate during patient treatment.

Author Contributions

Conceptualization, A.X.; methodology, A.X. and T.W.; Software, A.X.; Verification, A.X., T.W. and J.J.; formal analysis, T.W.; investigation, A.X. and J.J.; resources, T.W.; data curation, A.X.; writing—original draft preparation, A.X.; writing—review and editing, A.X. and J.J.; visualization, A.X.; supervision, T.W.; project administration, A.X.; funding acquisition, T.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Acknowledgments

First of all, I would like to thank my supervisor, Wu Tao, for all the help he gave me in writing this paper. Thanks to Jia JingTao for his help; he often studied the technical scheme with me, which enabled me could better complete the experiment and solve various problems encountered while writing the manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Pham, R.; Mol, B.W.; Gecz, J.; MacLennan, A.H.; MacLennan, S.C.; Corbett, M.A.; van Eyk, C.L.; Webber, D.L.; Palmer, L.J.; Berry, J.G. Definition and diagnosis of cerebral palsy in genetic studies: A systematic review. Dev. Med. Child Neurol. 2020, 62, 1024–1030. [Google Scholar] [CrossRef]
  2. Faccioli, S.; Pagliano, E.; Ferrari, A.; Maghini, C.; Siani, M.F.; Sgherri, G.; Cappetta, G.; Borelli, G.; Farella, G.M.; Foscan, M.; et al. Evidence-based management and motor rehabilitation of cerebral palsy children and adolescents: A systematic review. Front. Neurol. 2023, 14, 1171224. [Google Scholar] [CrossRef] [PubMed]
  3. Keogh, J.M.; Badawi, N. The origins of cerebral palsy. Curr. Opin. Neurol. 2006, 19, 129–134. [Google Scholar] [CrossRef] [PubMed]
  4. Anonymous. Does the Level of Focus in Serious Games in Immersive VR Correlate with the Quality of Movement? Preliminary Results from an Ongoing Study on Rehabilitation of Children with Cerebral Palsy. IEEE Int. Conf. Rehabil Robot. 2023, 2023, 1–6. [Google Scholar]
  5. Graham, H.K.; Rosenbaum, P.; Paneth, N.; Dan, B.; Lin, J.-P.; Damiano, D.L.; Becher, J.G.; Gaebler-Spira, D.; Colver, A.; Reddihough, D.S. Cerebral palsy. Nat. Rev. Dis. Primers 2016, 2, 15082. [Google Scholar] [PubMed]
  6. Xuan, L.; Nuno, O.; Naphtaly, E.; JenFu, C.; Katherine, B.; Sheila, B.; Hannah, S.; Peter, B. Feasibility of a real-time pattern-based kinematic feedback system for gait retraining in pediatric cerebral palsy. J. Rehabil. Assist. Technol. Eng. 2021, 8, 20556683211014125. [Google Scholar]
  7. Narayan, A.; Joshua, A.M.; Fernandes, R.; Karnad, S.D.; Alammari, A.; Chauhan, N.S.; Almgamese, M.T.D. Immediate effects of a novel hand rehabilitation board on fine motor skills in children with cerebral palsy: A pilot study. NeuroRehabilitation 2024, 54, 237–244. [Google Scholar] [PubMed]
  8. Stefano, P.; Andrea, M.; Giorgio, S.; Nicola, S.; Claudio, S.; Irene, A.; Michela, A.; Roberto, B.; Eliana, B.; Giulia, B.; et al. Assessing and treating pain associated with stroke, multiple sclerosis, cerebral palsy, spinal cord injury and spasticity. Evidence and recommendations from the Italian Consensus Conference on Pain in Neurorehabilitation. Eur. J. Phys. Rehabil. Med. 2016, 52, 827–840. [Google Scholar]
  9. Mirjam, B.; Angela, M.; Francesca, L.F.B.; Rosaria, D.L.; Danilo, L.; Angelo, Q.; Irene, C.; Giovanni, M.; Salvatore, C.R. Rehabilitation of Gait and Balance in Cerebral Palsy: A Scoping Review on the Use of Robotics with Biomechanical Implications. J. Clin. Med. 2023, 12, 3278. [Google Scholar] [CrossRef]
  10. Ayyad, M.A.; Owida, H.A.; Fazio, R.D.; Naami, B.A.; Visconti, P. Electromyography Monitoring Systems in Rehabilitation: A Review of Clinical Applications, Wearable Devices and Signal Acquisition Methodologies. Electronics 2023, 12, 1520. [Google Scholar] [CrossRef]
  11. Disselhorst-Klug, C.; Schmitz-Rode, T.; Rau, G. Surface electromyography and muscle force: Limits in sEMG–force relationship and new approaches for applications. Clin. Biomech. 2009, 24, 225–235. [Google Scholar] [CrossRef] [PubMed]
  12. Shumi, Z.; Jianxun, L.; Zidan, G.; Yisong, L.; Xia, O.; Chiu, C.C.; Shuangchen, R. Wearable Physiological Monitoring System Based on Electrocardiography and Electromyography for Upper Limb Rehabilitation Training. Sensors 2020, 20, 4861. [Google Scholar] [CrossRef] [PubMed]
  13. Toledo-Peral, C.L.; Gutiérrez-Martínez, J.; Mercado-Gutiérrez, J.A.; Martín-Vignon-Whaley, A.I.; Vera-Hernández, A.; Leija-Salas, L. sEMG Signal Acquisition Strategy towards Hand FES Control. J. Healthc. Eng. 2018, 2018, 2350834. [Google Scholar] [CrossRef] [PubMed]
  14. Yilmaz, G.; Seiler, A.; Chételat, O.; Schindler, K.A. Ultra-Long-Term-EEG Monitoring (ULTEEM) Systems: Towards User-Friendly Out-of-Hospital Recordings of Electrical Brain Signals in Epilepsy. Sensors 2024, 24, 1867. [Google Scholar] [CrossRef] [PubMed]
  15. Teplan, M. Fundamentals of EEG measurement. Meas. Sci. Rev. 2002, 2, 1–11. [Google Scholar]
  16. Zhang, Q.; Wang, P.; Liu, Y.; Peng, B.; Zhou, Y.; Zhou, Z.; Tong, B.; Qiu, B.; Zheng, Y.; Dai, Y. A real-time wireless wearable electroencephalography system based on Support Vector Machine for encephalopathy daily monitoring. Int. J. Distrib. Sens. Netw. 2018, 14, 155014771877956. [Google Scholar]
  17. Hao, J.; Huang, B.; Remis, A.; He, Z. The application of virtual reality to home-based rehabilitation for children and adolescents with cerebral palsy: A systematic review and meta-analysis. Physiother. Theory Pract. 2024, 40, 1588–1608. [Google Scholar] [PubMed]
  18. LYU Pin value of combining surface electromyography with video EEG and ECG in the diagnosis of motor seizures in children with epilepsy. Chin. Pediatr. Integr. Tradit. West. Med. 2022, 14, 316–318.
  19. Wang, H.; Sun, Y.; Zheng, Y. The clinical value of video EEG combined with synchronized electromyography in the diagnosis of pediatric epilepsy. Matern. Child Health Care China 2018, 33, 4033–4035. [Google Scholar]
  20. Heremans, E.; Devulder, A.; Buyse, B.; Testelmans, D.; Paesschen, W.V.; Vos, M.D. Automatic sleep staging and detection of sleep disorders through wearable EEG monitoring devices. Sleep Med. 2024, 115. [Google Scholar] [CrossRef]
  21. Sneineh, A.A.; Shabaneh, A.A. Design of a smart hydroponics monitoring system using an ESP32 microcontroller and the Internet of Things. MethodsX 2023, 11, 102401. [Google Scholar] [PubMed]
  22. Jahnavi, T.S.; Thumma, N.; Reddy, K.A.; Teja, U.V.; Gunasree, M.; Kiran, M. Health monitoring smart glove using esp32 microcontroller. J. Phys. Conf. Ser. 2022, 2325, 012007. [Google Scholar]
  23. Li, P.; Deng, X. An intelligent plant growth monitoring system based on ESP32 and IoT resource explorer platform. J. Electron. Inf. Sci. 2023, 8, 21–32. [Google Scholar]
  24. Ferraz, R.D.S.; Fonseca, R.S.D.; Rodrigues, I.T.; Silva, C.B.D. Surface Electromyographic Signal Acquisition System for Real Time Monitoring of Upper Limbs Muscles. J. Comput. Theor. Nanosci. 2021, 18, 1147–1152. [Google Scholar]
  25. Vogrin, S.J.; Plummer, C. EEG Source Imaging-Clinical Considerations for EEG Acquisition and Signal Processing for Improved Temporo-Spatial Resolution. J. Clin. Neurophysiol. Off. Publ. Am. Electroencephalogr. Soc. 2024, 41, 8–18. [Google Scholar]
  26. Abe, C.U.; Mateus, M.; Bruno, B.; Vieira, T.D. MAX30102 Photometric Biosensor Coupled to ESP32-Webserver Capabilities for Continuous Point of Care Oxygen Saturation and Heartrate Monitoring. Eng. Proc. 2021, 16, 9. [Google Scholar] [CrossRef]
  27. Asimkiran, D.; Bhaskar, M. Design of Intrusion Detection System Using GA and CNN for MQTT-Based IoT Networks. Wirel. Pers. Commun. 2024, 134, 2059–2082. [Google Scholar]
  28. Hanif, A.A.; Ilyas, M. Effective Feature Engineering Framework for Securing MQTT Protocol in IoT Environments. Sensors 2024, 24, 1782. [Google Scholar] [CrossRef] [PubMed]
  29. Akshatha, P.S.; Kumar, S.D. MQTT and blockchain sharding: An approach to user-controlled data access with improved security and efficiency. Blockchain Res. Appl. 2023, 4, 100158. [Google Scholar]
  30. Shao, Z.T.; Huang, M.X.; Wu, D.; Zhang, X.; Huang, A. Design of a Simplified Wireless Sensor Network Node Based on MQTT Protocol. arXiv 2019, arXiv:1906.10540. [Google Scholar]
  31. Yeh, Y.C.; Haasdonk, B.; Schmid-Staiger, U.; Stier, M.; Tovar, G.E. A novel model extended from the Bouguer-Lambert-Beer law can describe the non-linear absorbance of potassium dichromate solutions and microalgae suspensions. Front. Bioeng. Biotechnol. 2023, 11, 1116735. [Google Scholar] [CrossRef] [PubMed]
  32. Chu, Y.; Tang, K.; Hsu, Y.-C.; Huang, T.; Wang, D.; Li, W.; Savitz, S.I.; Jiang, X. Non-invasive arterial blood pressure measurement and SpO2 estimation using PPG signal: A deep learning framework. BMC Med. Inform. Decis. Mak. 2023, 23, 131. [Google Scholar]
  33. Biagetti, G.; Crippa, P.; Falaschetti, L.; Orcioni, S.; Turchetti, C. Reduced complexity algorithm for heart rate monitoring from PPG signals using automatic activity intensity classifier. Biomed. Signal Process. Control 2019, 52, 293–301. [Google Scholar] [CrossRef]
  34. PavanKalyan, I.; Santosh, G.J.; Prasad KH, K.; Nandan, D. Study of Echo Cancellation approach by using Least Mean Square (LMS) Algorithm. J. Phys. Conf. Ser. 2021, 1714, 012053. [Google Scholar]
  35. Tagore, S.; Reche, A.; Paul, P.; Deshpande, M. Electromyography: Processing, Muscles’ Electric Signal Analysis, and Use in Myofunctional Orthodontics. Cureus 2023, 15, e50773. [Google Scholar] [PubMed]
  36. Hyelim, K.; Soohyeon, R.; Sora, H.; Daeyoung, L.; Wonyoung, J. Fabrication of Textile-Based Dry Electrode and Analysis of Its Surface EMG Signal for Applying Smart Wear. Polymers 2022, 14, 3641. [Google Scholar] [CrossRef] [PubMed]
  37. Dustin, C.O.; Paola, M.A.; Rigoberto, F.D.; Israel, P.; Héctor, M.V. Evaluation of features and channels of electroencephalographic signals for biometric systems. EURASIP J. Adv. Signal Process. 2024, 2024, 58. [Google Scholar]
  38. Devi, S.; Guha, K.; Baishnab, K.L.; Iannacci, J.; Krishnaswamy, N. Survey on various architectures of preamplifiers for electroencephalogram (EEG) signal acquisition. Microsyst. Technol. 2022, 28, 995–1009. [Google Scholar] [CrossRef]
Figure 1. Overall system schematic design.
Figure 1. Overall system schematic design.
Electronics 13 02902 g001
Figure 2. Hardware design diagram.
Figure 2. Hardware design diagram.
Electronics 13 02902 g002
Figure 3. MQTT communication mode.
Figure 3. MQTT communication mode.
Electronics 13 02902 g003
Figure 4. MQTT client release a subscription model.
Figure 4. MQTT client release a subscription model.
Electronics 13 02902 g004
Figure 5. Client authentication settings.
Figure 5. Client authentication settings.
Electronics 13 02902 g005
Figure 6. Status of back-end client connections.
Figure 6. Status of back-end client connections.
Electronics 13 02902 g006
Figure 7. System workflow diagram.
Figure 7. System workflow diagram.
Electronics 13 02902 g007
Figure 8. Typical PPG waveform diagram.
Figure 8. Typical PPG waveform diagram.
Electronics 13 02902 g008
Figure 9. LMS adaptive filter.
Figure 9. LMS adaptive filter.
Electronics 13 02902 g009
Figure 10. Measurement of blood oxygen/heart rate before filtering.
Figure 10. Measurement of blood oxygen/heart rate before filtering.
Electronics 13 02902 g010
Figure 11. Measurement of blood oxygen/heart rate after filtering.
Figure 11. Measurement of blood oxygen/heart rate after filtering.
Electronics 13 02902 g011aElectronics 13 02902 g011b
Figure 12. Principle of EMG acquisition.
Figure 12. Principle of EMG acquisition.
Electronics 13 02902 g012
Figure 13. Electrode position in international 10–20 lead system.
Figure 13. Electrode position in international 10–20 lead system.
Electronics 13 02902 g013
Figure 14. Hardware diagram of the monitoring system.
Figure 14. Hardware diagram of the monitoring system.
Electronics 13 02902 g014
Figure 15. Pictures of device wearing.
Figure 15. Pictures of device wearing.
Electronics 13 02902 g015
Figure 16. Subscription interface.
Figure 16. Subscription interface.
Electronics 13 02902 g016
Figure 17. Heart rate and blood oxygen display interface diagram.
Figure 17. Heart rate and blood oxygen display interface diagram.
Electronics 13 02902 g017
Figure 18. EMG and EEG data collection page.
Figure 18. EMG and EEG data collection page.
Electronics 13 02902 g018
Figure 19. Signal data storage.
Figure 19. Signal data storage.
Electronics 13 02902 g019
Figure 20. Raw data plots of EMG and EEG signals.
Figure 20. Raw data plots of EMG and EEG signals.
Electronics 13 02902 g020
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.

Share and Cite

MDPI and ACS Style

Xiong, A.; Wu, T.; Jia, J. Design of a Real-Time Monitoring System for Electroencephalogram and Electromyography Signals in Cerebral Palsy Rehabilitation via Wearable Devices. Electronics 2024, 13, 2902. https://doi.org/10.3390/electronics13152902

AMA Style

Xiong A, Wu T, Jia J. Design of a Real-Time Monitoring System for Electroencephalogram and Electromyography Signals in Cerebral Palsy Rehabilitation via Wearable Devices. Electronics. 2024; 13(15):2902. https://doi.org/10.3390/electronics13152902

Chicago/Turabian Style

Xiong, Anshi, Tao Wu, and Jingtao Jia. 2024. "Design of a Real-Time Monitoring System for Electroencephalogram and Electromyography Signals in Cerebral Palsy Rehabilitation via Wearable Devices" Electronics 13, no. 15: 2902. https://doi.org/10.3390/electronics13152902

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop