Need help? Should you have any issues with this setup, please email support@cerelog.com.
Cerelog BCI/EEG Board User Guide
Welcome! This guide contains everything you need to set up, configure, and use your Cerelog 8-channel Brain Computer Interface board.
Table of Contents
- 1. Critical Safety & Legal Notices
- 2. Prerequisites: What You'll Need
- 3. Hardware Overview
- 4. Software Setup & First Data Stream
- 5. Running an EEG Session
- 6. Advanced Usage: Firmware Customization
- 7. Troubleshooting Guide
- 8. Product Demonstrations
- 9. Applications & Possibilities
- 10. Appendix: Pinout & Technical Details
1. Critical Safety & Legal Notices
⚠️ ELECTRICAL SHOCK HAZARD - READ IMMEDIATELY
This product does not have medical-grade isolation circuitry and is not protected from mains faults or power surges. To prevent risk of serious injury or death from electrical shock, you MUST adhere to the following rules:
- NEVER use this device on a human subject while it is connected to a desktop computer plugged into a wall outlet.
- NEVER use this device on a human subject with a laptop computer that is actively charging from a wall outlet.
- ALWAYS operate this device for human data collection using a laptop running on its own battery power, or by connecting the board to an appropriate LIPO battery for power.
Evaluation Board/Kit Important Notice
Cerelog, Inc. provides the enclosed product(s) under the following conditions: This evaluation board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, OR EVALUATION PURPOSES ONLY and is not considered by Cerelog, Inc. to be a finished end-product fit for general consumer use.
Persons handling the product(s) must have electronics training and observe good engineering practice standards. As such, the goods being provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards.
This evaluation board/kit does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL, and therefore may not meet the technical requirements of these directives or other related directives.
2. Prerequisites: What You'll Need
Hardware & Accessories (Not Included)
The following links point to recommended third-party vendors. Cerelog Inc. is not affiliated with these vendors and assumes no liability for their products.
- Power Source: A 3.7V LIPO battery is recommended for portable, untethered use. (Qty: 1, Recommended)
- Data Cable: A high-quality USB-C cable rated for data transfer. (Qty: 1)
- EEG Electrode Cap: A professional cap for placing electrodes on the scalp. (Qty: 1)
- Electrode Gel/Paste: Conductive gel for a low-impedance connection. (Qty: 1)
-
Touch-Proof Adapters:
Essential for connecting the electrode cap to the board. (Qty: 2, for default setup)
IMPORTANT: Adapter Requirements
- The board's default firmware (Sequential Montage) requires TWO (2) Adapters to use all 8 channels.
- To use the board with only ONE (1) adapter, you must switch to Referential Montage by modifying the firmware (See Section 6).
Software & Development Tools
- A code editor, like VS Code.
- Python (version 3.7 or newer).
- Git for cloning software repositories.
- For Advanced BrainFlow use (Method B):
- Microsoft C++ Build Tools (on Windows) or equivalent build essentials on Mac/Linux.
- CMake.
3. Hardware Overview

