OpenBCI AlphaWave (Bluetooth LE Enabled, no dongle!)

edited April 2016 in Software
Hi all,

I have seen a lot of people asking about processing data on the board. The last demo in this regard was done by @chipaudette explained in details at his blog

I thought I play a little with his demo & develop it to work on the 32-bit board. Also, I thought it would be more fun to report the results directly to a mobile app because it would be helpful for people who like to develop mobile apps to communicate directly with the board.

The method I used to measure the Alpha waves is close to what @chipaudette but I implemented a counter-based method, which is constrained by two thresholds to increase/decrease the counter value. To make it practical, I called this counter Alert Level. So, when you close your eyes, the alpha waves is supposed to increase, the Alert Level will decrease when the alpha power pass a specific threshold. Those thresholds can be established by enabling a baseline in the first 35 seconds, but you need to enable it. For now, I used a standard threshold that I set experimentally based on my brain waves; your's might be different.

Lastly, all the files can be downloaded from my GitHub:

I'm sorry for my sloppy job in describing this demo, here is a video to explain how it works. I promise to make it better in the future :D


 


Comments

  • Good Work and Thank you for Sharing.
  • edited June 2016
    Hi I am trying to get this sending data to the dongle as normal,  I have contacted alfahad numerous times but have not managed to get reply as yet. If anyone can help with this would be great I am in the process of creating a plugin for MQTT and writing a package for Python but while I am getting more used to the inner workings for now I am using this code (without the modified radio files as I want to send as normal to the dongle) and for now I am using the test.py script. 

    I placed at the bottom in the Run_AlphaDetector function:

      OBCI.sendChannelData(ind_count);

    And then uncommented the serial write functions in the sendChannelData function in the library, but I receive nothing at all in test.py, infact nothing sent by serialwrite is sent to the dongle, has anyone managed to get this working yet, have been stuck on it for a few days now, once I can understand why it is not sending the data correctly  I will be able to get on with writing my own it is pretty much the only thing I haven't been able to figure out during my time studying the libraries and codes etc. Thanks in advance.


  • Hi Adam,

    I'm sorry for not getting back to you.

    I think the issue you have is that you're using the code without modifying the Radios. So, you need to make sure that you are sending the right type of data between the board & the radios. In other words, the original radio's code wouldn't work with my current code implemented in the board. 
  • Hello @alfahad !

    First of all, congratulations for the interesting work!
     
    Similarly to @AdamMiltonBarker, I would like to see the data streamed to the dongle so that I could analyse the date with OpenViBE or Matlab. I am trying to understand what I can do with the radios to make it possible but I couldn't make it work (yet). Would any of you please give me some help?
    Thanks in advance!
  • @sardet, the default firmware in the dongle and mainboard allows what you are referring to. Hassan's AlphaWave project required his firmware mods so that he could utilize the Bluetooth Low Energy mode for sending directly to a mobile app without a dongle. The default firmware uses a special Bluetooth "Gazelle" mode for fastest possible raw data transfer. The BLE mode has much lower throughput and cannot stream 8 channels of 24 bit samples at 250 hz.


  • Hello @sardet


    For this project, basically we're only streaming a "Counter" value , which is calculated by the firmware in the board. So, when you say that you want to see the "data" streamed, we need to define the "data". 

    I'm assuming that you would like to stream the raw EEG channel data + counter value through the dongle. Then we need to modify the current customized firmware on the board to follow the protocol of the original data format. (You can utilize the space assigned for one of the axis of Accelerometer Data for sending the Counter value). Once this is done, then you can use the original firmware (using Gazelle standard) on the radios because we're using the standard data format now.

  • Thank you both for the fast reply and explanation.

    @wjcroft: "The BLE mode has much lower throughput and cannot stream 8 channels of 24 bit samples at 250 hz." Thanks, I wasn't aware of this and it is certainly a valuable information to keep in mind.

    @alfahad, yes I wanted to send the EEG data after the filtering to the dongle. I think I was with problems with the format and 24bit conversion. Using your help together with more contributions from OpenBCI comunity's codes present in the forum I solved my problem.

    Thank you all!
  • @sardet, thanks.

    Bear in mind that if you are using a framework such as OpenViBE, neuromore, BrainBay, etc. which consumes the raw EEG data via the dongle -- then it is usually much easier to do your filtering and signal processing with that laptop application. Because all the filter and processing parameters are easily adjusted directly in the GUI in a matter of seconds. Compare that to having to filter on the mainboard and download new firmware each time you want to change something. And coding the DSP in source language vs. using OpenViBE or neuromore VPL visual programming language elements.

    The value of the AlphaWave onboard processing is that it can compress the stream into just the essential data (alpha amplitude value) and send that over BLE to any mobile device without the dongle.

Leave a Comment