This is an old revision of the document!


OpenBCI & ESP32

Master: ACES
Student: Razvan Trombitas

1. Project overview

This project uses an EEG headset with 8 channels, of which only 4 are used, to collect EEG signals. The signals are acquired using an OpenBCI Cyton board and transmitted via Bluetooth using a USB dongle to a serial port. The data is then read in real-time from the serial port and processed using an ESP32 microcontroller. The level of attention, concentration, and stress are determined and sent to Firebase for display on graphs. In addition, the EEG waveforms are plotted in real-time for the 4 channels used. A moving average filter and FFT are also applied to the input signal. The code for the project is written using the Arduino IDE.

2. Hardware

3. Software

The code provided includes WiFi, AsyncTCP, ESPAsyncWebServer, WebSerial, string, SPIFFS, Firebase_ESP_Client, and Arduino TFT libraries. It also includes the use of TokenHelper and RTDBHelper for generating tokens and printing RTDB payloads. The code uses a predefined constant for wifi credentials, Firebase project API key, Authorized Email and Corresponding Password, and RTDB URLs. It also has a number of variables for storing and processing EEG data, including arrays for holding EEG data, band power values, and indices for band power calculation.

Additionally, it uses the ESPAsyncWebServer library to handle web requests and the WebSerial library to handle serial communication. The project also includes the use of the Arduino TFT library to perform FFT on the input EEG signals. This allows for the analysis of the frequency content of the signals, which can provide additional information about the brain activity being recorded.

The code uses the Firebase_ESP_Client library to communicate with the Firebase Real-time Database (RTDB) to store and retrieve data. The RTDB stores the EEG data, attention, concentration, and stress levels, which are then displayed on graphs. The FirebaseAuth and FirebaseConfig classes are used to authenticate and configure the connection to the RTDB.

A lot of variables for storing and processing EEG data, including arrays for holding EEG data, band power values, and indices for band power calculation. For calculating attention, concentration, and stress level, the project uses some mathematical calculations using band power values. The code also includes a check for the interval of sending data to firebase, and for this purpose, it uses the millis() function to check the elapsed time since the last data was sent.

Overall, this project demonstrates the use of various technologies and libraries, including EEG hardware, microcontroller programming, Bluetooth communication, web server programming, and database integration, to create a system for collecting, processing, and visualizing EEG data in real-time.

4. Results and demonstration

5. Conclusions

6. References

iothings/proiecte/2022/open_bci_esp32.1674156058.txt.gz · Last modified: 2023/01/19 21:20 by razvan.trombitas
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0