Stay calm and focused: reduce stress while sending messages and emails.
"Touch the Grass" is an innovative neuro-feedback project designed to monitor and actively help users reduce stress and maintain focus while performing attention-demanding tasks, such as writing emails or chatting. It combines a real-time EEG processing backend with a cross-browser extension. It has been created during Neurohackaton Fall 2025 Wroclaw University of Science and Technology
- Real-Time EEG Monitoring: The Python backend uses a BrainAccess device to acquire and process EEG signals in real-time from Fp1 and Fp2 electrodes.
- Focus and Stress Metrics: It calculates
focusandstressmetrics from the EEG data, handles artifact rejection (e.g., movement), and streams the results to the frontend via a WebSocket server. - Simulation Mode: If the EEG device is unavailable or BrainAccess libraries aren't found, the server automatically switches to Simulation Mode, generating random data for testing and demonstration.
- Browser Integration: The Chrome/Edge extension runs in the background and uses content scripts to inject a user interface on virtually any website (
<all_urls>). - Configuration Mechanisms: The extension has host permissions for external services like YouTube and a Sudoku API and utilises them for metrics calibration to make measures of users max focus level and stress level with limited time tasks.
| Component | Technology | Description |
|---|---|---|
| Backend | Python, websockets, brainaccess SDK, mne |
Server for EEG acquisition and processing. Uses WebSocket on port 8765 for frontend communication. |
| Frontend | Chrome/Edge Extension (Manifest V3), JavaScript, HTML, CSS | Browser extension consuming data from the WebSocket and reacting to stress/focus levels. |
The project requires running the Python backend server separately and installing the browser extension.
- BrainAccess Halo
- Python 3
- Clone the repository (if not already done).
git clone [YOUR_REPO_LINK] cd neurohackathon-main - Create and activate a virtual environment (recommended).
- Linux:
python3 -m venv venv source venv/bin/activate - Windows:
python -m venv .venv .venv\Scripts\activate.bat
- Linux:
- Install dependencies:
The project relies on libraries like
brainaccess,mne,numpy, andwebsockets.pip install -r requirements.txt
- Run the EEG server:
The default device name is
"BA MINI 047". If you are using a different device, update theDEVICE_NAMEvariable inapp/backend/server.py.The server will listen onpython app/backend/server.py
ws://localhost:8765.
- Open your browser's extensions management page (e.g.,
chrome://extensions). - Enable Developer Mode.
- Click the Load unpacked button.
- Select the
app/extension/directory from the cloned repository. - The "Touch the Grass" extension should now be loaded and active.
neurohackathon-main/
├── app/
│ ├── backend/
│ │ ├── server.py
│ │ └── processor.py
│ ├── extension/
│ │ ├── icons/*
│ │ ├── videos/*
│ │ ├── background.js
│ │ ├── content.js
│ │ ├── manifest.json
│ │ ├── package.json
│ │ ├── popup.js
│ │ └── popup.html
├── requirements.txt
└── device-guide/