Skip to content

Commit 652f506

Browse files
committed
Update integration guide
1 parent 683502b commit 652f506

1 file changed

Lines changed: 61 additions & 6 deletions

File tree

EEG_INTEGRATION.md

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Universal EEG Device Integration
2-
3-
This branch adds **universal EEG hardware support** to PhantomLoop, including electrode placement and signal quality monitoring for multiple EEG devices, with Brainflow integration.
1+
# EEG Device Integration
42

53
## 🎯 Supported Devices
64

@@ -14,19 +12,27 @@ This branch adds **universal EEG hardware support** to PhantomLoop, including el
1412
| **Muse** | Muse S | 4 | 256 Hz | 21 | BLE |
1513
| **Emotiv** | Insight | 5 | 128 Hz | 25 | BLE |
1614
| **Emotiv** | EPOC X | 14 | 128/256 Hz | 26 | BLE |
15+
| **PiEEG** | PiEEG | 8 | 250-16000 Hz | 46 | SPI (Raspberry Pi) |
16+
| **PiEEG** | PiEEG-16 | 16 | 250-8000 Hz | 47 | SPI (Raspberry Pi) |
17+
| **PiEEG** | IronBCI | 8 | 250 Hz | N/A* | BLE/WiFi |
18+
| **PiEEG** | IronBCI-32 | 32 | 250 Hz | N/A* | WiFi |
19+
| **PiEEG** | JNEEG | 8 | 250-2000 Hz | N/A* | SPI (Jetson Nano) |
20+
| **PiEEG** | ardEEG | 8 | 250 Hz | N/A* | Serial (Arduino) |
21+
| **PiEEG** | MicroBCI | 8 | 250 Hz | N/A* | BLE (STM32) |
1722
| **Cerelog** | ESP-EEG | 8 | 250 Hz | N/A* | WiFi (TCP) |
1823
| **Brainflow** | Synthetic | 8 | 250 Hz | -1 | Virtual |
1924

20-
*Cerelog ESP-EEG requires a WebSocket bridge (included).
25+
*Requires WebSocket bridge (included).
2126

2227
## ⚠️ Browser Connectivity
2328

2429
**Browsers cannot open raw TCP, Serial, or Bluetooth connections directly.**
2530

2631
For hardware devices, you need a **WebSocket bridge** that runs locally and proxies the device data to the browser. This project includes:
2732

28-
1. **cerelog_ws_bridge.py** - For Cerelog ESP-EEG (TCP → WebSocket)
29-
2. Community bridges for other devices (see Bridge Setup section)
33+
1. **pieeg_ws_bridge.py** - For PiEEG devices (SPI/BrainFlow → WebSocket)
34+
2. **cerelog_ws_bridge.py** - For Cerelog ESP-EEG (TCP → WebSocket)
35+
3. Community bridges for other devices (see Bridge Setup section)
3036

3137
### Bridge Architecture
3238
```
@@ -105,6 +111,35 @@ muselsl stream
105111
# https://emotiv.gitbook.io/cortex-api/
106112
```
107113

114+
#### PiEEG (Raspberry Pi)
115+
```bash
116+
# 1. Connect PiEEG shield to Raspberry Pi GPIO
117+
# 2. Enable SPI: sudo raspi-config → Interface Options → SPI
118+
119+
# Install dependencies
120+
pip install websockets spidev RPi.GPIO numpy
121+
122+
# Run the bridge
123+
cd scripts
124+
python pieeg_ws_bridge.py --rate 250 --gain 24
125+
126+
# Options:
127+
# --rate Sample rate: 250, 500, 1000, 2000, 4000, 8000, 16000
128+
# --gain PGA gain: 1, 2, 4, 6, 8, 12, 24
129+
# --channels 8 or 16 (for PiEEG-16)
130+
# --port WebSocket port (default: 8766)
131+
# --brainflow Use BrainFlow instead of direct SPI
132+
133+
# Connect in PhantomLoop to ws://<raspberry-pi-ip>:8766
134+
```
135+
136+
**Development Mode (no hardware):**
137+
```bash
138+
# On non-Raspberry Pi systems, the bridge auto-enables simulation mode
139+
# Generates synthetic alpha waves for testing
140+
python pieeg_ws_bridge.py
141+
```
142+
108143
#### Cerelog ESP-EEG
109144
```bash
110145
# Connect to ESP-EEG WiFi (SSID: CERELOG_EEG, Password: cerelog123)
@@ -185,6 +220,10 @@ BRAINFLOW_BOARD_IDS.MUSE_S // 21
185220
BRAINFLOW_BOARD_IDS.INSIGHT // 25
186221
BRAINFLOW_BOARD_IDS.EPOC // 26
187222

223+
// PiEEG
224+
BRAINFLOW_BOARD_IDS.PIEEG // 46
225+
BRAINFLOW_BOARD_IDS.PIEEG_16 // 47
226+
188227
// Testing
189228
BRAINFLOW_BOARD_IDS.SYNTHETIC // -1
190229
```
@@ -261,6 +300,22 @@ stats.forEach((ch, i) => {
261300
- **Impedance**: Supported on all models
262301
- **Motion**: Gyroscope + accelerometer
263302

303+
### PiEEG
304+
- **ADS1299**: 24-bit resolution, programmable gain (1-24x)
305+
- **Sample rates**: 250 Hz to 16 kHz configurable
306+
- **Impedance**: Supported via ADS1299 lead-off detection
307+
- **Signals**: EEG, EMG, ECG all supported
308+
- **Raspberry Pi**: Compatible with Pi 3, 4, and 5
309+
- **Safety**: Battery power only (5V) - never connect to mains!
310+
- **BrainFlow**: Supported (board ID 46 for PiEEG, 47 for PiEEG-16)
311+
- **Variants**:
312+
- **PiEEG-16**: 16-channel daisy-chain
313+
- **IronBCI**: Wearable with BLE/WiFi and mobile SDK
314+
- **IronBCI-32**: 32-channel high-density
315+
- **JNEEG**: Jetson Nano for GPU-accelerated DL
316+
- **ardEEG**: Arduino shield for beginners
317+
- **MicroBCI**: STM32 NUCLEO-WB55 compact BLE
318+
264319
### Cerelog ESP-EEG
265320
- **ADS1299**: No impedance measurement (signal-based quality only)
266321
- **WiFi AP**: Device creates its own network

0 commit comments

Comments
 (0)