Tag Archives: eegsynth

Unicorns are multiplying

This page is part on a series on the Unicorn EEG system, see also the other posts on the design of the alternative case and wet “sponge” electrodes, and on the native Python interface for Linux and macOS.

Following the design and implementation of the 3D printed case for the Unicorn EEG system, I have had some chance to evaluate it and make some design modifications. The most important is that rather than using the 5×2 shrouded male header ( or “box header”) that needs to be soldered to the 10 tiny wires, I switched to an insulation displacement connector (IDC) version that is clamped on the wires. I still need to squeeze each of the individual wires between the teeth (using pointy squeezers), but that already makes the fabrication much easier. The connectors I used are these, which are similar to these but with “ears” that nicely slot in the sides of the 3D printed enclosure, which also means that no glue is needed any more.

I made 4 so far for various projects and collaborators, all using the standard 5×2 male headers.

Recently we did a demonstration at the Tekniska Museum in Stockholm where visitors could try the EEG out. Combining three different sized S, M and L Unicorn caps (each with its own set of dry electrodes connected to a female 5×2 header) and a single Unicorn EEG amplifier (with the new male header) worked like a charm. The back of the enclosure still has the magnetic mount, similar to the original Unicorn case.

Switching the amplifier by unplugging it from one cap and plugging it into another one without even turning off the amplifier or software made it very easy to maintain attention to the visitors and keep a smooth flow in the EEG demonstration, not having to struggle with reconfiguring the hardware for different head sizes.

Native Python implementation for Unicorn wireless EEG data

This page is part on a series on the Unicorn EEG system, see also the other posts.

The Unicorn EEG system is a low-cost wireless 8-channel EEG system including an IMU and the “naked” version lends itself well to making your own 3d-printed enclosure as I demonstrated here. Most important for me is that it “just works”.

As the software that comes with only works on Windows and I prefer macOS, I made a platform-independent native Python implementation for real-time data streaming. My example streams the data to LSL, but can also be used as a starting point for real-time processing. See the gist of unicorn2lsl.py on GitHub.

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 he other posts for a 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 other posts for a review of the Unicorn Hybrid Black, and a 3D-printed case for the Unicorn Naked with 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 other posts on the design and prototyping of alternative wet “sponge” electrodes, and a 3D-printed case for the Unicorn Naked with 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.

Unboxing

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.

Update 3 Sept 2022 – the code has moved to its own esp8266_artnet_dmx512 repository to improve the timing and jitter with I2S (following this comment).

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