COsleep

COsleep: Closed- and Open Sleep Stimulations with Auditory Stimuli

Following the tutorial on how to get a sleep recording/lab for under $1000 using OpenBCI here a continuation on….

Open Hard- and Software for in-sleep Closed– and Open-loop Targeted and Untargeted Memory Reactivation and Disruption with full-PSG recording.

Only intended for research and people that know what they are doing here and have techincal expertise and know how to assure safety in such devices and setups. If you are not doing research in this area you might kill yourself (e.g. an electric shock on your head) or others with this or cause even indirect harm and damage (the negative near and long-term consequences of stimulation during sleep are virtually not explored).

So use this on your own risk. You have been warned.

The github repository with the source (python) and first binary releases.

Only works with OpenBCI Cyton board (firmware greater than 2.XX) and Linux.

So you need a Linux distribution for this to work, I would recommend Ubuntu 18.04 LTS because I tested it, it is used by many, it is easy entry …. and you do not have to be a PC nerd to install it properly and safely. In fact, about 2 hours of your life to install alongside Windows for example for everyone that can setup the cables correctly on the OpenBCI should be realistic, for example see a tutorial to install Ubuntu alongside Windows … or google how to do it.

Here a poster with pictures and infographics, lists’n’stuff also showing an example in how to maybe safely pack an OpenBCI in a small cost effective Box, which I call “Somnofredics Plus PSG”. Its a fun project that arose from a collaboration as seen in the Poster above. The Hardware setup and how to connect the stuff, see below… for more details it is highly recommend to also read the previous tutorial here

