Tag Archives: eegsynth

Unicorn Naked case and connectors for EEG, EMG and ECG

This page is part on a series on the Unicorn EEG system, see also the review of the Unicorn Hybrid Black, and the design and prototyping of alternative wet “sponge” electrodes.

The Unicorn Naked comes with the same dry electrodes and electrode leads (wires) as the Unicorn Hybrid Black. However, there is no real advantage of the Naked version over the Hybrid Black version if you want to use them with the same electrodes, unless you insist on a 3-D printed headset to hold the electrodes in place instead of a cap. We figured that the small size and weight, and it being wireless, made it an ideal candidate for developing a wearable system for EEG research on infants and children. At the same time, we sometimes have other applications where a small and wireless ExG system would be useful, for example to record EMG from the muscles or ECG from the heart.

This first image shows the result, further down on the page you can read more on the details and design considerations.

3d-printed unicorn naked case and connectors

Continue reading

Unicorn Naked EEG system with wet “sponge” electrodes

This page is part on a series on the Unicorn EEG system, see also the review of the Unicorn Hybrid Black, and the Unicorn Naked case and connectors for EEG, EMG and ECG.

Together with the Unicorn Hybrid Black EEG system that I reported about in another post, I purchased a Unicorn Naked system. It is basically the bare PCB board of the Unicorn Hybrid Black amplifier, including connectors and electrodes, but without the housing and the cap. It comes with a LiPo battery, the cable bundle to connect the electrodes (including the LED strip), a set of 8 dry electrodes, a pack of 50 stick-on electrodes, and a Bluetooth USB dongle. It pairs with the computer just like the Unicorn Hybrid black and uses a unique device name; mine is UN-2022.01.10, which suggests that it includes the date of production and the serial number.

Although it comes with the same g.SAHARA Hybrid dry electrodes as the Unicorn Hybrid Black, the reason for me specifically getting the Naked version is that I want to attach other types of EEG electrodes and also use it for other biosignals like EMG and ECG. For EEG there are four types of electrodes that are common:

  • electrode paste, often combined with cup electrodes
  • electrode gel, usually applied with a syringe
  • wet sponge-like electrodes with saline solution, i.e., salt water
  • dry electrodes

The advantage of dry electrodes and wet sponge electrodes over the others is that you can put them on quickly, you can put them on on yourself, and they don’t leave any residue. Electrodes with gel or paste are more suited for a lab environment where a researcher or clinician applies the electrodes to the participant or patient.

However, they all share the same basic physical principles to pick up the potential differences on the scalp due to activity in the brain. Electric currents that flow through the head due to neuronal activity in the brain consist of ionic currents, i.e., these currents correspond to the displacement of positively charged Na+ and K+ and negatively charged Cl- ions. On the other hand, in the amplifier, the lead (wire) and the electrode the electric current is conducted using electrons. The electrode makes the contact with the nonmetallic part of the circuit, i.e., the scalp. The concept of the electrode as the interface between conductive and non-conductive materials has been long known and also applies to fields outside of neurophysiology; the Wikipedia lemma puts this nicely in perspective and provides links to the electrochemistry that happens at the interface.

On this page I present the details and design considerations for sponge electrodes that I constructed myself, based on Ag/AgCl ring electrodes that I had available. The design that I currently consider the most optimal due to its simplicity is electrode design 7. You can find more details further down on this page, including links to the sponge material.

Continue reading

Review of the Unicorn Hybrid Black 8-channel EEG system

This page is part on a series on the Unicorn EEG system, see also the design and prototyping of alternative wet “sponge” electrodes, and the Unicorn Naked case and connectors for EEG, EMG and ECG.

I am exited to report on the Unicorn Hybrid Black EEG headset that I received a few weeks ago and that I have now been able to explore. Together with colleagues from the Donders Institute, the Baby and Child research center and the Body Brain Digital Musical Instrument project we are going to explore this system, both for non-intrusive EEG measurements in young children and for EEG biofeedback for creative musical applications.

The Unicorn is a low-cost 8-channel wireless head-mounted EEG device developed by Gtec and first released in 2019. Gtec has been developing research-quality EEG systems for Brain-Computer Interfaces for a long time, and in recent years have been organizing a series of BR41N.IO hackathons that target hackers/makers and creative applications. I have worked with Gtec systems at a number of BCI2000 workshops, and we used the Gtec Nautilus for the Cogito in Space project (see also here) Given this background, I had high expectations for this new system and the Unicorn does not disappoint.


It arrived in a nicely designed and environmentally friendly cardboard packaging, including dry electrodes, a pack of 50 stick-on electrodes for the reference and ground, a medium-sized cap, an USB Bluetooth dongle and a micro-USB cable for charging. The Bluetooth dongle was not needed to get it working, it also works fine with the built-in Bluetooth of the Lenovo Yoga and Lenovo Thinkpad laptops that I tested it with.

Continue reading

Improved touch-proof enclosure for OpenBCI

