Brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer
By integrating the TGMA EEG acquisition module and the ESP8266 wireless communication module on the STM32 microcontroller, combined with the music playback function, the problems of complex operation and high cost of traditional brain fatigue detection instruments are solved, portability and real-time detection are achieved, and effective Brain fatigue monitoring and mitigation programs.
Patent Information
- Application Number
- CN202323035559.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional multi-channel brain fatigue detection instruments are complex and expensive, resulting in research only staying in the laboratory stage, lacking portability and real-time detection capabilities, making it difficult to effectively monitor and alleviate brain fatigue in actual environments.
A brain fatigue detection and recovery system based on TGMA and STM32 microcontrollers was designed, including power supply module, control module, wireless transmission module, EEG acquisition module and music playback module, and transmit EEG data to the upper computer for processing and analysis through Bluetooth. , and use the ESP8266 module to send control commands in real time to play music to relieve fatigue.
It realizes portability, wireless connection and real-time detection, reduces equipment costs, improves operation ease, and can monitor EEG activities in real time in different environments, provide timely feedback, help users self-regulate and relax, and effectively alleviate brain fatigue.
Smart Images

Figure CN222110047U_ABST
Abstract
Description
Technical Field
[0001] The utility model belongs to the technical field of sensor detection, and specifically relates to a brain fatigue detection and recovery system based on TGMA and an STM32 single-chip microcomputer. Background Art
[0002] With the rapid development of science and technology and industrialization, the pace of modern society has gradually accelerated, competition between people has become more intense, and work pressure has continued to increase. Technological progress has led to fundamental changes in the general direction of social development, and the mainstream of society has gradually shifted from physical labor to mental labor. Therefore, brain fatigue has become a common phenomenon.
[0003] The harm caused by brain fatigue is huge: on the one hand, brain fatigue damages people's physical health, and long-term brain fatigue increases the risk of human illness; on the other hand, brain fatigue can also cause a series of problems such as inattention, slow reaction, and decision-making bias when workers perform tasks, thereby increasing the risk of safety accidents and casualties. Therefore, the research on mental fatigue detection methods has become an important topic in the field of safe production. Taking corresponding measures to relieve fatigue, avoid excessive use of the brain, and reduce work errors has important practical significance for solving safe production problems.
[0004] Traditional mental fatigue detection is based on 32-, 64-, 128- and 256-lead electroencephalographs. These acquisition devices are complex to operate, expensive, and require harsh experimental conditions, resulting in research on mental fatigue detection remaining in the laboratory research stage. Utility Model Content
[0005] The purpose of the utility model is to propose a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer to address the defect of low cost performance of traditional multi-channel brain fatigue detection instruments in the prior art.
[0006] In order to achieve the above purpose, the utility model provides a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer, characterized in that it includes a power module, a control module, a wireless transmission module, an EEG acquisition module and a music playing module, the power module is respectively connected to the control module, the wireless transmission module, the EEG acquisition module and the music playing module, the signal receiving end of the control module is connected to the host computer through the wireless transmission module, the host computer is connected to the EEG acquisition module through the wireless transmission module, and the signal output end of the control module is connected to the music playing module through the wireless transmission module.
[0007] The utility model collects EEG data from the subject through the EEG acquisition module, transmits the collected data to the host computer through Bluetooth for processing and analysis, and the host computer transmits the command to the main control microcontroller through the ESP8266 module, and the music playing circuit works, and the subject relieves brain fatigue by listening to music. The utility model has the advantages of low cost, small size, and easy operation.
[0008] The utility model further adopts the following technical solutions:
[0009] Preferably, the control module is welded on a PCB circuit board, and includes a main control chip, a crystal oscillator circuit and a reset circuit. The crystal oscillator circuit is connected to the main control chip, and the crystal oscillator circuit generates a crystal oscillator signal as a clock drive for the main control chip. The main control chip is respectively connected to the wireless transmission module and the music playback module. After the main control chip initializes each module, it receives and processes relevant information of the wireless communication module, and sends an instruction to the music playback module to play music. The reset circuit is connected to the main control chip and is used to reset the single-chip microcomputer system. When the single-chip microcomputer system is powered on or an abnormality occurs, the reset circuit can restore the single-chip microcomputer to its initial state, thereby ensuring the reliability and stability of the system.
[0010] After the system is powered on, the MCU minimum system starts to work and initializes the wireless transmission module and the music player module. The purpose of the reset circuit is to put the chip in the initial power-on state when the minimum system works abnormally. The main control chip controls the operation of the wireless transmission module ESP8266 and the music player module. It is necessary to call an initialization function for each module, so it is called initialization of each module.
[0011] Preferably, the main control chip is an STM32F103C8T6 single-chip microcomputer, and the STM32F103C8T6 single-chip microcomputer is peripherally provided with a crystal oscillator circuit and a reset circuit, the crystal oscillator circuit is composed of two crystal oscillators and a starting capacitor, and the reset circuit is composed of a pull-up resistor, a button and a filter capacitor.
[0012] Preferably, the wireless transmission module is welded on a PCB circuit board, and the wireless transmission module includes an ESP8266 communication module and a Bluetooth module, wherein the Bluetooth module is respectively connected to the EEG acquisition module and the host computer for communication, and is used for data transmission between the EEG acquisition module and the host computer, and the ESP8266 communication module is respectively connected to the main control chip and the host computer for communication, and realizes the sending and receiving of commands between the host computer and the main control chip. Since Bluetooth communication is used for data transmission between the EEG acquisition system and the host computer, and the host computer Bluetooth interface is limited, it is considered to use the ESP8266 communication module to send control instructions in real time.
[0013] Preferably, the EEG acquisition module includes a TGAM module and a dry electrode.
[0014] The above-mentioned EEG acquisition module is designed based on the TGAT chip and integrates functions such as amplification, filtering and analog-to-digital conversion. Considering that EEG signals are extremely weak and easily interfered biological signals, and considering the cost and reliability of the system, the utility model uses the existing EEG sensor module to design the EEG acquisition circuit. The EEG acquisition module adopts the TGAM module, which is a brain wave acquisition sensor module developed by Shennian Technology for the general public. It is designed with the TGAT chip as the core and integrates functions such as amplification, filtering and analog-to-digital conversion.
[0015] Preferably, the music playback module includes a MH3028M voice chip, a TF card slot and a 3.5mm dual-channel headphone jack.
[0016] The music playback module is designed with the voice chip as the core. The specific model is MH3028M, which is a voice chip based on the serial communication protocol. It can realize audio playback and adjustment functions through simple serial port commands, so that the subjects can recover from brain fatigue after listening to music. The TF card slot is used to read the memory card that has stored music, and the dual-channel headphone interface is used as an audio output device.
[0017] Preferably, the power module is composed of a battery pack and a power conversion circuit, and the battery pack is respectively connected to the control module, the wireless transmission module, the EEG acquisition module and the music playback module through the power conversion circuit.
[0018] In the above structure, after the voltage of the battery pack is stepped down by the power conversion circuit, the output ends provide the required working voltage for the control module, the wireless transmission module, the EEG acquisition module and the music playback module respectively.
[0019] Preferably, the battery pack is an external lithium battery, and the power conversion circuit includes an LM2596-5.0 buck chip and an AMS117-3.3 buck chip. The input end of the LM2596-5.0 buck chip is connected to the external lithium battery, and the output end is connected to the ESP8266 communication module and the input end of the AMS117-3.3 buck chip. The output end of the AMS117-3.3 buck chip is respectively connected to the main control chip, TGAT chip, TF card slot, and MH3028M voice chip. The LM2596-5.0 buck chip provides a +5V operating voltage for the ESP8266 communication module on the one hand, and is connected to the AMS117-3.3 buck chip on the other hand to further convert the +5V voltage into a 3.3V voltage.
[0020] In the above structure, the power conversion circuit is divided into two parts. The first part is 12V down to 5V. The buck chip used is LM2596-5.0, which generates a stable +5V voltage after voltage reduction according to the input voltage. The second part is +5 down to 3.3V. The buck chip used is AMS117-3.3, which converts +5V into 3.3V to provide low-noise, low-static and stable working voltage for the main control microcontroller and other modules.
[0021] Preferably, the host computer includes an STM32F103 series microcontroller and a data transmission interface designed based on matlab GUI.
[0022] The utility model adopts the STM32F103 series microcontroller with Cortex-M3 core, which has fast running speed, strong data processing ability and abundant peripheral communication modules, and can meet the data processing needs of the utility model.
[0023] Compared with the prior art, the beneficial effects of the present invention are as follows: compared with the traditional multi-channel EEG acquisition equipment, the present invention has the functions of portability, wireless connection, real-time detection, etc.
[0024] Portability: The utility model is small in size, easy to operate, and can be carried around, which allows users to monitor EEG activity in real time in different environments, such as home, office, or sports field;
[0025] Wireless connection: This utility model adopts wireless transmission technology, making data transmission more convenient. Users do not need to worry about the cable limitations that traditional devices may bring;
[0026] Real-time detection: The utility model monitors brain electrical activity in real time, providing timely data and feedback to help users better understand their own brain state. This is very beneficial for self-regulation and mastering relaxation techniques. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The utility model is further described below in conjunction with the accompanying drawings.
[0028] Figure 1 It is a schematic diagram of the workflow of the present utility model.
[0029] Figure 2 This is a circuit diagram of the power module in the utility model.
[0030] Figure 3 It is a circuit diagram of the control module in the utility model.
[0031] Figure 4 This is a circuit diagram of the Bluetooth module and the EEG module in the utility model.
[0032] Figure 5 It is a circuit diagram of the ESP8266 wireless communication module in the utility model.
[0033] Figure 6 It is a circuit diagram of the music playing module in the utility model. DETAILED DESCRIPTION Example 1
[0034] like Figure 1 As shown, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer includes a power module, a control module, a wireless transmission module, an EEG acquisition module and a music playing module. The power module is connected to the control module, the wireless transmission module, the EEG acquisition module and the music playing module respectively. The signal receiving end of the control module is connected to the host computer through the wireless transmission module, the host computer is connected to the EEG acquisition module through the wireless transmission module, and the signal output end of the control module is connected to the music playing module through the wireless transmission module. The host computer adopts the STM32F103 series microcontroller with Cortex-M3 core.
[0035] Among them, the power module consists of a battery pack and a power conversion circuit. The battery pack is connected to the control module, wireless transmission module, EEG acquisition module and music playback module respectively through the power conversion circuit. After the voltage of the battery pack is stepped down by the power conversion circuit, it provides the required working voltage for the control module, wireless transmission module, EEG acquisition module and music playback module respectively. The battery pack is powered by an external lithium battery with a rated voltage of 12V. The power conversion circuit is divided into two parts: the LM2596-5.0 buck chip and the AMS117-3.3 buck chip. The input end of the LM2596-5.0 buck chip is connected to the external lithium battery, and the output end provides a +5V working voltage for the ESP8266 communication module, and is connected to the input end of the AMS117-3.3 buck chip at the same time; the output end of the AMS117-3.3 buck chip is connected to the main control chip, TGAT chip, TF card slot, and MH3028M voice chip respectively. The LM2596-5.0 buck chip reduces the 12V voltage of the lithium battery input to 5V, generating a stable +5V voltage. The AMS117-3.3 buck chip reduces the +5V voltage of the LM2596-5.0 buck chip input to 3.3V, which is convenient for providing low-noise, low-static stable operating voltage for the main control microcontroller and other modules.
[0036] The control module is welded on the PCB circuit board, including the main control chip, crystal oscillator circuit and reset circuit. The crystal oscillator circuit is connected to the main control chip, and the crystal oscillator circuit generates a crystal oscillator signal as the clock drive of the main control chip; the main control chip is connected to the wireless transmission module and the music playback module respectively. After the main control chip initializes each module, it receives and processes the relevant information of the wireless communication module and issues a music playback instruction to the music playback module; the reset circuit is also connected to the main control chip to reset the single-chip system. When the single-chip system is powered on or an abnormality occurs, the reset circuit can restore the single-chip to the initial state to ensure the reliability and stability of the system. The control module is a minimum system composed of an STM32F103C8T6 single-chip microcomputer, a peripheral crystal oscillator circuit and a reset circuit. It is powered by a 3.3V DC voltage provided by a power module. The crystal oscillator circuit consists of two crystal oscillators of 32.768kHz and 8MHz and a starting capacitor; the reset circuit consists of a 10KΩ pull-up resistor, a button and a 10uF filter capacitor.
[0037] The wireless transmission module is welded on the PCB circuit board. The wireless transmission module includes an ESP8266 communication module and a Bluetooth module HC-08. The Bluetooth module HC-08 is connected to the EEG acquisition module and the host computer for communication and data transmission between the EEG acquisition module and the host computer; the ESP8266 communication module is connected to the main control chip and the host computer for communication and reception of commands between the host computer and the main control. The EEG acquisition module and the host computer use Bluetooth communication for data transmission, and the host computer and the main control chip use the ESP8266 communication module to send control instructions in real time. Among them, the HC-08 Bluetooth serial communication module is a data transmission module based on the Bluetooth 4.0 protocol. It uses the CC2540F256 chip solution of TI, which has the characteristics of low power consumption, good communication effect, and simple operation. The ESP8266 wireless communication module is selected to be mounted on the STM32F103C8T6 microcontroller to undertake the communication between the host computer and the EEG acquisition system. The ESP8266 module has a high-performance wireless core and powerful on-chip processing and storage capabilities. It can be used for motor or switch appliance control, data transmission, etc. It has the characteristics of fast communication speed and high stability.
[0038] The EEG acquisition module uses the TGAM module, which is a brain wave acquisition sensor module developed by Shennian Technology for the general public. It is designed with the TGAT chip as the core and integrates functions such as amplification, filtering and analog-to-digital conversion. Considering that EEG signals are extremely weak and easily interfered biological signals, and considering the cost and reliability of the system, the EEG acquisition circuit is designed using the existing EEG sensor module.
[0039] The music playback module includes the MH3028M voice chip, TF card slot and 3.5mm dual-channel headphone jack. The module is designed with the MH3028M voice chip as the core. It is a voice chip based on the serial communication protocol. It can realize audio playback and adjustment functions through simple serial port commands, so that the subjects can recover from brain fatigue after listening to music. The TF card slot is used to read the memory card that has stored music, and the dual-channel headphone jack is used as an audio output device.
[0040] like Figure 2 As shown in the figure, VBAT in the power module is an external battery interface with a voltage of 12V. S3 is a power switch. When the switch is pressed, the 12V voltage is filtered by resistors and capacitors and input into the LM2596-5.0 chip. The chip outputs a 5V voltage. At the same time, the 5V voltage indicator LED2 lights up, indicating that the output voltage is normal; after 5V is output from the output pin of the LM2596-5.0 chip, it is filtered and coupled by resistors and capacitors again and input into the AMS117-3.3 chip. The output pin of the AMS117-3.3 chip outputs a 3.3V voltage. At this time, the 3.3V voltage indicator LED1 lights up, indicating that the output voltage is normal.
[0041] like Figure 3 As shown in the figure, the control module consists of a main control chip, a crystal oscillator circuit and a reset circuit. There are two groups of crystal oscillator circuits, one group corresponds to the PC14 and PC15 pins of the single-chip microcomputer, and the required crystal oscillator value is 32.768KHZ; the other group corresponds to the PD0 and PD1 pins of the single-chip microcomputer, and the required crystal oscillator value is 8MHZ. The two groups of crystal oscillator circuits generate crystal oscillator signals as the clock drive of the main control chip. The reset circuit corresponds to the NRST pin of the main control chip, and an external pull-up resistor with a resistance value of 10K is connected. When the key KEY1 is pressed, the main control chip is in a reset state, and the NRST pin is pulled to a high level state to ensure the stability and reliability of the system.
[0042] like Figure 4 As shown, the EEG acquisition module is a TGMA module. After connecting the TGAM module to the HC-08 Bluetooth module via a serial cable, the communication baud rate is set to 57600bps. The TGAM module and the HC-08 Bluetooth module are powered by a 3.3V power supply;
[0043] like Figure 5As shown, the wireless transmission module ESP8266 has three working modes, namely STA, AP and STA+AP mode. The utility model sets the ESP8266 module to AP mode, and uses the host computer laptop to simulate the client connection module hotspot, which not only ensures the wireless transmission of data, but also meets the system's low energy consumption, low cost, and convenient operation communication function requirements. Pin 16 of ESP8266 is connected to the microcontroller PA10 pin, and pin 15 is connected to the microcontroller PA9 pin;
[0044] like Figure 6 As shown in the figure, the MH3028M chip of the music playback module is connected to the STM32F103 microcontroller through the serial port. The storage medium of the fatigue-relieving music file is a Micro SD card, and the card reader interface is a TF card slot. Considering the actual effect, headphones are selected as the audio output device, and the connector is a 3.5mm headphone interface, which supports left and right channels.
[0045] When in use, first stick the dry electrode of the EEG acquisition module to the frontal lobe of the subject with a gauze patch, and then connect an external lithium battery to power the system. After the single-chip computer is powered on, each module is initialized and the entire system is in a waiting state. When the system is working, the EEG acquisition module first collects the EEG data of the subject in the awake state, and uploads the EEG data to the upper computer interface designed based on the matlab GUI platform through the Bluetooth module. After preprocessing the EEG data, the existing wavelet transform is used to decompose the EEG signal into four sub-bands of δ, θ, α, and β, and the signal power spectrum density of each sub-band is calculated, and the power spectrum value of each frequency band is recorded. Existing relevant data show that when a person is in an awake state, the power spectrum density of the α band and the β band is higher; when a person is in a fatigued state, the power spectrum density of the δ band and the θ band increases, and the power spectrum density of the α band and the β band decreases. After a period of mental work, the subjects took the equipment to collect EEG data again, and the processing means and feature extraction methods were the same as before. The power spectrum density of each frequency band at this state is obtained. Compared with the awake state, if the power spectrum density of the α band and the β band is significantly reduced, and the power spectrum density of the δ band and the θ band is further increased, it means that the subject's brain is gradually fatigued. The host computer determines whether the subject's brain is fatigued based on the EEG data. When the subject's brain is in a fatigue state, the host computer sends instructions to the microcontroller through the ESP8266 communication module. After receiving the instructions, the microcontroller initializes the music playback circuit and lets it play light music. The subject listens to the music through the connected headphones to relieve the subject's brain fatigue. After a period of time, the EEG waveform of the subject after listening to the music is collected. Compared with the fatigue state, if the power spectrum density of the α band and the β band is found to be increased, and the power spectrum density of the δ band and the θ band is reduced, it means that the brain fatigue has been relieved to a certain extent.
[0046] In addition to the above embodiments, the present invention may also have other implementations. Any technical solution formed by equivalent replacement or equivalent transformation falls within the protection scope required by the present invention.
Claims
1. A brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer, characterized by: It includes a power module, a control module, a wireless transmission module, an EEG acquisition module and a music playing module. The power module is respectively connected to the control module, the wireless transmission module, the EEG acquisition module and the music playing module. The signal receiving end of the control module is connected to the host computer through the wireless transmission module, the host computer is connected to the EEG acquisition module through the wireless transmission module, and the signal output end of the control module is connected to the music playing module through the wireless transmission module.
2. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The control module is welded on a PCB circuit board, and includes a main control chip, a crystal oscillator circuit and a reset circuit. The crystal oscillator circuit is connected to the main control chip, the main control chip is respectively connected to a wireless transmission module and a music playing module, and the reset circuit is connected to the main control chip.
3. According to claim 2, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The main control chip is an STM32F103C8T6 single-chip microcomputer, and a crystal oscillator circuit and a reset circuit are arranged on the periphery of the STM32F103C8T6 single-chip microcomputer. The crystal oscillator circuit is composed of two crystal oscillators and a starting capacitor, and the reset circuit is composed of a pull-up resistor, a button and a filter capacitor.
4. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The wireless transmission module is welded on the PCB circuit board. The wireless transmission module includes an ESP8266 communication module and a Bluetooth module. The Bluetooth module is respectively connected to the EEG acquisition module and the host computer for communication. The ESP8266 communication module is respectively connected to the main control chip and the host computer for communication.
5. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The EEG acquisition module includes a TGAM module and a dry electrode.
6. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The music playback module includes a MH3028M voice chip, a TF card slot and a 3.5mm dual-channel headphone jack.
7. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The power module is composed of a battery pack and a power conversion circuit. The battery pack is respectively connected to the control module, the wireless transmission module, the EEG acquisition module and the music playing module through the power conversion circuit.
8. According to claim 7, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The battery pack is an external lithium battery, and the power conversion circuit includes an LM2596-5.0 buck chip and an AMS117-3.3 buck chip. The input end of the LM2596-5.0 buck chip is connected to the external lithium battery, and the output end is connected to the ESP8266 communication module and the input end of the AMS117-3.3 buck chip. The output end of the AMS117-3.3 buck chip is respectively connected to the main control chip, the TF card slot, the TGAT module, and the MH3028M voice chip.
9. According to claim 1, a brain fatigue detection and recovery system based on TGMA and STM32 single-chip microcomputer is characterized in that: The host computer includes an STM32F103 series microcontroller and a data transmission interface designed based on matlab GUI.
