README

PiEEG-8

Turn a Raspberry Pi into an 8-channel brain-computer interface.

Open-source Raspberry Pi shield for measuring EEG, EMG and ECG with the TI ADS1299.

📖 Documentation · 🚀 How to Start · 🛒 Buy · 💬 Discord

PiEEG-8 shield on a Raspberry Pi
Warning 警告

PiEEG-8 is not a medical device and has not been certified by any regulator for use with the human body. It is a tool for research, education and engineering. You use it at your own risk.

Caution 注意

Battery only. The Raspberry Pi, the shield and everything cabled to them (monitor, keyboard) must run from a 5 V power bank while electrodes are on a person. Never use a wall charger or a mains-powered monitor or computer. The board has no isolation. Read the Safety page and the liability notice.

At a glance

Channels 8 biosignal inputs, plus reference and bias
Converter TI ADS1299, 24-bit, simultaneous sampling
Sample rate 250 SPS (default)
Signals EEG, EMG, ECG
Host Raspberry Pi 4 or Raspberry Pi 5
Link to the Pi SPI0 on the 40-pin header, DRDY on GPIO 26
Electrodes Dry or wet Ag/AgCl, 2.54 mm header
Power 5 V power bank, 3 A, up to 10,000 mAh
Software PiEEG Server, Python SDK (this repo), BrainFlow

How it works

 Electrodes 1–8 ─┐
 Reference (ear) ┼─► PiEEG-8 ─SPI─► Raspberry Pi ─► PiEEG Server
 Bias (ear) ─────┘   (ADS1299)      4 or 5          ├ dashboard :1617
                                      ▲             ├ WebSocket :1616
             5 V power bank ──────────┘             └ CSV · LSL · OSC
PiEEG-8 setup: cap, shield on the Pi, power bank, monitor, keyboard and mouse

Quick start

  1. Mount the shield on the Raspberry Pi’s 40-pin header (Pi switched off).
  2. Connect 8 electrodes to channels 1–8, a reference ear clip and a bias ear clip.
  3. Power the Pi from a 5 V power bank. The LED on the shield lights up.
  4. Install and run PiEEG Server:
curl -sSL https://raw.githubusercontent.com/pieeg-club/PiEEG-server/main/install.sh | bash
sudo reboot                          # first time only: enables SPI
pieeg-server --device pieeg8
  1. Open http://raspberrypi.local:1617, click Connect, close your eyes and watch the alpha rhythm rise.
Note 注意

The installer’s background service starts in 16-channel mode. To make it start as PiEEG-8, see How to Start.

Full walkthrough: docs.pieeg.com → PiEEG-8 → How to Start

Wiring

Input Electrode Purpose
Channels 1–8 EEG electrodes in a cap (10-20 system) Signal
Reference Ear clip on one earlobe Common 0 µV point for all channels
Bias Ear clip on the other earlobe Cancels common-mode noise (mains hum)
Wiring of channels 1–8, reference and bias

Raspberry Pi pinout

Header pin GPIO Signal
19 GPIO 10 SPI0 MOSI
21 GPIO 9 SPI0 MISO
23 GPIO 11 SPI0 SCLK
24 GPIO 8 SPI0 CE0
37 GPIO 26 DRDY (data ready)
PiEEG-8 SPI and DRDY pins on the 40-pin header

Software

Best for
PiEEG Server (recommended) Browser dashboard, recording, WebSocket, LSL, VRChat OSC, webhooks
Python SDK (this repo, 1.GUI) Learning the ADS1299, raw data, custom register settings
BrainFlow BoardIds.PIEEG_BOARD (ID 56); build BrainFlow on the Pi with --build-periphery

Python SDK scripts

Script Pi What it does
1.8_ch_Pi5.py Pi 5 Live 8-channel graph, band-pass filtered (system python3-libgpiod)
1.8_ch_Pi5_gpiod_1_5_4.py Pi 5 Same, for pip install gpiod==1.5.4
1.8_ch_Pi4.py Pi 4 Live 8-channel graph, band-pass filtered
Raw_data_1Ch_Pi5.py Pi 5 Raw view of one channel
save_data_short_Pi5.py Pi 5 Save raw µV to Excel
save_data_gpiod_1_5_4.py Pi 5 Save raw µV to Excel, gpiod==1.5.4
save_data_short_Pi4.py Pi 4 Save raw µV to Excel

Install (recent Raspberry Pi OS needs a virtual environment):

python3 -m venv --system-site-packages ~/pieeg-env
source ~/pieeg-env/bin/activate
pip install spidev matplotlib scipy pandas openpyxl

# Raspberry Pi 5 — pick one:
sudo apt install -y python3-libgpiod      # for 1.8_ch_Pi5.py
pip install gpiod==1.5.4                  # for 1.8_ch_Pi5_gpiod_1_5_4.py

# Raspberry Pi 4:
pip install RPi.GPIO

Run:

cd 1.GUI
python 1.8_ch_Pi5.py          # or 1.8_ch_Pi4.py
Live 8-channel graph

Details, troubleshooting and the data format: Software docs · Specification

Example signals

EEG: alpha rhythm (eyes closed)

Alpha rhythm with eyes closed

EEG: chewing and blinking artifacts

Chewing and blinking artifacts

EMG and ECG

EMG ECG

What’s in this repository

Folder Content
1.GUI Python SDK: live graphs and saving data for Raspberry Pi 4 and 5
1.GUI/dataset Raw EEG with chewing and blinking (4-3-2-1 times), plus plotting scripts
Datasets Raw EEG with dry Ag/AgCl electrodes, 250 SPS
2.Software Legacy PiEEG desktop app and data-conversion scripts
ML_application Machine-learning example: record → alpha power → classifier
images Images used in the original README
Manual. Conenction and start - PiEEG1.pdf Printable quick-start manual
Wet EEG cap - How to use it.pdf Instructions for the wet-electrode cap

Documentation

Page
PiEEG-8 Intro Overview and specs at a glance
What’s in the Box What you need besides the shield
How to Start Step-by-step setup and first signal checks
Electrodes & Pinout Wiring, montage, GPIO pins
Software PiEEG Server, Python SDK, BrainFlow
Signals & Datasets Example recordings, datasets, ML example
Specification Data frame, µV conversion, ADS1299 registers
Troubleshooting Fixes for SPI, GPIO, software and noise
Safety Battery-only operation and responsible use

Citation

If you use PiEEG-8 in research, please cite:

I. Rakhmatulin et al. PIEEG: Turn a Raspberry Pi into a Brain-Computer-Interface
to measure biosignals. arXiv:2201.02228, 2022.

I. Rakhmatulin et al. Raspberry Pi Shield – for measure EEG (PIEEG). 2021 5th International
Conference on Electrical, Electronics, Communication, Computer Technologies and Optimization
Techniques (ICEECCOT), pp. 410–413. DOI: 10.1109/ICEECCOT52851.2021.9707969

License

Software and SDK: MIT. Hardware use is subject to the terms in license.txt and the PiEEG liability notice.

Contact

评论

暂无评论