While assembling the touch-proof enclosure for the OpenBCI Cython/Ganglion biosensing amplifier boards, I realized that with the board in the middle of the enclosure, there is little space for the Dupont wires connecting the pins of the OpenBCI to the touch-proof connectors. Trying to squeeze the board in place, some of the solder joints broke off. After repeatedly re-soldering the wires to the connectors, I was able to get it all properly in place. However,  this was definitely a design flaw.

I designed a new version that has the OpenBCI PCB board rotated by 45 degrees and shifted a bit to the corner. This gives more space for the wires and reduces the stress on the joints. Here you can see the new enclosure printed for a 4-channel Ganglion board.

OpenBCI touch-proof enclosure version 3 – with the PCB board in the corner

Compared to the previous one for the Cython, the difference is also in the colour of the connectors: I used 4 pairs of red and blue connectors for each bipolar channel, one black connector for ground, and one blue connector as the common reference. Using the 4 channels (i.e. the red connectors) relative to the common reference requires toggling the micro-switches on the Ganglion PCB board. Using a common reference is handier for EEG measurements, whereas the bipolar configuration is convenient for ECG/EMG, but with some extra electrodes also works fine for EEG. The Cython version has 8 red connectors, one blue connector for the reference, and one black connector for ground.

Another change is aesthetic; thanks to the nice post and configuration files from Rainer I figured out how to 3D print with multiple colours. I updated the Fusion 360 design of the enclosure to include the EEGsynth logo. The logo is embedded in blue and white in the black background of the box.

logo embedded in the 3D-printed enclosure

The 3D design can be downloaded from Thingiverse.

Timing and jitter in DMX512 signals

My previous post on building an Art-Net to DMX interface using an ESP8266 seems to be getting a lot of attention. However, from the comments it is clear that a lot of people that build it themselves have difficulties to get it to work, or don’t get it to work at all. This post investigates this in more detail.

We have not been using these interfaces in our performances for quite some time, and started wondering whether there is something wrong my firmware. My implementation goes back to April 2017. Over the course of time there have been some updates to my code. Furthermore, the Arduino IDE has been updated, as well as the ESP8266 core for Arduino.

Recently I received all three interfaces back that I had built for my 1+1=3 collaborators and decided to update the firmware and to test them. One of them did not work at all due to a broken connection between the power supply and the Wemos D1 mini; two of them started just fine. After fixing the broken wire and updating the firmware on all three of them; they started up just fine, showing the green light (indicating a connection to the WiFi network) and on the monitor page of the web interface I cold see that Art-Net packets were being received. However, with my DMX controlled light it did not work at all.

Testing and initial diagnosis

Using an Enttec Open DMX interface and the very nice JV Lightning DmxControl software (which supports both Art-Net and the Enttec Open DMX), I set out to debug the issue. Since DMX is all about timing, I connected my DS203 mini oscilloscope to pin 2 and 3 of the DMX connector.

I found detailed schematic information about the timing of the DMX protocol on this page. Searching for oscilloscope images of DMX signals, I also found this page with information.

Comparing the output voltage with the DMX512 schematics, it became clear that something was wrong in the signal. To make it easier to see the full signal on the oscilloscope, I configured only three DMX output channels, all set to zero. The oscilloscope shows 5 similar blocks; changing the value for DMX channel 1, I see that the 3rd block changes – that is apparently the first channel. Prior to that should be a “start code” with value 0, so the last 4 blocks make sense. But the first block is too short; there is also a very short pulse all the way at the start which does not match the specification.

Output voltage with the initial firmware:

Continue reading

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. EEG.io), 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.

Motion capture system

For the EEGsynth project I have developed a full-body 8-channel motion capture system. It is based on the MPU9250 9-DOF inertial motion unit, which contains a three-axis accelerometer, gyroscope and magnetometer. I have combined this with the Madgwick AHRS algorithm, which takes the raw sensor data and computes the yaw, pitch and roll.

The design is based on one battery operated main unit that is worn for example in a Fanny pack around the waist, and up to 8 sensors that are attached to the arms, legs, etc.

The main unit contains a Wemos D1 mini, which is based on the ESP8266 module. It uses the TCA9548 I2C multiplexer to connect a maximum of 8 MPU9250 sensors.

The data from the IMU sensors is streamed using the Open Sound Control (OSC) format. The sampling rate that can be achieved with one sensor is around 200 Hz, the sampling rate for 8 sensors is around 60 Hz.

For initial configuration of the WiFi network it uses WiFiManager. After connecting to my local WiFi network, it has a web-server through which the configuration can be set, which includes the number of sensors and the destination host and port for the OSC UDP packets.

For the IMUs I am using MPU9250 modules that I purchased on Ebay for about 3 USD each.The MPU9250 units fit very nicely in a Hammond 1551MINI enclosure.

I designed the enclosure for the main unit in Fusion360 and printed it on my Prusa I3 MK3 3-D printer. I made two motion capture systems so far, one with black and one with white PLA filament.