BTW: The recordings I gained are, from my experience, at least as good as those from proprietary devices. (Won’t name them here, but I tested at least 2 top of the market products from two different companies. Parallel recordings on the same electrodes and proper evaluation of those recordings make me very confident in the high quality of the OpenBCI recordings (maybe the ADS1299 is really worth its high ~$50 price tag over similar cheaper AD-converters). Also confirming Rashid et al. (Nov. 2018)

A tutorial on the software will follow some time later when I or others  find the time to do that.

Hardware Setup

Here are two setups to be used with COsleep, for now they are fixed to a 8 channel and a 16 channel setup with fixed electrode positions. So for a recording with COsleep plug the pins on the OpenBCI device as in the following.
Some more detail on the setup for non-sleep researchers. The setup is a standard sleep polysomnography setup usable for sleep scoring based on Rechtschaffen and Kales (1968).
It includes and EOG (two bipolar electrodes around the eyes) and EMG (two bipolar electrodes on the chin, musculus mentalis) and two EEG Deviations at C3 and C4 according to the international 10-20 Electrode placement system (that is C3:A2, C4:A1). The setup records C3, C3, A1 (left mastoid) and A2 (right mastoid) signals separatly referenced to a placed reference electrode at Cz and uses as a bias Bias/Ground electrode at Fpz (placed at the center of the forehead).
Other than in the original description the A1 and A1 should not be placed on the ear lobues, but on the Mastoids (the “bony”, part behind each ear).
This way, one can later also deal with lost mastoid electrodes (e.g. in case A2 is lost one can still use C3:A1 as a backup) and this setup is in general more flexible, thus preferred here.
Importantly, the configurations below all the (non-biploar) channels that are referenced to the SRB2 (N, bottom) pin (that is the EEG channels like A1, A2, C3, C4) are REVERSED in their polarity. This can only be corrected later on after the converstion (non-“.csv” files like edf or brainvision files).
This is not avoidable, otherwise one needs to reference against the SRB1 pin (P, TOP), which however will FORCE all channels to be referenced to this channels, thus not allowing for bipolar channels like EMG and EOG. So this setup is clearly preferred. The polaritiy of the bipolar channels are not impaired by this.

8-channel setup: Main board (no daisy)

Setup the OpenBCI device and connect the electrodes:
On the OpenBCI device, the Bottom pins are N pins, Top pins are P pins, so connect them in this way:

 

Channel # Electrodes Pins to use Electrode label (cable color) Type/Function Location Comment
SRB 1 N(bottom) alias SRB2 Ref (white) Reference vertex (~center of head viewed from top) (Cz)
BIAS(2) 1 (2 is the bottom pin) Ground Ground/Bias forehead (Fpz)
N1P 2 N(bottom), P(top) EMG1,
EMG2
EMG left chin,
Right chin
EMG =
EMG1-EMG2
N2P 2 N(bottom), P(top) EOG1,
EOG2
EOG 1 cm left of left eye cantus and a little down,
1 cm above right eye center
EOG =
EOG1-EOG2
N3P* 1 N(bottom) A1 EEG A1 (bony part behind left ear)
N4P* 1 N(bottom) A2 EEG A2 (bony part behind right ear)
N5P* 1 N(bottom) C3 EEG C3 (6-8 cm left of vertex towards left ear)
N6P* 1 N(bottom) C4 EEG C4 (6-8 cm right of vertex towards right ear)
N7P [not plugged] – (unused) e.g. Fz or bipolar ECG, trigger signal (red/positive in top P pin)
N8P [not plugged] – (unused) e.g. Pz or bipolar ECG, feedback channel from stimulation
In total 10 electrodes are used, two channels are still free to be recorded (e.g. occipital of frontal channels, or second EOG etc.), however would require additional electrode pins that do not come with the kit (but can be bought additionally).

 

16 channel setup: Main board + Daisy module.

see:

http://openbci.com/forum/index.php?p=/discussion/575/ch-1-8-ok-ch-9-16-railing

http://openbci.com/forum/index.php?p=/discussion/254/soldering-16-channel-openbci-kit

Prior important Notes:

  • No need to connect the BIAS of device and daisy module (taking one of any of the two is enough)
  • Connect the device’s SRB2 to daisy’s SRB2 and then connect with Reference using a Y cable/bridge (typically provided in the OpenBCI package with the daisy module, but can be build by yourself as well).
  • You need a second connector cable with 10 additional electrodes (2×10 connectors). For example you can remove the black and white cable from this connector resulting in 8 additional EEG channels, … removing them avoids confusion them with the Reference (white, connected with a Y cable/bridge) and Ground (black) of the first connector the of the setup below. But you can also use these two extra cables for an ECG (e.g. in NP8 channel).

 

Device Channel # Electrodes Pins to use Electrode label (cable color) Type/Function Location Comment
main SRB 1 N(bottom) alias SRB2 Ref (white) Reference vertex (~center of head viewed from top) (Cz) connected/linked to daisy module SRB Bottom pin with “Y-bridge”
main BIAS(2) 1 (2 is the bottom pin) Ground Ground/Bias forehead (Fpz)
main N1P 2 N(bottom), P(top) EMG1,
EMG2
EMG left chin,
Right chin
EMG =
EMG1-EMG2
main N2P 2 N(bottom), P(top) EOG1,
EOG2
EOG 1 cm left of left eye cantus and a little down,
1 cm above right eye center
EOG =
EOG1-EOG2
main N3P* 1 N(bottom) A1 EEG A1 (bony part behind left ear)
main N4P* 1 N(bottom) A2 EEG A2 (bony part behind right ear)
main N5P* 1 N(bottom) C3 EEG C3 (6-8 cm left of vertex towards left ear)
main N6P* 1 N(bottom) C4 EEG C4 (6-8 cm right of vertex towards right ear)
main N7P 2 pins N(bottom),

P(top)

Negative pole, Positive pole Trigger On/OFF Trigger 1000 µV/0µV potential, see below.
main N8P* 1 N(bottom) ECG, reserved, e.g. noise  ECG,Trigger2(EEG) …  another bipolar channel.
daisy SRB 1 N(bottom) alias SRB2 Ref (white) Reference vertex (~center of head viewed from top) (Cz) connected/linked to main module SRB Bottom pin with “Y-bridge”
daisy N1P* 1 N(bottom) EEG1/F3 EEG F3 (6-8 cm to wards nose from vertex, then perpendicular 6-8 cm towards left side, and 6-8 cm away from C3)
daisy N2P* 1 N(bottom) EEG2/Fz EEG Fz (6-8 cm to wards nose from vertex)
daisy N3P* 1 N(bottom) EEG3/F4 EEG F4 (6-8 cm to wards face from vertex, then perpendicular 6-8 cm towards the right, and about 6-8 cm away from C4)
daisy N4P* 1 N(bottom) EEG4/P3 EEG P3 (6-8 cm to wards back from vertex, then perpendicular 6-8 cm towards left side, and 6-8 cm away from C3)
daisy N5P* 1 N(bottom) EEG5/Pz EEG Pz (6-8 cm to wards the back from vertex)
daisy N6P* 1 N(bottom) EEG6/P4 EEG P4 (6-8 cm to wards back from vertex, then perpendicular 6-8 cm towards right side, and 6-8 cm away from C4)
daisy N7P* 1 N(bottom) EEG7/O1 EEG O1 (12-16 cm to wards back from vertex, then perpendicular 1.5-2 cm towards left side, and 3-4 cm away from O2)
daisy N8P* 1 N(bottom) EEG8/O2 EEG O2 (12-16 cm to wards back from vertex, then perpendicular 1.5-2 cm towards right side, and 3-4 cm away from O1)

 

Here a short overview of the setup and where the electrodes suggested above are placed

Trigger/Indicator

A Trigger / Indicator can simply be constructed by the circuit below, attaching it like a bipolar channel on the N7P pins for example and the use of a 5 V USB plug (INTO THE BATTERY, NOT a power supply). It will provide a steady and fast spiking 1000 µV signal when the switch is turned on (and draws neglegtable power for the battery) or signal is 0 µV when the switch is turned off (no power consumption). The trigger voltage on the device pins can be increased or decreased by varing the resistors. Thus one channel is used per trigger. It can indicate Lights-OFF and Lights-ON, or when a standard procedure is performed etc. With a little of standardization one Trigger and a little annotation is usually enough to identifiy all kinds things to be triggered during the recodring (e.g. ON-OFF-ON-OFF sequences every second can indicate changes in procedure, or a short period with switch turned ON, when usually turned off can indicate testing of the signal with eye-movments, blinks, using of jaw muscle etc.)