Hardware
Devices
PiEEG-8
Specification

Specification

Everything you need to know about the hardware, plus the low-level details for writing your own driver.

PiEEG-8 shield

Hardware

Channels8 single-ended biosignal inputs
Extra inputsReference (SRB1, common to all channels) and bias drive
Analog front endTexas Instruments ADS1299
Resolution24-bit, delta-sigma, all channels sampled at the same moment
Sample rate250 SPS as set by PiEEG software (the ADS1299 supports 250 SPS to 16 kSPS)
Gain1 as set by PiEEG software (ADS1299 supports 1, 2, 4, 6, 8, 12, 24)
Reference voltage4.5 V internal
SignalsEEG, EMG, ECG
ElectrodesDry or wet Ag/AgCl
Electrode connector2.54 mm pin header
Status LEDOn when the board is powered
HostRaspberry Pi 4, Raspberry Pi 5
Host connector40-pin GPIO header
InterfaceSPI0, CE0, plus DRDY on GPIO 26
Power5 V via the Raspberry Pi, from a battery (power bank) only
IsolationNone. Battery operation is required.
LicenceSoftware and SDK: MIT

Software support

SoftwareDevice setting
PiEEG Server--device pieeg8
BrainFlow (opens in a new tab)BoardIds.PIEEG_BOARD (56)
Python SDK (opens in a new tab)1.8_ch_Pi4.py, 1.8_ch_Pi5.py

GPIO pins

Header pinGPIOSignal
19GPIO 10SPI0 MOSI
21GPIO 9SPI0 MISO
23GPIO 11SPI0 SCLK
24GPIO 8SPI0 CE0
37GPIO 26DRDY (active low)

PiEEG-8 pins on the Raspberry Pi header

PiGPIO chip for DRDY
Raspberry Pi 4/dev/gpiochip0 (or RPi.GPIO, board pin 37)
Raspberry Pi 5/dev/gpiochip4 (RP1). Check with gpiodetect if your OS version differs.

SPI settings

SettingValue
Bus / device/dev/spidev0.0
Mode1 (CPOL 0, CPHA 1)
Bit orderMSB first
Word size8 bits
Clock600 kHz in the SDK scripts. PiEEG Server uses 4 MHz on Pi 4 and 2 MHz on Pi 5.

Data frame

Each time DRDY goes low, read 27 bytes:

BytesContent
1–3ADS1299 status word (normally 0xC0 0x00 0x08)
4–6Channel 1
7–9Channel 2
……
25–27Channel 8

Each channel is a 24-bit, big-endian, two's-complement value. At 250 SPS you get 250 frames per second.

PiEEG-8 27-byte data frame

Converting to microvolts

This is the conversion used by the PiEEG SDK scripts and PiEEG Server:

raw = (b[0] << 16) | (b[1] << 8) | b[2]   # 3 bytes of one channel
if raw & 0x800000:                       # negative value
    raw -= 16777214
uV = raw * 4.5 / 16777215 * 1_000_000    # about 0.268 µV per count

Reading a sample

import spidev
spi = spidev.SpiDev()
spi.open(0, 0)                 # SPI0, CE0
spi.max_speed_hz = 600000
spi.mode = 0b01
 
# ... configure the ADS1299 (see below), then for every sample:
# 1. wait until DRDY (GPIO 26) goes from high to low
# 2. read one frame
frame = spi.readbytes(27)

ADS1299 commands

CommandCode
WAKEUP0x02
RESET0x06
START0x08
STOP0x0A
RDATAC (read data continuously)0x10
SDATAC (stop continuous read)0x11

Write a register with three bytes: [0x40 | address, 0x00, value]. Read one with [0x20 | address, 0x00, 0x00].

Default register settings

Start-up sequence used by PiEEG software: WAKEUP, STOP, RESET, SDATAC, write the registers below, then RDATAC and START.

AddressRegisterValueMeaning
0x01CONFIG10x96250 SPS
0x02CONFIG20xD4Internal test-signal settings (not used in normal mode)
0x03CONFIG30xFFInternal reference buffer on, internal bias reference, bias buffer on
0x04LOFF0x00Lead-off detection off
0x05–0x0CCH1SET–CH8SET0x00Normal electrode input, gain 1
0x0DBIAS_SENSP0x00
0x0EBIAS_SENSN0x00
0x0FLOFF_SENSP0x00
0x10LOFF_SENSN0x00
0x11LOFF_FLIP0x00
0x14GPIO0x80
0x15MISC10x20SRB1 on: the reference electrode is shared by all channels
0x17CONFIG40x00Continuous conversion

Noise self-test: set every CHnSET to 0x01 (input shorted). The signal should stay within a few µV. If it does, the board is fine and any noise comes from the cables, electrodes or surroundings. See Noise elimination.

⚠️

Changing CONFIG1–3 changes the sample rate or reference. PiEEG Server and BrainFlow expect 250 SPS.