Category Archives: Research

Touch-proof enclosure for OpenBCI

The OpenBCI Cyton and Ganglion boards are open hardware and maker-friendly biosensing systems. Although there are alternatives, such as Bitalino and OpenEEG and some companies and/or projects are currently working on new hardware (see e.g., the OpenBCI boards are in my opinion at this moment still the best.

The maker-friendlyness of the OpenBCI boards is somehow also a disadvantage: the OpenBCI systems come as bare PCB boards with a Dupont-style header. OpenBCI (the company) focusses on using it in combination with dry electrodes mounted in a 3D printed headset. I personally don’t value dry electrodes that much; I don’t see the problem with a little bit of gel in the participants hair, and I don’t like the pressure needed on dry electrodes to provide a decent signal. Electrodes with gel or Ten20 paste usually provide better and more robust signal quality. However, it depends on the situation: dry (or saline, like the Emotiv Epoc) electrodes are great if you quickly want to swap the EEG system from one participant to the other.

For the 1+1=3 performances using the EEGsynth setup, we not only use EEG recorded from the scalp, but also EMG recorded from muscle and ECG recordings from the heart. The standard in research and clinical applications is to use touch-proof connectors, technically known as DIN 42802 connectors. These are available in many versions, such as cup electrodes for EEG and snap electrodes for EGC and EMG.

The Dupont-style headers are ubiquitous in the Arduino scene, therefore I previously designed an 8-channel head-mounted system based on a sweat band with the amplifier mounted at the back. It is comfortable and works quite well during performances, but it is still a bit fragile, especially when replacing the battery (see below). Furthermore, after prolonged use the gold-plating of the electrodes wears off, and replacing the electrodes is a hassle. The advantage of touch-proof connector is that it is much easier to switch between different types (cup versus stick-on) and to replace worn-out electrodes. I guess this is also one of the motivations for OpenBCI also selling a Touch Proof Electrode Adapter. Connecting the adapter to the correct pins of the 11×2 header is not trivial, and results in a relatively fragile and bulky setup, i.e. not ideal in demonstrations/performances where I want stuff to be robust.

Another issue that I have with the OpenBCI boards is that they use a two-pin JST connector to connect the LiPo battery to the board. These JST connectors are not designed for frequent connect/disconnect cycles. To disconnect the battery for recharging, you have to pull the cable and I have accidentally pulled off the header from the cable more than once…

Based on these experiences I decided to make an enclosure for the OpenBCI boards that is robust in performance/demonstration settings, that uses touch-proof connectors so that it can be used with EEG/EMG/ECG equally well, that is compatible both with the Cyton and Ganglion, and that includes an easy to charge LiPo battery.

The 8-channel Cyton board exposes a lot of the flexibility of the ADS1299 analog frontend like common reference versus bipolar, and normal ground versus active bias, but I typically use it with a common reference and the normal ground. Consequently it needs 10 connectors (8x active, REF, GND). The Ganglion board has 4 channels and can be configured with jumpers for either unipolar and bipolar reference schemes. It hence needs 6 (4x active + common REF + GND) electrode connectors, or 9 (4x active + 4x bipolar REF + GND) electrode connectors. An enclosure design with 10 connectors (4x active, 4x bipolar REF, 1x common REF and 1x GND) therefore supports both reference schemes for the Ganglion.

The external dimensions of the enclosure are 100x100x30 mm. The height is needed for the 10 connectors, but also has the advantage that it should be possible to mount a WiFi shield on top of the board.

The internals of the enclosure are shown here. At the top you see a 850 mAh LiPo battery, connected to a LiPo charger/protector module with micro-USB connector. The on/off switch is this one and the LED is 5 mm diameter. I used a RGB LED, since that was the only that I had available, but I am only using a single color (green) connected through 470 Ohm resistor to the on/off switch. Both the OpenBCI board inside and the lid are secured with 2.5 mm screws. I purchased the touch-proof connectors from Medcat; these are actually the most expensive component of the enclosure.

Here you can see it with the OpenBCI board mounted, but still without the leads between the OpenBCI header and the touch-proof connectors.

The 3D design for the enclosure can be downloaded in STL format or as Fusion 360 project from ThingiVerse.

First steps with a €20 single-channel EEG system

My friend Vladimir recently demonstrated a single-channel EEG system that he got at a hackathon in London. When he mentioned that it only costs €20 (or actually 20 GBP to be more precisely) I immediately decided to order one myself. The ICI-BCI system is a low cost open source brain computer interface.

The bag clearly and rightfully indicates that it is a totally experimental system, and that it should be used with caution.

The basic idea of the amplifier is that it takes an 1000 Hz analog audio signal from the computer or mobile phone, which is amplitude modulated by the ExG signal and subsequently fed back as microphone signal. So the system is fully analog and requires the DAC to be done by the audio input of the computer or phone.

Continue reading

EEG combined with VR

We recently had a meeting at the Astron radio telescope for the COGITO project with Daniela de Paulis, Stephen Whitmarsh, Guillaume Dumas and others. One of the goals of that meeting was to try out the combination of the EEG system with the Oculus Rift VR system.

For the COGITO project we are using the GTec Nautilus EEG system. Our specific system comprises of a 32-channel wireless amplifier that mounts on the back of the EEG cap, in combination with EEG caps in three different sizes. The caps have 64 holes at a subset of the  locations of the 5% electrode placement standard. We are not using the “Sahara” dry electrode option, but rather the regular wet electrodes.

We started by removing all electrodes and cups from the cap, to get a clear view on which electrode sites are accessible. The central electrode locations (i.e. the z-line), temporal electrode locations and occipital electrode locations are occluded by the VR head mount. But there are still plenty of electrode locations accessible.

Continue reading

Raspberry Pi as Eurorack synthesizer module

Processing realtime EEG data from the OpenBCI system requires software running on a computer. For the EEGSynth project we do the rapid application development using the platforms that we are most familiar with, i.e. standard laptops and the FieldTrip toolbox, which is based on MATLAB. However, in the end we want to implement as much as possible using affordable and open hardware and software. Hence we opted for the Raspberry Pi, a credit card–sized single-board computer. It runs Linux, which makes it easy to use standard programming platforms and interfaces such as Python and Redis to implement the software stack.

In the first EEGSynth studio performance you can see Stephen in the middle, operating the MATLAB-based GUI for the EMG/EEG processing, and Jean-Louis at the back operating the synthesizer. The goal of the technological development is to put Jean-Louis completely in control and to make the interface of the EEG synthesizer as similar as his other modular synthesizer modules. Hence the need for fitting the Raspberry Pi into a Eurorack synthesizer case.

Here you can see some photo’s from the construction of the front panel.

2015-11-14 15.32.52 2015-11-14 16.30.57

The front plate has holes for the various interface ports to interface with the Raspberry Pi. For a sturdy mount I glued a section of L-profile rails to the front plate.

2015-11-14 21.36.36

After mounting the Raspberry Pi, I connected the HDMI and audio port with a short cable to the front panel.


Here you can see the Raspberry Pi in the Eurorack case, next to the power supply.


The Nike EEG headband

Together with Stephen Whitmarsh and friends I have embarked on the EEGSynth project, which aims to bridge science, technology and art by making an EEG-based synthesizer. The EEGSynth project relies on the realtime functionality in our FieldTrip toolbox, although it will probably also be linked to other software platforms.

I am lucky to have one of the first Jinga-Hi JAGA16 wireless EEG systems, which I think is the the smallest and most portable EEG system in existence at the moment. Although the primary application of that system is not for human EEG, it actually is perfectly suited for wireless BCI and neurofeedback applications as well. I am combining this system with standard (clinical and research) EEG cup electrodes. Using a glob of Ten20 electrode paste you can stick them to the scalp. Having some of these electrodes on my head and trying to connect this bunch of long wires to the tiny JAGA16 wireless EEG amplifier resulted in the question how to make a comfortable and robust system for electrode attachment.

I came up with the idea to use an elastic sports headband. This allows to attach the wireless amplifier to the head, and consequently the electrode wires would be channeled along the headband. Here you can see the components that I started with (minus the EEG amplifier):

2015-05-19 21.09.54

The headband is one that I picked up in a local sports shop. It consists of a sleeve of flexible fabric that  is relatively thin. At the placed where the fabric needed puncturing, I used some iron-on interfacing to strengthen it and prevent the holes from further tearing.

2015-05-19 21.51.46

This is the end result, which includes 8 electrodes for the EEG and 2 for the ground and reference.

2015-05-19 23.53.52

Soldering the electrode leads to the miniature connector was the hardest task. The 18 pin (arranged as 9×2) connector is only 12 mm wide, which means that for each pin there is only about 1.2 mm space.

Note that the PCB board with the yellow wrapping is actually  the full 16 channel wireless amplifier. It is powered by a (cell-phone type) LiPo battery, which is as large as the EEG system. Data is transmitted over Wifi and can be streamed and analysed in MATLAB or Python using  FieldTrip.

2015-05-19 23.54.20

Here I am, wearing the first prototype electrode headband. Two electrodes (ground and reference) go behind the ears, the other eight electrodes are approximately placed at F3, F4, C3, C4, P3, P4, FCz and CPz. The wifi EEG amplifier and the battery can conveniently be tucked away in the two flaps at the back.

2015-05-20 16.16.22

First steps to realtime EEG and BCI on Raspberry Pi

I just compiled the FieldTrip realtime EEG interface on the Raspberry Pi. The code compiled out of the box, not a single line of code needed to be changed thanks to the existing cross-platform support for the old Apple PPC-G4 and the Neuromag HPUX-RISC MEG system. Streaming data to and from the FieldTrip buffer over TCP/IP works like a charm.

I’ll add my binaries for the Raspberry Pi to the regular FieldTrip release.

The next step will be to compile some of the EEG acquisition drivers, e.g. for OpenEEG and BrainVision.

Eventually it would be nice to also get BCI2000 to work on the Pi. According to Juergen large parts of BCI2000v3 should compile on the ARM… I look forward to gving it a try.

Torque batch queue system for mentat

I have installed the torque batch queue system on our 50 node (~300 core) mentat cluster. Here are some useful PBS commands that can be used with Torque.

qsub script
Submit a job script for execution.
Show status of running and pending jobs.
Display historical information about your jobs.
Kill a job.
Hold a job.
qstat -Q
qstat -Qf

Show configuration of queues.

Peer-to-peer distributed Matlab computing – update

After discussing in detail with colleagues at the Donders and at the FIL, I have implemented the peer-to-peer distributed computing toolbox for MATLAB. Most of the desired functionality is now in place, and it seems to work robustly and efficiently.

The peer toolbox allows you to do something like this in MATLAB

a = randn(400,400);
tic; cellfun('pinv', {a, a, a, a, a}, 'UniformOutput', false); toc
tic; peercellfun('pinv', {a, a, a, a, a}, 'UniformOutput', false); toc

Continue reading