Adding WiFi, faster BT, and other connections for v4?

My application requires a significantly higher sample rate than is currently available.  There seems to be a major bottleneck at the uC -> BT interface.

I'm interested in people throwing out ideas for a better connection for the next version of the hardware.  I'd like to see SPI, I2C, UART, and USB connections pinned out to provide more connectivity options, but in keeping with the wireless idea it would be nice to see wifi or bt options that could provide a decent data rate.

The ADS1299 supports 16 ksps, which is:
16 ksps x 8 channels x 24-bits = 3,072,000 bps or 3,072 kpbs or 3.072mbit/sec
or
16 ksps x 24-bits = 384kbps/channel

This is a LOT of data.  But, it would be nice to support as much of this as possible.  It would be possible to compress this somewhat or use the extra date to oversample it up to 32-bit and compress it before transmission.

So something along the lines of a wifi connection doing 10mbit/sec would be optimal.  If a 10Mbit connection could actually achieve 6Mbit in the real world that would support 16 channels at full speed.

Most people probably don't need this sort of speed, but it would be nice to eliminate any bottlenecks and provide the option for much higher data rates.  Since there are a plethora of solutions out there it would be nice to look at a few if people can throw them out there!

Comments

  • edited March 2015
    @JakeStew  If you look at the tables on page 6-7 in the datasheet you can see that the noise level increases considerably at sample rates above 1KSPS, which is fine for EMG but probably not optimal for EEG.   I agree that higher data rates are important, however.  I personally would like to be able to sample EEG at round the 1KSPS level to investigate full-spectrum EEG up to 200Hz, and I too would like to see a version of OpenBCI which allows the user to add their own SPI, I2C or UART serial communications.The HC-05 serial bluetooth 2.0 module is capable of 1382400 baud, at least in theory, and is very inexpensive.  I wonder how hard it would be to use just the OpenBCI extension board and one of the many small inexpensive microcontroller boards, if any can handle the higher data rates needed.

    Dr. Phillip Low talks about higher frequencies as the brain's 'dark matter' in this now 6 year old TED talk.   Check out the 6-8 minute mark or so.




  • edited March 2015
    The forum lost my damn post!

    Anyways, looks like at higher sample rates you can get 2000 sps for about the cost of one bit.  That would be something to shoot for.

    > The HC-05 serial bluetooth 2.0 module is capable of 1382400 baud,

    It's a shame they didn't pin out any interfaces and stuck us with their slow BT solution.  Would have been nice if we could add our own $7 BT module and get 10x the data rate.
  • biomurphbiomurph Brooklyn, NY
    This is something we are actively exploring for the next revision of OpenBCI.
    The bottleneck in our current system is the serial connection between the uC (ATmega/PIC32) and the RFduino on the board.
    The RFduino on the Dongle, for example, has been verified up to 1M baud over the FTDI serial link.

    If this bottle neck could be worked around (by, for example, bypassing the uC and doing all of the SPI bus control with the RFduino) then the limiting factor would be how much data could be squeezed over the Gazelle link. I think it could get up to 500SPS, and more with the right kind of buffering/compression.

    wifi is also an option. It's attractive because it requires only one module per kit (!) and holds out the promise of higher data rates on a local network. The problem is that wifi is consistently a pain in the but to configure.... We're not giving up on it yet, and we're eagerly awaiting our Spark Photon to test with. 

    In our testing, we use a dummy data array of human-readable bytes (0 to F in HEX is the obvious pattern, but any ascii works). If you are interested in benchmarking any radio system, we recommend starting this way.

    In regard to the Daisy card, we do not have plans to sell it separately from the 16 channel R&D kit. 
  • wjcroftwjcroft Mount Shasta, CA
    Jake,

    Can you elaborate some more on your application? Sounds like you are doing EMG, how many channels? Rather than waiting for new hardware, why not just mod the firmware to send fewer channels at a higher sample rate? And with compression if needed.

    But I also get the impression you want to do significant processing on the 32 bit board. More details? Is the chipKIT not going to be enough for your app? Do you plan to purchase a board, or are you going to wait for V4?  That could be a long wait.  :-)

    If you want STM uC, checkout James' system on this thread. He is also into UAV integration. Those boards were hand baked in his toaster oven / reflow oven. So not yet a production item.

    http://www.openbci.com/forum/index.php?p=/discussion/81/check-out-my-hardware

    William

  • Thanks for the link and info!
    My application is spatial filtering of SEMG arrays for a wavelet decomposition application.  So unfortunately I need a lot of high resolution, high sample rate channels.
    8 channels would be enough to get a little further along in the requirements determination, 16 channels would be the starting point for the setup I envision, but I think 32 channels will be needed to cover the surface area at the spacing I need in order to sample enough SMUAPs.

    Because it is a fairly daunting project, it's really too early to run into major bottlenecks.  I might not need quite as much as I think, but recognizing wavelet features through the skin is not an easy task.  Just dealing with the data rate is going to be difficult.

    One technique I'd like to try in order to deal with this is having good integration with the firmware.  I'd like to have the computer, in concert with the firmware, manage a lot of hardware and software manipulations in order to localize specific MUAPs.  That may involve reading only certain channels at certain times in order to reduce the data load.  Because the MUAPs are running longitudinal to the muscle I think I can focus on columns in the array individually to some extent.

    If I can localize some of the close to the surface SMUAPs at that point I'd like to try running some simple spatial filtering in the firmware.  If this can be done, I'll have a virtual channel for each SMU rather than physical channels based on electrode location.  Once this is working the data rate can probably be reduced.

    Once the spatial filtering increases the SNR to the point that reliable SMUAPs can be easily identified by simple amplitude only the more distinctive features of the wavelet need to be transferred.  That is, I'd only be interested in from the rising edge to the falling edge and the features in between.  The random noise in between from other SMUAP locations and general system noise would not be interesting.


    So I'm not dissing the system as it exists, I just have such unique requirements that no prefab system could probably satisfy.  Since I'll probably be doing a bit of hardware I have to shoot for the moon, but I also don't want to wander so far off into no-mans-land that I can't find any good advice or collaborators.

    Can you elaborate on the bottleneck a little more?  I read the thread dealing with attempts at I2C and a technical description of some of the issues, but I'm not sure I really understand the nut of the issue.  Seems like maybe there is some confusion on what the actual bottleneck is, at least in my mind.

    I'm glad to see someone's working on STM32 based designs!  I've got quite a few of their dev kits kicking around.  I see them as a leader in the field, and they are definitely crushing it on the price/performance ratio and cheap dev kits/programmers.  I've done a fair bit of 8-bit PIC programming, but they're just not a leader in 32-bit and I don't see them being a leading player in the future unless they change a number of their business strategies.


  • wjcroftwjcroft Mount Shasta, CA
    edited March 2015
    Jake, thanks.

    re: thread discussing data rate limitations, post any followup questions there,

    http://openbci.com/forum/index.php?p=/discussion/248/constraints-on-data-rates-thru-dongle

    You might have interest in this project aiming at multiple ADS1299's, 64 channels worth(!)

    http://www.eeg64.com/?p=98

    I only use EEG for neurofeedback, so I have no experience with sEMG. Once you localize MUAPs, what is the end goal? Is this a type of therapy device that will help people recover from muscle injury? Or is it used by athletes for conditioning optimal performance?

    I do see that there are quite a number of commercial companies in this field,

    https://www.google.com/search?q=8+channel+semg

    That search turned up these guys, selling an 8 channel bluetooth sEMG setup for $215. Fantasy or Reality?

    http://www.flexvoltbiosensor.com/

    Regards,

    William
  • I've run an ADS1298 at 8 kHz over USB using a Teensy 3.1. The bottleneck with that system was the way SPI is implemented on the Teensy. I've always wanted to give DMA a try, but I haven't had time for that, yet.

    These days I've been looking into compression of EEG data, but nothing super useful turned up. When you receive data at 3 Mbit/s with your microcontroller, you're not left with many of processor cycles to do work with each sample - and if you're not shovelling in the data through DMA your left with even less processing power.

    About your requirements: it's not easy, but if you invest some time and money, it's definitely doable. Does this system of yours have to be wireless, or is this not a hard requirement?

    Best,

    Ferdinand
  • biomurphbiomurph Brooklyn, NY
    @ferdinand we designed the system to be wireless, but there's nothing stopping you from hacking it
  • I think for noise reasons wireless is required.  I'll look into what sort of data rates I can get out of the several $7 serial BT dongles I have kicking around.  I can't imagine not being able to get at least 500kbps.

    A lot of the literature in the field uses 16-bit samples @ 1000 Hz.  So I'd like to get above that.  I'm not really looking to replicate existing work.

    My interest is primarily in diagnostics.  There's a lot of simple measurements like conduction velocity, repetition rate at X% MVC, resting activity, recruitment rate for various tasks, fatigue, etc..

    My math skills are not that strong, so I always prefer a brute force or "guess and check" approach.  I think this has been somewhat missing from the current research, and also that people have not leveraged simple manipulations done in silico.

    Thanks for all the great links!  Some I had seen before, but many are new to me.  Sorry to throw out so many acronyms, but it seems like everyone here is pretty well educated on most things.  If you can't figure out something I say, feel free to ask.
  • For noise reduction you don't necessarily need a wireless connection, just an electric isolation between the ADC board and your PC. That can also be achieved with opto-couplers or digital isolators (TI, ADI).

    The OpenBCI kit includes everything you need to build a wired system. Just connect the dongle directly to the microcontroller. For additional noise immunity and safety, you can power the ADC board from a battery and isolate both parts with high-speed opto-couplers.
  • wjcroftwjcroft Mount Shasta, CA
    edited March 2015
    This USB interface and power isolator is using the Analog Devices part ADuM4160, and DC-DC converter.



    ADuM4160 5kV isolation exceeds the 4k medical device requirement. Runs at up to 12 mbps. However... DC isolation may not be as high, check CircuitsAtHome site.

    Here's another isolator, based on the same AD chip,  http://hifimediy.com/usb-isolator
  • Great link that looks like a wonderful product!  Reasonably priced too!

    I don't see much in the way of filtering on the device side though.  Looks like a switchmode power supply through an isolation transformer.  But just one cap for filtering on the output?  Does anyone have any experience with what sort of power supply ripple this would have?

    I would think you could just ignore the USB power and run off a battery.  Anyone see any issues with this?
  • wjcroftwjcroft Mount Shasta, CA
    Jake, so there are two separate usb isolator boards here, the one from CircuitsAtHome mentions an optional extra linear regulator / filtering following the DC-DC converter for high requirement audio applications. At this link,


    However the HiFimeDIY device (and other products offered) is specifically FOR digital audio applications, and reviews on that page indicate no noise issues.

    The OpenBCI main boards have their own regulators obviously, but since almost all users are battery powered, not much to compare with. I myself am using a Lithium boost converter with no issues. I think it's your choice how you want to power.

  • wjcroftwjcroft Mount Shasta, CA
    The HiFimeDIY device, and their other products are in stock at Amazon, some good reviews there. So Amazon return policies apply; if you have any issues whatsoever, can return within 30 days.


  • I'm thinking of whipping up a design similar to peabody's.  I'll probably go a fair bit more simply.

    I have plenty of STM32 dev boards, one or two ADS1298's, and a couple serial-> BT dongles kicking around.
    So I'll probably throw the ADS1298 and ADuM4160 on one board, along with headers/pins/sockets for a STM32 dev board and BT dongle to plug right into that main board.

    That might get a bit bulky, but I don't want to fight tiny components any more than I have to.  The ADS1298 is close to the limits of my etching technique, but the rest should be easy enough.

    Is there any special considerations I should be aware of?  Board trace impedances, board dielectric issues, grounding issues, or anything else along those lines?

    Also, would there be any strange issues with leaving out the accelerometer?  I don't really see what it has to do with EEG.  Some of my STM32 Discovery boards have 9-DOF IMU gear on them already, so it would be easy enough to just use one of those, but I'm not sure I would get any use out of it and they're a little bulkier than some of the other dev boards.
  • wjcroftwjcroft Mount Shasta, CA
    This adapter may be helpful, not sure though how this would impact your star grounding etc.

    http://www.ebay.com/itm/QFP64-PQFP64-TQFP64-0-5mm-Pitch-10x10-mm-IC-Test-Socket-Adapter-Programmer/260708879937

    image

    Your application does not need accelerometer, was added as a Kickstarter incentive; can help to correlate head motion artifacts for EEG.

    Grounding and the cleanness of the analog power is a fine art that Joel @biomurph may comment on. :-)

  • Thanks for the link.  I'll probably take a stab or two at etching them and if that doesn't work out well enough then I'll order some boards from Oshpark or another board house.

    If I go that route I'll post up the board files for input and see if anyone else wants some boards to follow along.  Reflow stations are so cheap these days there's no reason everyone can't prototype with SMT components.
  • edited April 2015
    I just came across the ESP8266 SoC WiFi chip.  This chip is available on a variety of "WiFi Serial Link" boards now for very cheap (<$5).

    Looking into this things just seem to get better and better.  The firmware is open source and there is a community growing around the chipset...

    Boards can be found here...
    There seems to be 8 different boards available for under $5!

    The firmware seems to be under rapid development.  There is an Arduino IDE available for the chipset and some of the firmware looks like it supports python/LUA.  There's also a HTTP server version.

    So this could really get things going regarding solving problems with throughput and sample rate with the current designs.  Maybe someone could even come up with a HTTP server that lets you "Log into" the EEG headset via a simple web interface and start getting data streamed to your computer!
  • edited April 2015
    Just to tie things together (maybe a merge is in order)...

    I found a ESP8266 SoC WiFi chip that can be had ready to go on boards with built-in antennas and antenna jacks for around $4.
    Might be a great solution for the next version or retrofitting existing boards.

    I didn't think to add the post to this thread, where it probably belongs.

    EDIT: Looks like the threads got merged, thank you!
  • biomurphbiomurph Brooklyn, NY
    I'm alittle wary of the bang-good folks. 
    They are cloning my Pulse Sensor with no attribution or recognition of my work at all

    I'm not sure it's a good idea to go into production while relying on their stuff. 
    Sometimes, you do get what you pay for.

    That said, I am very interested in how your project goes. Please keep us informed, and if you would like to publish your progress on our Community page, we would be happy to link to your RSS feed.
Sign In or Register to comment.