SDK for Bluetooth Integration with EEG

25 Oct 2023 Aleksander Sokol

Bluetooth technology, typically used for connecting headphones or transferring files, dives into a more intricate domain when interfacing with an EEG (Electroencephalogram) helmet. EEG helmets are pivotal in monitoring and capturing the electrical activity of the brain, serving as invaluable tools for medical professionals, neuroscientists, and researchers. These helmets aid in diagnosing conditions like epilepsy, studying cognitive behavior, or even exploring brain-computer interfaces in advanced tech scenarios. While the EEG helmet is an epitome of advanced medical technology, its potential was somewhat tethered due to wiring constraints. In simple words, it takes a lot of wires  getting in a way and become messy. Enter Bluetooth. The vision was clear: integrate the flexibility of Bluetooth with the complexity of EEG data for real-time brain activity monitoring, all while ensuring mobility. However, the challenge lay in navigating Bluetooth’s inherent limitations to guarantee data integrity and swift transmission.

brain waves illustration

The Quest for Mobility in EEG Monitoring

In a world rapidly gravitating towards wireless technology, our client’s state-of-the-art EEG helmet was still tethered – both literally and metaphorically. This cutting-edge device, though impressive in its ability to capture intricate brainwave data, was bound by wires. While this wired solution was reliable, it posed constraints. Mobility was compromised, and users were often confined to specific environments, limiting the scope of EEG studies and applications. What is the customer’s aspiration? To break these chains and embrace the freedom that a wireless solution could offer.
The dream was clear: transform the EEG helmet into a truly mobile device, unburdened by physical connections. Transitioning from a USB-based SDK to one that thrived on Bluetooth connectivity was the key. This wouldn’t just be a technical upgrade; it represented a paradigm shift. It promised users the liberty to monitor brain activities in diverse settings, from research labs to outdoor environments, opening doors to new realms of possibilities and studies.

Challenge: Navigating Bluetooth’s Complexities

In the realm of wireless communication, Bluetooth reigns supreme for its universal applicability and ease of use. However, when diving into its depths, one quickly realizes that it isn’t as straightforward as it seems, especially when tasked with adapting complex systems like EEG helmets to this wireless medium. Here’s our journey through the maze of Bluetooth’s intricacies and how we innovatively tackled its challenges.

Bluetooth’s Data Transmission Constraints

In the realm of wireless communication, Bluetooth reigns supreme for its universal applicability and ease of use. However, when diving into its depths, one quickly realizes that it isn’t as straightforward as it seems, especially when tasked with adapting complex systems like EEG helmets to this wireless medium. Here’s our journey through the maze of Bluetooth’s intricacies and how we innovatively tackled its challenges.

Bluetooth’s Data Transmission Constraints

Bluetooth is like a series of tiny digital postmen, delivering packets of data. However, the L2CAP protocol, intrinsic to Bluetooth, comes with its own set of limitations. Every postman, or in this case, a data packet, can only carry 64 kilobytes at a time. Imagine trying to send a vast amount of data, say, a real-time stream of brain signals from an EEG helmet, through these postmen.
The challenge? Ensuring the data is kept from getting lost and jumbled up in transit. Our solution was to craft a system that efficiently split large messages into these smaller packets and, upon arrival, seamlessly reassembled them, ensuring a continuous flow of data. Next, the raw binary data is converted into a format more intuitive for developers to work with.

Ensuring Reliable and Continuous Data Streams

An EEG helmet is like a symphony orchestra, with each sensor playing its part, producing a dense and continuous stream of data. This data, akin to music notes, needs to be transmitted without missing a beat. Given Bluetooth’s constraints, this was no mean feat. We implemented strategies for efficient data storage and retrieval. By optimizing data architecture, we ensured the uninterrupted real-time processing of the immense data stream from the EEG helmet, maintaining data integrity and preventing potential errors. The result? An uninterrupted, reliable stream of brainwave data, ready for interpretation and analysis.

Creating a Robust SDK for Developers

Our endeavor resulted in the development of two distinct SDKs: one tailored for Android using Kotlin and another for iOS using Swift. At its core, our SDK is akin to other software development kits. Developers, aiming to solve specific tasks, can leverage our pre-written code to expedite their processes. Our SDK offers a pre-packaged set of classes with dedicated access points. These allow operations like discovering a device via BLE, establishing a connection, sending commands, and subscribing to data streams.
For testing, we used specific data sets to validate our SDK’s outputs. Additionally, a specialized board, simulating the EEG helmet’s operations, was instrumental in our testing phase. It served as a ‘black box’, aiding us in ensuring the compatibility and performance of our SDK.
In essence, our SDK became a bridge between the intricate world of EEG technology and the vast potential of mobile applications, ensuring adaptability and versatility for developers keen on harnessing the power of EEG in a mobile world.

The Outcome: Beyond Just a Wireless Solution

Our endeavor resulted in the development of two distinct SDKs: one tailored for Android using Kotlin and another for iOS using Swift. At its core, our SDK is akin to other software development kits. Developers, aiming to solve specific tasks, can leverage our pre-written code to expedite their processes. Our SDK offers a pre-packaged set of classes with dedicated access points. These allow operations like discovering a device via BLE, establishing a connection, sending commands, and subscribing to data streams.
For testing, we used specific data sets to validate our SDK’s outputs. Additionally, a specialized board, simulating the EEG helmet’s operations, was instrumental in our testing phase. It served as a ‘black box’, aiding us in ensuring the compatibility and performance of our SDK.
In essence, our SDK became a bridge between the intricate world of EEG technology and the vast potential of mobile applications, ensuring adaptability and versatility for developers keen on harnessing the power of EEG in a mobile world.

Ready to start the conversation?