- USB-C Port: For data streaming, powering the board, and charging a connected LIPO battery.
- JST-PH Battery Connector: 2.0mm pitch connector for an optional 3.7V LIPO battery.
- Electrode Header Pins: Two 10-pin headers for connecting the touch-proof adapters. The SRB1 pin on the ADC is used for referential montage mode (requires firmware change).
- Power LED (Green): Located below the Status LED, this indicates the board is receiving power from USB or a battery.
- GPIO17 Status LED (Green): This LED indicates the firmware status:
- SOLID ON: Firmware has finished loading, and the board is ready to connect and stream data.
- OFF: Board is not powered, or firmware has not loaded.
- Battery Charge Status LED: Located to the left of the power switch (not labeled on the diagram). This LED indicates the charging status of a connected LIPO battery: RED when charging, and GREEN when fully charged.
- Onboard Motor: A tactile feedback motor that can be controlled via custom firmware. Note that activating it will introduce noise into EEG signals.
Connecting the Battery Correctly
Carefully align the JST plug so the RED wire connects to the 'RED' (+) marking on the PCB and the BLACK wire connects to the 'BLK' (-) marking. To remove the connector, do not pull the wires; gently squeeze the plastic plug and wiggle it out of the socket.
4. Software Setup & First Data Stream
This section guides you through installing software to visualize your EEG data.
A Note for Beginners
The following steps require using your computer's Terminal (also called a command prompt or shell). This is a text-based way to interact with your computer. We recommend using a modern code editor like VS Code, which has a built-in terminal and makes it easy to view files.
Basic Terminal Commands
ls
: Lists the files and folders in your current location.cd FOLDER_NAME
: Changes directory into the specified folder.cd ..
: Moves up one level to the parent folder.
Important Notes
- Before running any commands to clone a repository, first use
cd
to navigate to a folder you can easily find, like your Desktop or Documents folder. - On macOS, Python and its package manager `pip` are often installed as `python3` and `pip3` to distinguish them from an older, system-installed version of Python. In this guide, whenever you see
python
orpip
, usepython3
andpip3
if you are on a Mac. - To stop a script that is running in the terminal, press
Ctrl + C
(on Windows/Linux) orCmd + C
(on Mac).
Step 1 (Optional): Install Drivers if Needed
Modern operating systems like Windows 10/11 and recent versions of macOS/Linux should recognize the board automatically. Only follow this step if your computer fails to detect the board or assign it a COM port.
Install USB-to-UART Bridge VCP Drivers
If needed, install the CP210x chipset driver from the Silicon Labs website.
Download from Silicon LabsStep 2: Choose and Configure Your Visualization Method
Method A: Python Web Plotter
(Recommended for Beginners) This method uses a Python script to stream data to a real-time plot in your web browser.
-
A.1: Get the Code
In your terminal, navigate to a memorable folder (like Desktop). Then, clone the repository containing the script.
git clone https://github.com/shakimiansky/Shared_Cerlog_ESP_EEG_BCI.git -
A.2: Install Libraries
First, navigate into the folder you just cloned.
cd Shared_Cerlog_ESP_EEG_BCINow, install the required Python packages. (Remember to use
pip3
on Mac).pip install numpy pyserial plotly dash scikit-learn -
A.3: Run & View
Navigate into the Python displayer subfolder.
cd PythonEasyDisplayRun the script. It will automatically find the board and print a URL. Open this link in your browser to see the data. (Remember to use
python3
on Mac).Wait for the Green LED!
After plugging in the board, wait a few seconds for the green GPIO17 status LED to turn solid on. This indicates the firmware has loaded and the board is ready. The script will only be able to connect after this LED is lit.
python Python_Data_Displayer.py -
A.4: (Optional) Play the BCI Pong Game
The same repository includes a simple Pong game controlled by your brainwaves. The required libraries were installed in step A.2.
Note: This game is currently not compatible with macOS.
To play, navigate to the correct folder from the main repository directory and run the game script. Make sure you have a good signal on Channel 1!
cd games/workingpython simplepong.py
Method B: Using the BrainFlow Library
(Advanced) This involves building our custom fork of the BrainFlow library from source. This compilation is a one-time setup for your computer. Because the core library is written in C++, it must be compiled specifically for your operating system (Windows, Mac, or Linux). You only need to repeat the build process (Step B.2) if you modify the underlying C++ source code files (.cpp, .h). Creating new Python scripts does not require a rebuild.
-
B.1: Get the Custom BrainFlow Fork
Our board requires a specific fork of BrainFlow. Clone it and navigate into the new directory:
git clone https://github.com/shakimiansky/Shared_brainflow-cerelog.gitcd Shared_brainflow-cerelog -
B.2: Build the Library from Source
This crucial step compiles the C++ core of the library. If you make a mistake, manually delete the `build` folder and start this step over.
macOS Users: Install Build Tools First
Before proceeding, you need to install Homebrew (a package manager) and CMake. Open a terminal and run the following commands one by one:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"brew install cmakeCompilation Steps:
First, create a new directory named `build` inside the `Shared_brainflow-cerelog` folder and navigate into it.
mkdir buildcd buildNext, run the correct `cmake` command for your operating system to prepare the build files.
For Windows (with Visual Studio 2022):
cmake .. -G "Visual Studio 17 2022" -A x64For macOS / Linux:
cmake ..Finally, run the build command. This uses 4 processor cores (`-j4`) for faster compilation; you can adjust this number.
cmake --build . --config Release --clean-first -j4 -
B.3: Install the Python Package
With the core library built, navigate from the `build` folder back up and into the Python wrapper folder.
cd ..cd python_packageInstall the package in "editable" mode. (Remember to use
pip3
on Mac). This links the package to the source files, so you don't need to reinstall after making changes.pip install -e . -
B.4: Verify the Installation
Create a Python file (e.g.,
verify_brainflow.py
) with the code below. Running it withpython verify_brainflow.py
(orpython3
on Mac) should print a success message.from brainflow.board_shim import BoardShim, BrainFlowInputParams # This ID is specific to the Cerelog board in this BrainFlow fork CERELOG_BOARD_ID = 3 try: # No need to specify a COM port for verification params = BrainFlowInputParams() board = BoardShim(CERELOG_BOARD_ID, params) print("BrainFlow for Cerelog installed successfully!") print(f"Board Name: {board.get_board_descr(CERELOG_BOARD_ID)['name']}") except Exception as e: print(f"An error occurred: {e}") print("BrainFlow installation may have failed.")
-
B.5: Run Included Tests
The repository includes a comprehensive test suite. To run them, you must be inside the
python_package
directory.Quick Verification
To run all tests at once, navigate to the test folder and execute the main script (use
python3
on Mac):cd cerelog_testspython run_all_tests.pyKey Tests Explained
test_brainflow.py
- The best starting point for developers. It demonstrates the full cycle: connecting to the board, streaming data, and calculating basic stats. It also saves the raw data to a CSV file.
test_serial.py
- A low-level test that bypasses BrainFlow to communicate directly with the board. Use this if you suspect a fundamental serial connection or packet format issue.
test_unix_timestamps.py
- An advanced test for verifying time synchronization between the board and your PC, crucial for time-sensitive experiments.
For a complete list of tests and advanced debugging options, please see the `README.md` file inside the `cerelog_tests` directory.
Click to Expand: Learning How to Write and Pull BrainFlow Data
Once you have BrainFlow installed, you can write your own Python scripts to control the board and acquire data. This example shows a simple, complete workflow: connect, stream for 10 seconds, and plot the results.
Save the code below as a new file, for example my_plot_test.py
, inside the test folder you used previously: Shared_brainflow-cerelog/python_package/cerelog_tests
. Then run it from the terminal with python my_plot_test.py
(or python3
on Mac).
Example Script: Stream and Plot
import time
import numpy as np
import matplotlib.pyplot as plt
from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds, BrainFlowError
def main():
"""
A simple script to connect to a BCI, collect data for a few seconds,
and then plot the EEG data.
"""
# Board and acquisition parameters
board_id = BoardIds.CERELOG_X8_BOARD
duration_seconds = 10
# --- 1. SETUP THE BOARD ---
# BrainFlow uses a params object to configure the board
params = BrainFlowInputParams()
# Create the BoardShim object
board = BoardShim(board_id, params)
# Use a try/finally block to ensure session is always released
try:
# Get board info using static methods
eeg_channels = BoardShim.get_eeg_channels(board_id)
timestamp_channel = BoardShim.get_timestamp_channel(board_id)
sampling_rate = BoardShim.get_sampling_rate(board_id)
print(f"Connecting to {board.get_board_descr(board_id)['name']}...")
print(f"EEG Channels: {eeg_channels}")
print(f"Sampling Rate: {sampling_rate} Hz")
# Prepare the session (finds the board and establishes connection)
board.prepare_session()
# --- 2. ACQUIRE DATA ---
print(f"\nStarting stream for {duration_seconds} seconds...")
board.start_stream()
time.sleep(duration_seconds)
# Stop the stream and get the data from the internal buffer
board.stop_stream()
print("Stream stopped. Getting data...")
data = board.get_board_data()
if data.size == 0:
print("Error: No data was collected.")
return
# --- 3. PROCESS AND PLOT DATA ---
# Get the specific data streams from the data array
eeg_data = data[eeg_channels]
timestamps = data[timestamp_channel]
# Create a time axis starting from 0
time_axis = timestamps - timestamps[0]
print("Plotting data...")
plt.figure(figsize=(15, 8))
# Plot each EEG channel with a vertical offset for clarity
offset_value = 150 # µV
for i, channel_data in enumerate(eeg_data):
plt.plot(time_axis, channel_data + i * offset_value, label=f'Channel {eeg_channels[i]}')
# Add titles and labels for clarity
plt.title(f'{duration_seconds} Seconds of Cerelog EEG Data')
plt.xlabel('Time (s)')
plt.ylabel('Voltage (µV) - Channels are offset for clarity')
plt.legend(loc='upper right')
plt.grid(True)
plt.tight_layout()
# Show the plot
plt.show()
except BrainFlowError as e:
print(f"BrainFlow Error: {e}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
finally:
# --- 4. CLEAN UP ---
# Always release the session to free the COM port
if board.is_prepared():
print("\nReleasing session.")
board.release_session()
if __name__ == "__main__":
main()
How It Works: A High-Level Overview
All BrainFlow Python scripts follow a similar pattern:
-
Import Libraries: You always need
BoardShim
andBrainFlowInputParams
. For this example, we also importBoardIds
to select our board,time
for pausing, andnumpy
andmatplotlib
for data handling and plotting. -
Initialize and Configure:
params = BrainFlowInputParams()
creates a configuration object. For the Cerelog board over USB, you don't need to set any special parameters.board_id = BoardIds.CERELOG_X8_BOARD
selects the specific board you're using from a list of supported devices.board = BoardShim(board_id, params)
creates the main board object that you'll use to control everything.
-
Get Board Info: Before connecting, you can get the board's specifications (like its sampling rate and which rows in the data array will contain EEG data) using static methods like
BoardShim.get_eeg_channels(board_id)
. This is the best practice and makes your code more readable. -
Connect and Stream Data:
board.prepare_session()
finds the board and opens the connection.board.start_stream()
tells the board to start collecting data into an internal buffer.time.sleep(...)
pauses your script to let data collect in the buffer.board.stop_stream()
stops the collection.
-
Retrieve and Index Data:
data = board.get_board_data()
retrieves all the data from the buffer as a 2D NumPy array.- The `data` array has a specific structure. Each row represents a different channel. By using the channel arrays you fetched in step 3, you can easily select the correct rows:
eeg_data = data[eeg_channels]
for the EEG data, andtime_data = data[timestamp_channel]
for the timestamps. - For advanced users: If you wish to hardcode the indices, the data array for the Cerelog board is typically organized as follows, though using the `get...` methods is strongly recommended:
- Row 0: Packet Counter
- Rows 1-8: EEG Channels
- Row 9: Marker Channel
- Row 10: Timestamp Channel
-
Clean Up: Always call
board.release_session()
in a `finally` block. This ensures the connection to the board is closed properly, freeing up the COM port for other applications.
5. Running an EEG Session
- Hardware Assembly: Connect your EEG cap cable(s) to the required touch-proof adapter(s), then plug the adapter(s) into the electrode headers on the Cerelog board.
- Prepare the Subject: Fit the EEG cap on the subject's head. Apply a small amount of conductive gel into each electrode cavity to ensure good skin contact.
- Connect Bias Probe: Securely attach the bias drive (BIAS) electrode. A poor connection on this probe is a common cause of noisy data.
- Connect and Stream: Connect the board to your computer via USB-C. Launch your chosen software or script, and start the data stream.
⚠️ Safety Reminder
As per the notice in Section 1, only connect to a laptop running on its own battery power. **DO NOT** use this device if the laptop is charging or connected to a desktop computer plugged into a wall outlet.
- Check Signal Quality: Observe the incoming data. If a channel is flat or excessively noisy, check the corresponding electrode's position and consider re-applying a small amount of gel.
6. Advanced Usage: Firmware Customization
Firmware Access is Restricted
To receive the firmware source code, please email support@cerelog.com with your proof of purchase (e.g., order number). Firmware can be modified and flashed using the Arduino IDE.
Configuring the Arduino IDE
Before flashing, you must configure the IDE with the correct settings:
- Board: Navigate to
Tools > Board > ESP32 Arduino
and select **'ESP32 WROOM DA Module'**. - Port: Navigate to
Tools > Port
and select the COM port corresponding to your Cerelog board.
Modifying the firmware is necessary to:
- Change Electrode Montage: Switch from the default Sequential mode to Referential mode. This enables the SRB1 pin on the ADC as a common reference, allowing you to use a single 10-pin adapter.
- Adjust Gain: Change the Programmable Gain Amplifier (PGA) setting (1, 2, 4, 6, 8, 12, or 24).
- Control Peripherals: Write custom code to activate the haptic feedback motor or use the debug LEDs.
- Change Sample Rate: This is a highly advanced modification. Altering the sample rate or resolution will change the data stream format and will require you to rewrite the data parsing logic in your software.
CRITICAL: Procedure After Flashing Firmware
- After a successful flash, you MUST perform a full power cycle. Unplug the USB-C cable. If a battery is connected, unplug it as well.
- Reconnect the power (USB-C and/or battery).
- Your computer may assign the board a new COM port number. Check your Device Manager to see the new port assignment.
- When you run your software again, both the Python plotter (Method A) and a properly configured BrainFlow script (Method B) should find the new port automatically. If you have hard-coded a specific COM port in a custom script, you will need to update it manually.
7. Troubleshooting Guide
- Problem: Board not detected (no COM port appears).
-
- First, try a different USB port and ensure you are using a USB-C data cable, not a charge-only one.
- If it's still not detected, proceed with the optional CP210x driver installation in Section 4.
- Check for the green power LED on the board. If it's not on, there is a power issue. - Problem: My script fails to connect.
-
- Make sure the green status LED is on before running your script. This indicates the firmware is loaded and ready.
- Try a full power cycle. Disconnect the USB-C cable, wait a few seconds, and plug it back in before re-running your script.
- Make sure no other program is already connected to the board's COM port. Only one application can use the port at a time.
- If you recently flashed new firmware, see the "Procedure After Flashing" notes in Section 6. - Problem: Data is extremely noisy or flat.
-
- Poor electrode connections are the most common cause of bad signal quality. Ensure that all electrodes, especially the **BIAS probe**, have a secure, low-impedance connection.
- Ensure you are not near sources of high electromagnetic interference (e.g., power bricks, fluorescent lights, powerful fans).
- Re-apply conductive gel to the problematic electrodes.
8. Product Demonstrations
See the Cerelog ESP-EEG board in action. These demos showcase the real-time data streaming and BCI control capabilities.
Live Data Visualization (Python Script)
Video demonstrating real-time EEG signal streaming using the Python visualization script.
BCI Pong Game Demo
Watch as a user controls a game of Pong using only their brainwaves. See Section 4, Method A for instructions.
9. Applications & Possibilities
This board is a versatile tool for developers and researchers. With custom software, you can explore a wide range of applications.
- Multimodal Signal Acquisition: Capture data for EEG (brain), EMG (muscle), ECG (heart), and EOG (eye movement).
- Neuroscience Paradigms: Design experiments based on P300, Event-Related Potentials (ERP), and Steady-State Visually Evoked Potentials (SSVEP).
- BCI & Control Systems: Develop systems to quantify cognitive or emotional states, or to control robotics and other external devices.
10. Appendix: Pinout & Technical Details
Electrode Header Pinout
[PLACEHOLDER FOR ELECTRODE HEADER PINOUT DIAGRAM]
Technical Specifications
Understanding Electrode Montages
The board can be configured in two primary ways:
- Sequential / Bipolar Montage (Default): Each channel measures the potential difference between a positive input (INxP) and a negative input (INxN). For example, Channel 1 is (IN1P - IN1N). This is the default firmware configuration and requires two 10-pin adapters to use all 8 channels.
- Referential Montage (Requires Firmware Mod): Each channel measures the potential difference between a positive input (INxP) and a common reference. To enable this, the firmware must be modified to internally connect all negative inputs (INxN) to the SRB1 pin. This configuration requires only a single 10-pin adapter.
A Note on Performance
The core of this board is the research-grade TI ADS1299 ADC. While the chip has exceptional theoretical performance (capable of resolving ~10µV signals), real-world board performance will be influenced by your setup, environmental noise, and electrode contact quality. For complete details on the ADC, see the official TI ADS1299 Datasheet.