Raspberry Pi-to-brain interface

Ildar Rakhmatulin, a researcher at Heriot-Watt University, reached out to us on LinkedIn to share a device he has created that works with a Raspberry Pi to measure EEG signals produced by the brain as well as other bioelectrical signals. In other words, he has turned a Raspberry Pi into a brain–computer interface.

raspberry pi to brain interface project from HW university

Ildar has written bespoke software to read these signals on a Raspberry Pi, and he hopes that this end-to-end solution will open up a pathway to more affordable experiments in neuroscience. He named his device PiEEG.

EEG bioelectrical brain what now?

Various specialised tissues in the human body — like brain tissue, and heart muscle, and the muscles you use when you move your body — produce electrical signals as an intrinsic part of their functioning. Electrodes in contact with the skin can measure some of these signals, and the measurements can then be analysed to reveal information about what is happening in the tissues. An EEG (electroencephalogram) is a recording of electrical signals produced by the brain. Ildar’s device can also make electrocardiogram (ECG) recordings of signals from the heart, and EMG (electromyogram) recordings of signals from skeletal muscles, the muscles you use when you move.

How does it work?

PiEEG is an add-on board, based on a Texas Instruments ADS299 ADC (analogue-to-digital converter), that connects to Raspberry Pi’s GPIO pins. Electrodes in contact with the skin are connected to the PiEEG board, which takes the analogue electrical signals from the brain as inputs, digitises them, and transmits them to a Raspberry Pi.

raspberry pi to brain interface project from HW university

EEG data tends to be very noisy due to a combination of electromagnetic interference, poor contact between the electrodes and the scalp, and ordinary human movement. Ildar and his colleagues tackled this by implementing a bandpass filter in software to remove noise in real time. They use a suite of C, C++ and Python scripts to read, process, and display the data.

What can you use it for?

The design allows you to measure and process EEG signals and other bioelectrical signals in real time. You could use it to control robots and mechanical limbs by thinking, or as a DIY sleep monitor. Scientists could use the device for research involving cognition and emotion.

To test the device, Ildar sent commands to a radio-controlled toy mouse by blinking

Open source and crowdfunded

Ildar’s aim is to make neuroscience more accessible, so everything is open source and available on GitHub. There are separate instructions to help you make a cap to wear so the electrodes can read your brain signals.

He is launching a crowdfunding campaign soon to help manufacture more PiEEG devices.


Scott Masloski avatar

Fascinating find Ashley. I grew up in America with the C64 and went to college when the world wide web started. I would much rather be growing up now with open source software development, STEM, and especially the Raspberry Pi, which is the coolest thing I have ever seen in the microcomputer age. I hope this generation changes the world instead of Microsoft and their evil ai chatbot!

Leon Heller avatar

It doesn’t appear to have any isolation for the electrodes. Could be lethal if the PS develops a fault. ADI makes suitable devices, very expensive though.

Ron avatar

The device must be used only with battery 5 V

Abhi avatar

Well, this is cool .

Ff avatar

Nice work! I would recommend to the author to use pyplotgraph instead of matplotlib as it can be customized to use much less CPU than matplotlib

Ildar avatar

Thank you!! I will do it

Comments are closed