Brainbay with DIY ADS1299 board

wjcroftwjcroft Mount Shasta, CA
edited June 2015 in Other Platforms
This discussion was created from comments split from: BrainBay, install & test.

Comments

  • Hi,
    I have a problem of using BrainBay with ADS1299. I used a different microcontroller in my design and I sent the data with the same protocol as the OpenBCI.
    Byte 0:0xA0
    Byte 1:Packet Counter (i=i+1)
    Byte 2 EEG Channel 0 (high)
    Byte 3 EEG Channel 0 (middle)
    Byte 4 EEG Channel 0 (low) 
    Byte 5 EEG Channel 1 (high)
    Byte 6 EEG Channel 1 (middle)
    Byte 7 EEG Channel 1 (low) 
    .
    .
    Byte 23 EEG Channel 7 (high)
    Byte 24 EEG Channel 7 (middle)
    Byte 25 EEG Channel 7 (low) 
    Byte 26-27 Acce_x
    Byte 28-29 Acce_x
    Byte 30-31 Acce_x
    Byte 32 0xC0
    In OpenBci I insert "Insert Element" -> "Source" -> "Biosignal/EEG Amplifier" -> "OpenBCI8channels". The point is I can get the data by using the oscilloscope but the range is always between +-500uV which is not correct and it should be more. Even if I define a variable as a counter (int32_t i=i+1), the data on the oscilloscope is in a pulse format between +-500uV.
    Here is the way that I sent the data.UartSerial ((char)(i>>16))UartSerial ((char)(i>>8))
    UartSerial ((char)(i))

    So, I'm wondering if anybody faced with this problem or have any suggestion?
    Thanks
  • wjcroftwjcroft Mount Shasta, CA
    edited January 2015
    KMO, hi.

    Did you follow the suggestion in the previous 'Brainbay install' comment,

    You can then setup a very simple design / "circuit".  OpenBCI EEG
    element on the left, connect one of the channels to a Filter element,
    then connect the Filter output to an Oscilloscope. Filter parameters
    would be for example, a Butterworth Bandpass filter, order 6, from .5 hz
    to 40 hz.

    This removes the DC offset. Without the Filter, your scope will be "pinned" to one of the + or - rails.

    The + - 500 uV is not the full range of the ADS1299, but just a medium range value. Such that you can use the Gain slider on the scope to zoom in and out (from full scale range 5 uV to 50000 uV). By right clicking on the actual EEG output pin, you can see that the full range is + - 187500 uV (+ - 187 millivolts), which is very large. You can set any range you want by right clicking a scope pin and putting the values there.

    The adjustable range on any block element input and output pins, is a unique feature of Brainbay -- which is documented in the user manual.

    I assume you've tried your device with the OPENBCI_GUI Processing sketch?

    William

  • Thank you very much for your answer and suggestions.

    In fact, the problem is, I have some sort of saturation at +-500uV no matter of the scale of the oscilloscope. Even if I change the oscilloscope range, the level of the signal remains at 500uV or it changes sharply between +-500uV. I checked the Chris source code and any sign problem issue in my code, but i didn't find any problem. As you suggested, I added the filter to remove the DC part. However, the signal is still changing very fast. It seems that the BrainBay plot the data in 16-bits instead of 24.

    Kaveh
  • wjcroftwjcroft Mount Shasta, CA
    Kaveh,

    > It seems that the BrainBay plot the data in 16-bits instead of 24.

    No, that's not true, all the input EEG element blocks convert their native mode integer data streams into a stream of floats, normalized to ((float)1.0) = 1 microvolt. All downstream elements operate on this same stream of floats, including the Oscill. element.

    I'm not sure I can help you if you are not running the OpenBCI code on your microcontroller. I suggest you (1) try your test with the Processing GUI sketch. Or (2) write your own stream decoder based on what you see in the Brainbay source. (It's a simple state machine.) Or using the Processing sketch source. Then print or plot those values.

    You may want to use the test signal generation capability of the ADS1299. That way you eliminate any possible noise issues with your analog front end parts. Why you would be seeing the magic oscillation between + - 500 uV, I have no idea.

    With your ADS1299 input pins (signal, reference, and bias) all shorted together, you should see a pretty flat null signal output result. With a very small bit of inherent noise, as Chip has documented. (In this post he was using AGND vs. Bias.)

    http://eeghacker.blogspot.com/2013/12/self-noise-of-openbci.html
     
  • Yes, I tested the ADS1299 results in term of noise and the internal pulse generator by using Kst and Qt creator (Qcustmplot) to plot the data. So, I have coincident results by the datasheet. I can have blinking signal and Alpha wave by using these GUIs. According to what you said about the BrainBay, I guess the problem is coming from my side. I try to figure it out.

    Thank you for your answers. 
  • wjcroftwjcroft Mount Shasta, CA
    Here is the way that I sent the data:
    UartSerial ((char)(i>>16)); UartSerial ((char)(i>>8)); UartSerial ((char)(i));

    Kaveh, hi. I would be cautious with the way you convert the 24 bit integers into bytes for transmission. The data type 'char' is defined in various ways depending on the compiler. You may be better off with using an explicit '&' operation with a 0xFF mask.

    You say you have seen Alpha with your Qt plots. But I assume they were reading not the OpenBCI serial stream, but some custom stream that you created. Try converting the actual OpenBCI format stream and plot that.
  • biomurphbiomurph Brooklyn, NY
    KMO, what microcontroller are you using?
    If you link us to your code, maybe we can help to find the issue.
Sign In or Register to comment.