CN113274036A - Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 - Google Patents
Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 Download PDFInfo
- Publication number
- CN113274036A CN113274036A CN202110719164.XA CN202110719164A CN113274036A CN 113274036 A CN113274036 A CN 113274036A CN 202110719164 A CN202110719164 A CN 202110719164A CN 113274036 A CN113274036 A CN 113274036A
- Authority
- CN
- China
- Prior art keywords
- electroencephalogram
- data
- ads1299
- receiving
- stm32
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7203—Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7225—Details of analog processing, e.g. isolation amplifier, gain or sensitivity adjustment, filtering, baseline or drift compensation
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Biophysics (AREA)
- Heart & Thoracic Surgery (AREA)
- Physiology (AREA)
- Psychiatry (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Veterinary Medicine (AREA)
- Pathology (AREA)
- Biomedical Technology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Molecular Biology (AREA)
- Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Public Health (AREA)
- Power Engineering (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention relates to the technical field of medical equipment, in particular to an electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266, which has the characteristics of simplicity, easiness in use and high precision and can provide guarantee for further electroencephalogram research; the method comprises the following steps: the analog front end adopts an ADS1299 integrated chip and is used for receiving the electroencephalogram signal after low-pass filtering preprocessing, filtering, amplifying and performing analog-to-digital conversion on the electroencephalogram signal and sending the processed electroencephalogram signal; the microcontroller adopts STM32F103 and is used for receiving the electroencephalogram signals processed by the analog front end, processing the read electroencephalogram signals and sending the processed data; the wireless module adopts a NodeMCU and is used for receiving the processed data sent by the microcontroller and transmitting the data to the upper computer through Wi-Fi communication; and the upper computer is used for receiving the data sent by the wireless module and analyzing, processing and displaying the data.
Description
Technical Field
The invention relates to the technical field of medical equipment, in particular to an electroencephalogram acquisition system based on ADS1299, STM32 and ESP 8266.
Background
The electroencephalogram signals are weak sine-like waves, and the amplitude is between 0.5 and 200uV, so the acquisition of the electroencephalogram signals needs high-magnification. When the brain is stimulated by the outside, thought or the body state changes, the frequency and amplitude of the brain waves change. When being stimulated by the outside, the human brain can quickly respond within 1s and generate complex brain wave signals. Therefore, the electroencephalogram acquisition equipment must have sufficient accuracy and timely response capability;
for years, data are transmitted in a wired mode for electroencephalogram signal acquisition, and although the data have the characteristic of high stability, the wired transmission mode cannot meet the requirements of researchers with continuous progress of electroencephalogram acquisition technologies. The wired data transmission mode limits the tested moving range, and even leads are wound mutually and the like; most of electroencephalogram acquisition system equipment on the market is large in size, high in requirements for working environment and high in price, and the electroencephalogram acquisition system equipment becomes a barrier for electroencephalogram research to a certain extent.
Disclosure of Invention
In order to solve the technical problems, the invention provides the electroencephalogram acquisition system based on the ADS1299, the STM32 and the ESP8266, which has the characteristics of simplicity, easiness in use and high precision and can provide guarantee for further electroencephalogram research.
The invention relates to an electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266, which comprises:
the analog front end adopts an ADS1299 integrated chip and is used for receiving the electroencephalogram signal after low-pass filtering preprocessing, filtering, amplifying and performing analog-to-digital conversion on the electroencephalogram signal and sending the processed electroencephalogram signal;
the microcontroller adopts STM32F103 and is used for receiving the electroencephalogram signals processed by the analog front end, processing the read electroencephalogram signals and sending the processed data;
the wireless module adopts a NodeMCU and is used for receiving the processed data sent by the microcontroller and transmitting the data to the upper computer through Wi-Fi communication;
and the upper computer is used for receiving the data sent by the wireless module and analyzing, processing and displaying the data.
According to the electroencephalogram acquisition system based on the ADS1299, the STM32 and the ESP8266, data transmission is carried out among the analog front end, the microcontroller and the wireless module through an SPI communication protocol.
The electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 has the sampling frequency of 500 Hz.
Compared with the prior art, the invention has the beneficial effects that: the traditional electroencephalogram acquisition system with wires obstructs the free activity of a patient, and the signal acquisition of the electroencephalogram system with wires can also generate the influence of poor contact and the like due to the activity of the patient; from the perspective of a doctor, the electroencephalogram data can have stronger interaction with the electroencephalogram data of a patient, and the electroencephalogram data can be checked by connecting a public network; for the patient, the electroencephalogram signals can be visualized on the interface of the public network, and the patient can be helped to know the physical condition of the patient.
Drawings
FIG. 1 is a communication flow diagram of the present invention;
FIG. 2 is a pin diagram of a radio NodeMCU module;
FIG. 3 is a pin diagram of microcontroller STM 32;
fig. 4 is a pin diagram of the analog front end ADS 1299.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
The overall framework of the electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 is as follows: first, analog signals of 8 channels are acquired using a standard electroencephalogram cap, and high resolution is obtained using a 24-bit high-precision analog front end ADS 1299. The digital signals are then transmitted to a main control module taking STM32F103ZET6 as a core through an SPI interface. The main control module can carry out relevant control on ADS1299 through the SPI bus, simultaneously transmits digital signals to the NodeMCU through the SPI interface, and the NodeMCU transmits the upper computer through the Wi-Fi module, and the upper computer can display and store electroencephalogram signals in real time, thereby providing convenience for further analysis and research. The sampling rate of the electroencephalogram acquisition system is 500Hz, and the electrode placement position refers to the international 10-20 system standard. Collecting spontaneous electroencephalogram, wherein the positions of the communicated 8-channel electrodes are as follows in sequence: p3, P4, Pz, O1, Oz, O2, T7; the system is divided into three parts, namely an analog front end, a microcontroller and a wireless module;
the core of the system is an ADS1299 simulation front end used by TI company for measuring biopotential, the integrated simulation front end has all common characteristics required by electroencephalogram application, and the system adopts an ADS1299 device to collect electroencephalogram signals of 8 channels;
STM32F103 is selected as a main controller, and the controller provides a Serial Peripheral Interface (SPI), so that the ADS1299 can be conveniently read and the Wi-Fi module can be controlled; in the system, the main controller STM32F103ZET6 communicates with slave devices such as ADS1299 through the SPI. The main controller works in a main mode of SPI and is mainly responsible for acquiring initialization of a front end, including channel activation, gain and offset setting of each channel and the like;
for wirelessly transmitting 8-channel electroencephalogram data, the Bluetooth module is required to have higher transmission rate, so the NodeMCU has the requirement of satisfying 8-channel data transmission.
Each module is introduced in detail:
1. ADS1299 module:
1) ADS1299 introduction:
the ADS1299 from TI is an 8-way low noise simultaneous sampling 24-bit delta-sigma ADC with built-in Programmable Gain Amplifier (PGA), reference voltage and oscillator, integrating the general features required for electroencephalogram (EEG). The device has a very low input reference noise of 1.0uVPP (70Hz BW). The power consumption of each path is 5mW, the input bias current is 300pA, the data rate is 250 sps-16 ksps, C1.0uVPP (70Hz BW), CMMR is-110 dB, the programmable gain is 1, 2, 4, 6, 8, 12 or 24, and a unipolar or bipolar power supply works. The method is mainly used for high-precision multi-channel signal acquisition of medical instruments such as EEG and ECG, auditory evoked potential (EAP) electroencephalogram Bispectral Index (BIS), sleep research monitoring and the like.
The internal registers of ADS1299 enable it to perform major functions such as changing the input mode of the signal, amplification, sampling rate, etc. The ADS1299 is initialized prior to acquiring data. Firstly, pulling up a PWDN pin, and electrifying the inside of a chip; and pulling down a RESET pin, resetting the chip, pulling down a CS pin and selecting an SPI interface. Then, an SDATAC command and a WREG command are transmitted, the CONFIG1, CONFIG2, CONFIG3 registers and registers of the respective channels are configured, and an additional function is set. And finally, data sampling is carried out, the ADS1299 waits for reading, and the initialization flow is ended. ADS1299 communicates with the main control module through the SPI interface to realize synchronous receiving and sending of data. The SPI communication of the ADS1299 is in a four-wire system including the clock signal SCLK, the data input line DIN, the data output line DOUT, and the chip select line CS. ADS1299 can only operate in slave mode for SPI communication.
2) The communication between ADS1299 and STM32 in the invention is introduced as follows:
the STM32F103ZET6 operates in the SPI master mode, and is mainly responsible for configuring the on/off of each input terminal of the ADS1299, setting the register of the ADS1299, the amplification factor of a programmable amplifier (PGA), the value of the sampling frequency, and the like. In the system, the amplification factor of the PGA is 24, and the sampling frequency is 500 Hz. And after the single chip microcomputer detects the DRDY falling edge signal, the high-resolution digital signal converted by the ADS1299 is read. The uploading transmission rate of the data is as follows:
throughput=x×3(B/ch)×8(bit/B)×(1/T);
wherein, the throughput is the number of data bits per second (bit/s); t is a sampling period; x is the number of leads. The sampling frequency in this design is 500Hz, so T is 0.002 and x is 8. The required upload rate can be calculated to be 96000 bits/s.
2. STM32 module
1) STM32F103ZET6 introduction
STM32F103ZET6 is an embedded-microcontroller Integrated Circuit (IC) that is one of the STM32F1 family developed by ST corporation, with a core size of 32 bits, a main frequency speed of 72MHz, a program memory capacity of 256KB, a program memory type of FLASH, and a RAM capacity of 48K.
STM32F103ZET6 possesses resources including: 64KB SRAM, 512KB FLASH, 2 basic timers, 4 universal timers, 2 advanced timers, 2 DMA controllers (12 channels in total), 3 SPI, 2 IIC, 5 serial ports, 1 USB, 1 CAN, 3 12-bit ADC, 1 12-bit DAC, 1 SDIO interface, 1 FSMC interface and 112 universal IO ports.
STM32F103ZET6, where STM32 represents a 32-bit microcontroller with ARM Cortex-M3 core; f represents a chip sub-series; 103 represents an enhanced series; z represents the pin number, wherein T represents 36 pins, C represents 48 pins, R represents 64 pins, V represents 100 pins, and Z represents 144 pins; e represents the capacity of the embedded Flash, wherein 6 represents 32K bytes Flash, 8 represents 64K bytes Flash, B represents 128K bytes Flash, C represents 256K bytes Flash, D represents 384K bytes Flash, and E represents 512K bytes Flash; the term T represents a package, wherein H represents a BGA package, T represents an LQFP package, and U represents a VFQFPN package; the term 6 represents the working temperature range, where 6 represents-40-85 ℃ and 7 represents-40-105 ℃.
2) STM32F103ZET6 SPI function profile
SPI is an abbreviation for Serial Peripheral interface, as the name implies. The SPI is a high-speed, full-duplex, synchronous communication bus, and only occupies four wires on the pins of the chip, thus saving the pins of the chip, and simultaneously providing convenience for saving space on the layout of the PCB.
The SPI has the advantages of few signal lines, simple protocol, high data rate and the like. Data transfer rates up to several MB/s; the maximum clock frequency of SPI communication of STM32F103ZET6 is 18 MHz;
the standard SPI uses 4Pin for data transfer: MOSI-master data out, slave data in,
3) STM32F103ZET6 action in the invention
ADS1299 transmits the digital signal obtained by sampling to STM32 through SPI interface, STM32 processes the data (format conversion), transmits to NodeMCU through SPI interface to process next step, the detailed flow is as follows:
the data transmitted by the ADS1299(8 channel) is received through the SPI communication interruption, the interruption is carried out once every 2ms (the sampling rate is 500Hz), then the data is converted from the Hex data format into the Hex data format of ASCII code (one byte is converted into two bytes), and the frame header, the frame number and the checksum are added to form the data of one frame. After preparing a frame of data, the PC6 (data ready pin) 50us is pulled high, and SPI transmission is performed after the NodeMCU detects it.
3. NodeMCU module
1) NodeMCU introduction
NodeMCU is an open source IoT (Internet of things) development board packaged well on the basis of esp8266-12E
The nodecu development kit/board consists of an ESP8266 wifi enabled chip. The ESP8266 is a low-cost Wi-Fi chip developed through the TCP/IP protocol of an Espressf system. The nodmcu development kit has similar analog (i.e., a0) and digital (D0-D8) pins Arduino on its circuit board. The NodeMCU development board has a wifi function, an analog pin, a digital pin and a serial communication protocol. It supports serial communication protocols, i.e., UART, SPI, I2C, etc.
2) The function of the NodeMCU in the invention
The NodeMCU undertakes the work of SPI communication and Wi-Fi communication in our project.
SPI communication: the nodmcu receives data from STM32 through the SPI interface, frame by frame, with a data size of 2407 bytes per frame. When the PC6 pin of STM32 is pulled high (the pulling high maintaining time of the PC6 pin is 50us) indicates that one frame of data is ready, the NodeMCU is informed that the transmission can be carried out. When the nodecu detects a high level signal of D1 (PC6 connected to STM 32), it starts receiving data by SPI, and ends after receiving one frame, and stores the received one frame data in str array. Wi-Fi communication: the NodeMCU is connected with the Wi-Fi and sends one frame of data to the cloud server through a POST request in the HTTP. Therefore, the data transmission of one frame is realized.
The communication protocol of the invention is as follows: the sample data of each channel is represented by 3 bytes, the sample data of each channel is 8 × 3 to 24 bytes, and the original data amount is 24 × 500 to 12000 bytes/s (12 KB/s). In order to adapt to the HTTP protocol, 3 bytes of each channel are converted into 6 bytes for transmission. The number of bytes collected in one second is: 500 × 8 × 3 × 2 ═ 24000B (24KB,24 kbyte). The data amount of one sample is 8 × 3 × 2 ═ 48B (48 bytes), and the data amount of 50 samples is: 50 × 8 × 3 × 2 ═ 50 × 48 ═ 2400B (2.4KB,2.4 kbyte). The 50 samples are 1 frame of data, plus 2 bytes of header, 4 bytes of frame number, 1 byte of checksum (high order discard). Therefore, the 1 frame data size is: 2407 bytes. One second requires 10 frames of data to be transmitted, the nodmcu processes one frame (2407(3 × 8 × 2 × 50+7) bytes) 100ms, including SPI reception and Wi-Fi transmission to the server.
The data processing of the invention: the STM32 transmits the converted data, one HEX (hexadecimal) byte is converted into two ASCII code transmissions, one channel of original data is 3 bytes, the converted data is 6 bytes, the total data size after one conversion is 48 bytes, the data length of each frame is 2407 bytes, the data comprises 50 samples, each frame is spaced by 100ms, 10 frames of data are transmitted in 1 second, and the communication data size is 2407 × 10 — 24.07 KB/s.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (3)
1. An electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266, comprising:
the analog front end adopts an ADS1299 integrated chip and is used for receiving the electroencephalogram signal after low-pass filtering preprocessing, filtering, amplifying and performing analog-to-digital conversion on the electroencephalogram signal and sending the processed electroencephalogram signal;
the microcontroller adopts STM32F103 and is used for receiving the electroencephalogram signals processed by the analog front end, processing the read electroencephalogram signals and sending the processed data;
the wireless module adopts a NodeMCU and is used for receiving the processed data sent by the microcontroller and transmitting the data to the upper computer through Wi-Fi communication;
and the upper computer is used for receiving the data sent by the wireless module and analyzing, processing and displaying the data.
2. The ADS1299, STM32 and ESP 8266-based electroencephalogram acquisition system of claim 1, wherein the analog front end, the microcontroller and the wireless module are in data transmission via SPI communication protocol.
3. The ADS1299, STM32 and ESP 8266-based electroencephalogram acquisition system of claim 1, wherein the sampling frequency is 500 Hz.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110719164.XA CN113274036A (en) | 2021-06-28 | 2021-06-28 | Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110719164.XA CN113274036A (en) | 2021-06-28 | 2021-06-28 | Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113274036A true CN113274036A (en) | 2021-08-20 |
Family
ID=77285826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110719164.XA Pending CN113274036A (en) | 2021-06-28 | 2021-06-28 | Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113274036A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114668947A (en) * | 2021-12-21 | 2022-06-28 | 北京师范大学 | Operating system and method for sleep TMR based on EEG |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102512159A (en) * | 2011-12-08 | 2012-06-27 | 西安交通大学 | Portable wireless electroencephalogram acquisition device |
CN105395193A (en) * | 2015-12-08 | 2016-03-16 | 天津大学 | Miniature wearable electroencephalogram acquisition device |
US20190247664A1 (en) * | 2016-06-10 | 2019-08-15 | Jack Williams | System for wireless recording and stimulating bioelectric events |
-
2021
- 2021-06-28 CN CN202110719164.XA patent/CN113274036A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102512159A (en) * | 2011-12-08 | 2012-06-27 | 西安交通大学 | Portable wireless electroencephalogram acquisition device |
CN105395193A (en) * | 2015-12-08 | 2016-03-16 | 天津大学 | Miniature wearable electroencephalogram acquisition device |
US20190247664A1 (en) * | 2016-06-10 | 2019-08-15 | Jack Williams | System for wireless recording and stimulating bioelectric events |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114668947A (en) * | 2021-12-21 | 2022-06-28 | 北京师范大学 | Operating system and method for sleep TMR based on EEG |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104958070A (en) | Vital sign monitoring system | |
CN110161342B (en) | Electric energy quality monitoring system and method | |
CN103637784B (en) | Based on the physiological parameter acquisition system of ZigBee technology | |
CN105395193A (en) | Miniature wearable electroencephalogram acquisition device | |
CN113274036A (en) | Electroencephalogram acquisition system based on ADS1299, STM32 and ESP8266 | |
CN208892553U (en) | Wireless body temperature measuring device | |
CN111174833A (en) | Data acquisition device for plant bioelectricity and moisture transmission parameters | |
CN202051703U (en) | 12 lead wireless real-time electrocardio (ECG) monitoring and analysis system | |
WO2006113263A1 (en) | A wireless patient monitoring system | |
CN211749691U (en) | 2.4G-based heart sound sensor diagnosis and treatment system | |
CN210036821U (en) | Agricultural input physical and chemical characteristic collecting equipment | |
CN202859092U (en) | Household wireless sign monitoring instrument | |
CN106798546A (en) | Data acquisition process terminal | |
Lili et al. | Portable ecg monitoring system design | |
CN220801016U (en) | Electrocardiogram acquisition device based on wireless transmission | |
CN107121958B (en) | Multichannel mixed signal acquisition system for medical rehabilitation equipment | |
Wang | Design of ECG acquisition system based on Bluetooth wireless communication | |
CN211181045U (en) | Wisdom agricultural is with multi-functional temperature and humidity sensor | |
CN113180674A (en) | Miniature implantable neural signal recording system | |
Li et al. | A Wearable EEG Real-time Measure and Analysis Platform for Home Applications | |
CN203828923U (en) | Electrocardiogram monitoring system based on wireless communication | |
CN203851143U (en) | Sports equipment data acquisition and transmission device | |
CN115844417A (en) | Electrocardio collection system based on wireless transmission | |
CN208031196U (en) | The circuit structure of hospital inpatient area intelligent acquisition system based on Internet of Things | |
CN116491957A (en) | Electroencephalogram signal acquisition system based on KS1092, ADS1256 and STM32 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |