Modular Componentry for Programmatic Access

edited April 2016 in Software
I'm looking to write a Java library for OpenBCI that will use a serial library to communicate with the mainboard over the USB/RF dongle. Don't worry, if I actually get it done (50/50 chance) I'll open source it and even submit it to the OpenBCI folk to see if they want to have anything to do with.

I'd like the API to be *something* like this:

OpenBCI openBCI = OpenBCI.init(/*optionally, some config object*/);
MyEEGListener eegListener = new MyEEGListener();     // Implements EEGListener interface
openBCI.getEEGModule().startStreaming(eegListener);  // now the listener will receive & handle EEGFrames in a non-blocking event-driven manner, etc.
openBCI.getEEGModule().stopStreaming();                     // sessions over!

I'm sure this API will change; maybe a little, maybe a lot.

All this to ask my main question: what different "modules" are available on the OpenBCI? I see it advertising EEG, EMG and EKG capabilities, but so far I've only been paying attention (greedily) to EEG, which is what I particularly care about. However in the OpenBCI v3 Data Format I only see EEG data between bytes 3 and 26. Bytes 1, 2 and 27 - 32 are for QoS and/or accelerometer data. I'm not seeing where EMG or EKG data are being transmitted. Can someone please tell me:
  1. What are all the main "modules" (or whatever the correct term is!) of the OpenBCI? I have EEG, EMG and EKG. Any others?
  2. For all non-EEG modules, where can I find their data protocols, so that I could read their data from the USB/RF dongle via serial port?
Thanks!

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Have you completed the steps of the tutorial? That would answer your questions. Do you currently have the OpenBCI hardware there?
  • wjcroftwjcroft Mount Shasta, CA
    Also see,


    The OpenBCI_GUI, explained in the tutorial, is written in a dialect of Java, called Processing. So you already have some example Java stream parsing code to look at.

  • Thanks @wjcroft!

    When you ask "Have you completed the steps of the tutorial?" I assume you mean: http://docs.openbci.com/tutorials/01-GettingStarted

    If that's true, then "yes!", I have read through the tutorial! However, I'm not sure if the term "module" is correct, and was hoping someone from the community would be able to confirm/correct me there. So what do you refer to the EEG/EMG/EKG hardware capabilities as? Modules? Something else?

    Also, the tutorial does not dive into EMG or EKG data transfer protocols. Like I alluded to in my original question above, I was able to find, read & understand the EEG protocol without any problems. But for the life of me, I can't find documentation on the EMG or EKG protocols. Any ideas?

    Thanks again!
  • wjcroftwjcroft Mount Shasta, CA
    edited April 2016
    Until you have the actual OpenBCI hardware and do the steps of the tutorial, I'm not sure you will understand how it is possible to measure ALL of the signals EEG, EMG, EKG; these are all just biosignals represented by low voltages in the microvolt (EEG) or millivolt (EKG, EMG) ranges. They are not 'modules', they are just different signals. The OpenBCI channels can be configured to measure any of them.

    When do you expect you will be able to follow the steps of the tutorial with your hardware?

    Thanks,

    William

  • edited April 2016
    Thanks @wjcroft, I do appreciate you taking the time to answer my bevy of questions here.

    I am in the process of vetting OpenBCI out, to see if it will do what I need it to do. All of the questions that I've asked on this forum are important to me, and help shape whether or not I go ahead and purchase it. It's important for me to be thorough here, because all-in-all I will be spending anywhere from $200 - $900 on the hardware, which has very low WAF and makes it a tough sell. I am happy to make such a purchase, but cannot/will not do so until I am confident that I won't have buyer's remorse and find out that I need OpenBCI to do X when in reality it just does A, B, C and Z. I am making a conscious effort to thoroughly read the documentation and search for previous/similar questions ahead of time.  If I post a question that is clearly covered in the docs, or that has clearly already been addressed by a previous question, please just refer me to that page in the documentation or that duplicate question, and I will always happily redact my question.  However, if my question is not already covered in the docs, and has not been previously asked, then I assert the question is valid and should be welcomed with open arms by the community at large as the question will serve to both broaden and deepen OpenBCI's documentation. Make sense?

    Having said all that...

    It sounds like you are saying that the OpenBCI v3 Data Format that I mentioned above covers all types of biodata: EEG, EMG and EKG. And it sounds like the typical practice is to configure the mainboard to transmit one type of data at a time (that is, EEG or EMG or EKG data). Can you kindly confirm that my understanding here is correct?

    If I'm misunderstanding you here, then please clarify for me!

    If I am understanding you correctly, then what I'm trying to tell you here is that the documentation (the v3 Data Format specs) does not mention EMG or EKG data transfer at all - they only mention EEG data transfer. As such, I'm trying to understand where EMG/EKG data transfer is documented. Make sense?
  • wjcroftwjcroft Mount Shasta, CA
    Yes the same data format is used for all the biosignals. The steps of the tutorial show how you configure the mainboard with the OpenBCI GUI to adapt to the different types of signals. Typically the scale factor is changed so that you are measuring millivolts instead of microvolts.

    Thanks for that link on the WAF, worth quite a few chuckles.

    The measurement of EEG, EKG and EMG _IS_ covered and shown in the tutorial.

  • As always, thanks @wjcroft!

    But I feel like you think I'm asking X when in fact I'm asking Y (maybe not!). Maybe you're answering Y and I'm too bird-brained to pick up on it.

    To read data off the OpenBCI mainboard, you need a data protocol that says "these bytes represent X data", and "these bytes over here represent Y data", etc. I believe that this page specifically addresses this. But what I'm saying is: that page *only* addresses EEG. It makes no reference to EMG or EKG.

    Am I looking at the wrong page? Can you provide a specific link from inside the Getting Started tutorial that addresses EMG and EKG data transfer?

    Thanks again!
  • wjcroftwjcroft Mount Shasta, CA
    The mainboard is not targeted specifically at only one type of low voltage biosignal. But instead is capable of reading ALL biosignals in the millivolt / microvolt range. Please substitute "biosignal" or biopotential wherever you see "EEG" in the documentation.

    Because OpenBCI was initially an EEG oriented project, that influenced the use of that term in most of the documentation. The Texas Instrument ADS1299 chip on the mainboard, is a general purpose biosignal analog to digital converter,

    http://www.ti.com/product/ADS1299

  • Ahhhhhhh, *and the lightbulb goes on*. Thanks @wjcroft, that clears it all up for me!
Sign In or Register to comment.