← All work

J1 · Final-year project · Riphah International University · 2024–25

Moving a robotic hand with three EEG channels

A motor-imagery BCI integrating EEG processing, machine-learning inference, Raspberry Pi control and physical robotic actuation.

Role
Protocol, pipeline, hardware, software
Signals
EEG · C3, Cz, C4 · OpenBCI Ganglion
Decoder
CSP + LDA
Runs on
Raspberry Pi · LSL
The 3D-printed robotic hand: blue fingers with tendon cords on a white forearm

Research question

How far can motor-imagery decoding be simplified while still supporting responsive physical control?

My role

  • Designed the stimulus protocol in PsychoPy and refined it over several pilot rounds (cue timing, trial structure, instructions).
  • Built the real-time streaming and processing pipeline on Lab Streaming Layer.
  • Implemented filtering, artefact removal, CSP feature extraction and LDA classification.
  • Designed the 3D-printed headband and deployed control on a Raspberry Pi driving the servo hand.
  • Collected an EEG dataset of more than 30 participants.

Protocol

One trial, to scale · 14 s

A participant wearing electrodes faces a laptop showing the REST cue, with the Ganglion board on the desk and code running on a large screen above
A recording session. PsychoPy shows the cue on the laptop (here, REST), the Ganglion board sits on the desk, and the processing code runs on the big screen.

System architecture

Streaming, decoding and actuation run side by side. Each stage has its own thread on the Raspberry Pi, so a new epoch can arrive while the last prediction is still moving the hand.

Hardware

EEG was recorded with an OpenBCI Ganglion board. I designed and 3D-printed a headband to hold the electrodes against the scalp during recording. Gold-cup or dry electrodes sit inside it.

It's an acquisition aid, not a complete headset: its job is to keep the electrodes steady so the signal stays clean.

The 3D-printed headband, a black arched band with two electrode holders, on a lab bench
The 3D-printed electrode headband.

Evidence

Bar chart of CSP plus LDA classification accuracy for each PhysioNet subject, five-fold stratified cross-validation
Decoding accuracy varies widely between people. CSP + LDA accuracy for each evaluated PhysioNet participant, 5-fold stratified cross-validation.

Interpretation

Offline accuracy was not the bottleneck. Cross-session and cross-subject transfer limited real-time performance: a decoder trained on one session or person lost ground on the next.

Next question

Three channels keep the hardware simple, but leave CSP little spatial information to work with. The next step is a direct comparison of within-subject, cross-run, cross-subject and three-channel performance.

Tools & signals

  • Python
  • PsychoPy
  • LSL
  • OpenBCI Ganglion
  • Raspberry Pi
  • Servo control
  • 3D printing

Shortcuts

D
Toggle debug view (schematic mode)
T
Switch light / dark
?
Show this list
Esc
Close