8 channel board to Android (via Bluetooth 2 or BLE)

edited November 2016 in Cyton
Hi,

I am a freshman on OpenBCI world and I am working on a project about seeing EEG signals of a human brain on a Android app simultaneously. For this, I am planning to use a appropriate bluetooth connection between OpenBCI 32-bit board and a mobile phone. However, as in the Learning part of the website, the Bluetooth connection (with BLE mode) has not developed yet. According to my research, I found some example works about Android connection of OpenBCI board.
While I  was investigating the codes of example projects, I did not see a part that is about Bluetooth connection from BLE pin. Since, I am planning to bring out the Dongle from this project (I am not interested for PC connection) I had to find some solution about this Bluetooth connection. 
I am open to any advice about which implementing way should I follow or which beneficial codes should I check.
Thank you very much for your interest... 

Comments

  • Thank you very much, I am going to examine all of these...
  • edited November 2016
    [new thread: Uploading Pass Thru Radio]

    Hi,

    I have a 32-bit board and I want to upload a code to board by using serial communication technique with breadboard and jumpers. I made all jumper connections as explained in website however I did not understand whether I should connect batteries to the 32-bit board while this communication. When trying to feed both devices either dongle or board it didnot work what should I do? 

    Thanks

    Mert
  • wjcroftwjcroft Mount Shasta, CA
    edited November 2016
    Mert, hi.

    I merged your new thread into your previous one on your questions about setting up a Bluetooth or BLE link to your OpenBCI,

    When did you receive your OpenBCI? If it is very recent you have the V2 firmware. If more than a month or two ago, it has V1.

    Since you are just starting out with OpenBCI, I might suggest that it could be somewhat daunting if you are attempting to follow Hassan's AlphaWave instructions on changing / modifying the RFduino mainboard firmware to accommodate BLE operation. For one thing Hassan was using the V1 firmware. Secondarily, the mainboard RFduino (device) and dongle RFduino (host) boards are in close cooperation with each other and with the mainboard firmware. Modifying and debugging the radio firmware is not a beginning level project. Especially if you are needing to merge Hassan's V1 firmware AlphaWave into the V2 firmware.

    I'd suggest your easiest route, may be to use a Bluetooth "breakout" tiny piggyback board, attached to the mainboard with double stick foam. Or with a separate breadboard. The thread that mentions this approach is,


    In this case the mainboard firmware is uploaded OVER THE AIR. Using the instructions in the tutorial docs,


    And there is no need to modify the RFduino radio firmwares.

    William

  • Hi,

    Thanks for reply. I received my OpenBCI board at 28th of October. 
    Yes, I am trying to upload Mr. Hassan's AlphaWave code to my board for BLE connection. It seems my board is V2 firmware, so is it not possible to upload directly Mr. Hassan's Alphawave project to my board? Should I try using external bluetooth modules as Mr. Hassan did not specify in his instructions instead of updating the radios of the board by serial jumper communication? What steps should I follow for merging Mr. Hassan's Alphawave project to update my 32-bit board ? I am open for your valuable advices. 

    Sincerely

    Mert

  • wjcroftwjcroft Mount Shasta, CA
    edited November 2016
    If you have V2 firmware, then using Hassan's AlphaWave will require substantial work. Because it is setup for V1 firmware. That's why I suggested another approach. I can't give you any guidance on conversion of Hassan's code, because I am not familiar with it. The only way that would be possible is if you do it yourself.

    Besides the external Bluetooth module approach I mentioned in my last comment, another technique you could try would avoid firmware modifications ENTIRELY. May be a good one for you. This is using an OTG "on the go" adapter for your mobile device's usb socket. Such an adapter allows the OpenBCI dongle to be plugged into your phone. See,

    http://openbci.com/forum/index.php?p=/discussion/279/android-apps-via-otg-cable-dongle-and-d2xx-library

    Yet another approach would be to reserve your OpenBCI 8 channel for laptop use, and purchase a Ganglion for mobile applications. As Ganglion supports BLE directly.

    Regards,

  • edited November 2016
    Hi,

    I am trying to establish a suitable bluetooth connection between the 32bit board and a mobile phone for my project. I have some questions about possibilities:

    1) I found v1 versions of the board in Upgrade Guide file in your Github. So, is there a possiblity for me to first downgrade my board to v1 for applying Mr Hassan's bluetooth code by this way? If yes, how can I do this?

    2) I bought an external Rfduino module for Bluetooth connection however I cannot find a specific digital data output pin from the board for connecting serially the new Rfduino module. For this, I think I should change the pins, which pins should I change? Or is this method seems suitable?

    3) I can also use a Raspberry Pi module by connecting the dongle to its Usb port hence using the necessary Bluetooth communication etc. Can this be a solution also?
     
    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    edited November 2016
    The Pi connection is easiest. See,


    RFduino as external module is probably not what you want. The links mentioned above used a Bluetooth 2 or 3 breakout module, which is capable of enough speed to transfer the full EEG. RFduino will only be able to do BLE, which means you would need to do an approach similar to Hassan's data reduction (only sending alpha amplitude for example.) The Bluetooth breakout piggyback board communicates through the 2nd serial port on the ATmega. See Momen's post,


    If your board and dongle is already at V2, I would not recommend downgrading. As mentioned before, installing custom mainboard and RFduino firmware is not what you would consider an entry level project. Remember you also still have the throughput constraint, so you would need to do onboard signal processing. This means debugging, changes and mods are quite time consuming. With the Pi approach, you can use all the same tools available in the laptop environment.


  • Hi,

    I decided to use Raspberry Pi for bluetooth connection on my project finally. I ordered the Pi 3 module. I have some other issues about my project in which your comments are so important and valuable for me.
    Very Briefly, in my project, I want to process the recorded EEG data simultaneously. Namely, I am going to mark where the EEG frequency exceed some limit. If there is an exceeding situation I will send a message to the phone.

    I made very deep research and for this, I have 2 ideas on my mind:
    -Processing data on Matlab, however for simultaneous data processing in Matlab which text file should I load into my code (Raw data or SD ASCII Record) and is this possible to process it simultaneously and mark if there is and exceeding condition. (Because I am planning to press 'Start Data Stream' on GUI only one time and I do not want to deal with GUI other than that.)
    -Processing data on PIC32 Arduino Code, I think I can process the data on board's Arduino code however I did not see a place that where I can include my processing and filtering algorithm. Also, I do not understand how to process and mark the EEG data simultaneously in OpenBCI's board code. (And which .ino file should I modify)

    As a result, I am open for your valuable advices and recommendations. If I process and mark the 'limit-exceeding' EEG data simultaneously, only thing left is informing the mobile phone. Which route should I follow?

    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    If you want to do this in real-time, best is to write or use software on the Pi that consumes the data stream directly. Not via the text file. There are library routines which understand the OpenBCI data format in many languages. Matlab would likely run somewhat poorly, if at all, on a Pi. Signal processing libraries also exist in many languages.

  • Hi,

    I changed my project flow and instead of a Raspberry Pi I plan to use a laptop :)  For this, I had to do real data processing. I run your https://github.com/OpenBCI/OpenBCI_MATLAB code and get a real life stream on Matlab. However, I have some questions:
    1) For real time data stream I'm using ReceiveData.m as explained in the guide. However, I did not understand what vec and ts variables are about. Namely, I want to save this stream as a OBCI Raw File Format (like 8 channels are columns only and each sample is a row etc.). Does the fprintf functions are written for raw file format or in which manner should I modify it?
    2) Is it possible to neglect 5 channels since I am only using 1 channel for EEG data, 1 reference and 1 ground in Matlab code. If I neglect the remaining channels (namely always 0) it can be suitable?
    3) Different than Matlab, is it possible to modify the GUI code and get the Raw data as blocks (like 5 minutes portions) for example in 15 minutes record I want 3 txt files rather than a 1 raw data file. By this way, I do not need real data stream in Matlab I can only call the 5 minuted txt files by order and process them?

    According to you which route should I go, I am open for any detailed advices especially about Matlab issues and comments also..

    Thank you very much
  • Does the fprintf functions in ReceiveData.m write the EEG data as raw file format? So is this possible to transfer those to a txt file by neglecting remaining unused channels?
  • @wjcroft Hi sir, do you have any idea about this issue?
Sign In or Register to comment.