> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/sensor-setup/eeg/how-to-collect-eeg-data-with-an-lsl-device-in-imotions.md).

# How to collect EEG data with an LSL device in iMotions

Add an LSL EEG device such as Enobio or Emotiv EPOC+ to iMotions Lab with a device profile so the EEG R Notebooks can process its data.

Lab Streaming Layer (LSL) is a protocol for streaming various types of data.

Up until iMotions 9.1.5, Neuroelectrics Enobio was the only LSL-device supported EEG headset compatible with the iMotions EEG R Notebooks ([*Frontal Asymmetry*](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-frontal-asymmetry-fa.md) and [*Power Spectral Density*](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-power-spectral-density-psd.md)). Since iMotions 9.1.6, iMotions has expanded the compatibility of EEG R Notebooks to generic LSL EEG devices. This means you can run the EEG R Notebooks on EEG data from other LSL EEG devices, such as Emotiv EPOC+. The following article shows you how to collect EEG data from an LSL device in order to be able to run EEG R signal processing Notebooks.

***NOTE:*** *iMotions gives you the possibility of live streaming data from most LSL-supported devices into iMotions. For most LSL devices features like data visualizations in the iMotions replay window, and Sensor Data exports are applicable. However, only EEG signals can be processed with our R-notebooks. iMotions has only tested the following LSL EEG devices:* ***Enobio**,* ***Emotiv EPOC+**, and testing is needed for your own LSL devices. Please consult your Customer Success Manager if you have more questions.*

## 1. Prerequisites:

**Software**: iMotions version: 9.1.6 or above.

**Devices**: An LSL-supported EEG device and corresponding 3rd party software that the device needs to enable data streaming via LSL. More information about LSL-supported devices can be found [here](https://labstreaminglayer.readthedocs.io/).

In the following sections, we will take you through the steps of setting up an LSL EEG device in iMotions

## 2. Add your LSL device to iMotions

Make sure you have updated iMotions to version 9.1.6 or above.

Go to **Preferences -> Global Settings -> Sensors**

Click **"New Device"**. Select **"Lab Streaming Layer"** in **"Device Type"** and give your device a name under **"Device Name"**. Click on **"Save"**.

![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-dffdbfdb8721f72abae36361da98f44bc51dec38%2Fc2fad9bce3_Sensor-settings.webp?alt=media)

Now that the device has been added, search for data outlets by using the **"Search"** button next to the outlets. Depending on the type of headset you are using you will see different outlet names. Find the outlet with EEG data. In this example, we have selected the outlet from an Enobio device that contains EEG data. If the list of outlets comes up empty you need to revisit the 3rd party software that came with the device and make sure that LSL is enabled. As a last step make sure to tick the **"Enable data collection"** box. This creates a sensor widget in the iMotions sensor panel and allows you to collect data from the device.

![mceclip4.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-d57470eef7f3e3fe733795372dabd8bee2ee9632%2F88d26b9205_aigriwrq5e2f3y8aayp7rwmceclip4.webp?alt=media)

## 3. Add or create a Device profile

A "Device profile" is key for iMotions to be able to run our signal processing scripts on data collected with your EEG LSL device. The device profile is a text-based file (in JSON format) that specifies the connected LSL device's channel names and types of signal. The device profile **must be added before you start collecting data.** If you do not select a device profile you can still collect data with the device, but no signal processing tools can be added at a later stage.

For the Enobio EEG headset and Emotiv EPOC+ headsets, we have created default profiles. However, you do need to select one before collecting data. In the **"Device Profile"** dropdown select the default profile that matches your headset.

![mceclip2.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-a88b06cd7a23b369bd0aeaca7408485d24c6b3ec%2F6216e52e44_jrcuudibbeayoni9vzcyggmceclip2.png?alt=media)

If there's no default profile for your headset, select one of the existing profiles and select the **"edit"** option. This will open up a text editor where you can edit an existing profile. An example of the Device profile for Enobio is shown below. Specify the names of your channels. You will most likely find those in the 3rd party software that you installed along with the device. **Make sure to change the NotebookProfileName and NotebookDeviceName** as these two entries must be unique for each device. Once you have edited the list, go to **"File"** and use **"save as"** to save it as a new profile. You must name the profile according to the NotebookProfileName. If your profile name is MyDevice, the name of the file must be LSL\_NoteBookMapping\_MyDevice.json. This new profile can then be selected in the list of profiles. Click "**Refresh**" to update the profile.

![Enobio\_profile\_example.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-88f339b1452c0775c1dbfb787908141f4f41d215%2Fcea1af7a50_enobio_profile_example.png?alt=media)

Once the new profile has been selected, press the **"OK"** button to save your changes and exit the global settings menu. You should now see a sensor widget appearing in the sensor panel and a green display showing the sampling rate of the device.

## 4. Collect EEG data from your LSL device and check for R Notebooks compatibility

If you have created your own device profile we highly recommend that you pilot your experiment before you start your real data collection. We recommend this in order to make sure that our signal processing notebooks are compatible with your EEG data. You can find instructions on how to calculate frontal asymmetry [here](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-frontal-asymmetry-fa.md) and power spectral densities [here](https://help.imotions.com/lab/analysis/eeg/r-notebook-eeg-power-spectral-density-psd.md). If you are collecting data using one of the default profiles these have already been tested to work with iMotions R-notebooks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/sensor-setup/eeg/how-to-collect-eeg-data-with-an-lsl-device-in-imotions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
