EEG data distortion using HC-05 bluetooth

edited May 2019 in Build-it-yourself
Dear all

I don't understand what is happening with my EEG data. Randomly the amplitude becomes very high and distorts my applications.

I use cyton board with HC-05 bluetooth (not RFduino). Could it have anything to do with it?

Below I show some examples of this behavior:

In OpenBCI GUI it happens on data stream start, and on times: 20s, 27s, 30s, 32s,  1:01, 1:04.
Note the FFT and Band Power plots achive peaks.

In BioEra it happens when I receive "OpenBCI Warning - data continuity lost". For examples see what happens at second 13 and 15.

In my application it happens at second 8, 18 and 29.
I think it is related with cyton sdk warning:
"Warning: ID:<87> <Unexpected END_BYTE found <88> instead of <192>
Warning: Skipped 35 bytes before start found"
But I don't have certain, because it is not every time that receive this warning that this bug happens.

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Joe, hi.

    Can you clarify? Your Cyton board, was it purchased from OpenBCI, or did you build it yourself? You have modified the firmware, obviously to use HC-05. Is that using Bluetooth Classic SPP Serial Port Protocol? Do you have enough bandwidth to send the raw Cyton packets at 250 Hz? How do you know?

    Does this same distortion happen when using the default RFduino communications?

    Regards,

    William

  • Hi, William. Thank you for willing to help me.

    I did not buy the Cyton board. A co-worker built it for me.

    In the firmware, we only modified the end byte (C1 is the endbyte now) because we could not initially see the EEG signal. Just it!

    We are using the classic spp.

    As for baudrate, that doc http://www.electronicaestudio.com/docs/istd016A.pdf confirm the supported baud rate for HC-05 (9600, 19200, 38400, 57600, 115200, 230400, 460800).
    On Windows, I set the baudrate to 115200, which is correct to send raw data at 250 Hz. On HC-05, we set the same baudrate too. Are these baudrate settings enough?
  • wjcroftwjcroft Mount Shasta, CA
    The baud rate between the PIC and the HC-05 is one potential bottleneck. The radio bandwidth and air time available for the SPP is another. You might experiment with going up a notch to 230400.

    There may be SPP buffering issues, possibly adjustable, that could be relevant. For example how many bytes does the HC-05 accumulate (from the PIC), before sending out a packet? If too few, the bluetooth radio bandwidth capacity could be less than optimal. You basically want to use large as possible packets to reduce various radio protocol overheads.

    WIth the PIC and RFduino, when the serial port rate was increased beyond a certain point, the RFduino's background radio processing code would interfere with reception of incoming serial bytes from the PIC. Thus the rate could be increased no further.

    And on this other thread, explaining how a usb serial link was implemented, raising the rate high enough to reach higher sample rates -- was hampered by the way the PIC calculates baud rates. Some workarounds were listed.


    Regards,

    William

Sign In or Register to comment.