The Arduino sketch and more technical documentation can be found here on GitHub.

Art-Net to DMX512 with ESP8266

Update 1 August 2019 – added the connectors to the list of components.

Update 4 July 2019 – You may also want to check out this instructable, which describes a more sophisticated ESP8266-based solution.

Update 6 April 2019 – I wrote a follow up post on the timing and jitter in DMX512 signals and fixed a bug in the firmware.

Update 26 May 2017 – added photo’s of second exemplar and screen shots of web interface for OTA.

Professional stage and theatre lighting fixtures are mainly controlled over DMX512. To allow a convenient interface between the EEGsynth and this type of professional lighting systems, I built an Artnet-to-DMX512 converter. It quite closely follows the design of my Artnet-to-Neopixel LED strip module.

Let me first show the finished product. It has a 5 pin XLR connector, a 2.1 mm power connector, and a multi-color status LED:

Continue reading

ESP-8266 Art-Net NeoPixel module

As explained in a previous post, for the EEGsynth we want to use a neopixel array that can be controlled wirelessly using the DMX512 protocol. I purchased a number of Adafruit neopixel rings with 12, 16 and 24 elements respectively. Each RGBW pixel contains a red, green, blue and white LED. For the 24-pixel ring that means that there are in total 4*24=96 LEDs of which the intensity can be set.

The ESP-8266 module is a versatile WiFi module that comes in many versions. During development I especially like the NodeMCU version, which mounts the ESP-12 module on a development board with USB connection, and the even smaller Wemos D1 mini board. The Wemos D1 mini is hardly more expensive on Ebay than the simpler bare-bone ESP-8266 modules.

The hardware connection is simple: I connected Vcc and GND directly to the Wemos D1 mini board, and connected pin D2 to the data-in of the first pixel. Although the Neopixels are specified for 5V, in my experience the Adafruit rings also work fine at 3.3V, both for power and for the serial control signal. Each LED can take up to 20 mA when fully bright, which means that all LEDs of the 24-pixel RGBW ring can take up to 24*4*20 = 1920 mA, or close to 2 A. However, not all LEDs will be at full intensity at the same time, and driving them with 3.3V rather than 5V further reduces the current. I encountered no issues powering them over the USB port of my MacBook.

For the EEGsynth we want to map a small number of control signals to aesthetically pleasing light effects. E.g. it can control the hue, the frequency with which the array flashes, or the speed with which a bright bar rotates along the ring.

Continue reading

Scalable lighting systems

The X-mass holiday is always a nice time of the year to spend studying and tinkering on electronics projects. In the EEGsynth project we have identified that it would be cool to control light with brain and body signals, besides controlling modular synthesizers which we have focussed on so far. As it is not yet clear what kind of light and what kind of control will conceptually and aesthetically work well on the EEGsynth control signals, I have been studying both small and large lighting systems. We might for example want to use small and wearable lights on a performer, or control the stage light, or use a LED strip as indicator of the EEG-extracted control signals.

In theatrical and stage performance lighting there is a clearly dominant standard: DMX512. For lighting setups there are many fixtures (i.e. lamps rigged on ceiling mounted truss) that can be remotely controlled over DMX512, not only on-off, but they can be dimmed, the color can be changed, spotlights can be moved, etc. If you look on for example on Thomann, you’ll see that many light fixtures support DMX.

The Disco Biscuits – City Bisco – 10/5/12 – The Mann Center for the Performing Arts – Philadelphia, PA – Photo © Dave Vann 2012

Going to the smallest systems, I considered individual LEDs. Neopixels are a very interesting type of RGB LEDs, which combine a red, green and blue (and sometimes white) LED in a single few-mm small housing together with a controller chip. The controller chip allows the individual LED intensities of the neopixels to be addressed over a serial controller by a microcontroller such as an Arduino. Furthermore, multiple Neopixels can be daisy-chained, where each pixel in the array can be addressed. LED strips consisting of 30, 60 or even 144 pixels per meter can be purchased per meter, for example on Ebay.

Adafruit NeoPixel Ring with 16 x 5050 RGB LEDs with integrated drivers

For the the EEGsynth it is desirable to have a single control module that provides a uniform interface between ExG control signals and light control. An individual neopixel can be considered as an RGB lamp, just like a theatrical stage light. The intensity of the red, green and blue can be controlled, just like the DMX channels of a stage light. Controlling a small LED jewel worn by the performer should not be different than controlling the light of the stage on which the performer acts.

An important difference in the requirements for fixed stage lighting and a small wearable LED jewel is that the first must hook up to existing DMX512 cabling systems, whereas the second should be wireless. This is where Art-Net and the ESP-8266 come in. Art-Net is a protocol for sending the DMX control protocol over a network. The ESP-8266 is a small and low-cost microcontroller combined with a WiFi chip that is compatible with Arduino.

Further details on the hardware and firmware design for the actual light controller modules will come in a series of follow-up posts.