Forums > MaxMSP

neurofeedback with arduino


Mo
July 3, 2008 | 8:57 am

Hi everyone

My project is about connecting electrodes to Max through the adruino board to convert brainwave signals to sound .

Does anybody know how to make Max 5 to read these brainwaves ?

What type of amplifier I should use to connect the electrodes ?


July 3, 2008 | 7:36 pm

Reading the signals isn’t much of a problem as long as you can get the arduino code set up right, the analogRead(pin#) should be fine to get a 10-bit reading. There will be substantial stuttering with any analog reading like this, but there are multiple workarounds to smooth it out (low-pass filters, only sending if it changes a certain amount, taking averages, etc). Lots on this forum and the Arduino site to deal with this.

The amplifier is totally another story, this (as I understand it) is the main hurdle for a do-it-yourself project with brainwaves. The signals are *so* weak that whatever amp you use needs to boost them a lot and not distort them much… not an easy task, and might be pricey. If you find something let me know, as this fascinates me :) if you have some electronic skills you might be able to hack one together for not too much money.

It takes a couple of steps to get the Arduino working with the computer (drivers that are on their site), and then if it’s plugged in when you start Max, the serial object will see it and you can poll the values however fast you want. In your Arduino code, probably only send every 20-50ms so you don’t overload the port.

You’ll probably run into problems with indexing—like saying "this value is on electrode 1, this one is on 2", etc. If you send these two-element lists, it can be tricky to unpack them correctly in Max… sometimes they get read reversed. Look into the arduino2Max object online, this helps a lot. Also know that if you’re sending values as a serialWrite, as a *line* of data (not individual values), you’ll get an ASCII 10 and 13 for line feed/carriage return. These will need to be filtered out in Max to get to the real data. It’s not totally straightforward, so I’d look into arduino2Max, which essentially deals with these lists etc. so you can get at the data easily.

This is also a *very interesting* related product which I desperately hope works with Max:

http://www.emotiv.com/

They have everything packaged in the headset, so you can have all kinds of EEG and expression data sent to the computer. If Max can read this stuff, which it probably can, the sky’s the limit for audiovisual interaction via the brain!

I emailed them and asked if it would work with Max (like as a hi object, or via serial), but no response. Slackers!

–CJ


July 4, 2008 | 7:32 am

Wow this is indeed a very interesting product! This is exactly what i’m
looking for! Too bad they don’t reserve the product for customers outside
the States…
J.

2008/7/3 Seejay James :

>
> Reading the signals isn’t much of a problem as long as you can get the
> arduino code set up right, the analogRead(pin#) should be fine to get a
> 10-bit reading. There will be substantial stuttering with any analog reading
> like this, but there are multiple workarounds to smooth it out (low-pass
> filters, only sending if it changes a certain amount, taking averages, etc).
> Lots on this forum and the Arduino site to deal with this.
>
> The amplifier is totally another story, this (as I understand it) is the
> main hurdle for a do-it-yourself project with brainwaves. The signals are
> *so* weak that whatever amp you use needs to boost them a lot and not
> distort them much… not an easy task, and might be pricey. If you find
> something let me know, as this fascinates me :) if you have some
> electronic skills you might be able to hack one together for not too much
> money.
>
> It takes a couple of steps to get the Arduino working with the computer
> (drivers that are on their site), and then if it’s plugged in when you start
> Max, the serial object will see it and you can poll the values however fast
> you want. In your Arduino code, probably only send every 20-50ms so you
> don’t overload the port.
>
> You’ll probably run into problems with indexing—like saying "this value
> is on electrode 1, this one is on 2", etc. If you send these two-element
> lists, it can be tricky to unpack them correctly in Max… sometimes they
> get read reversed. Look into the arduino2Max object online, this helps a
> lot. Also know that if you’re sending values as a serialWrite, as a *line*
> of data (not individual values), you’ll get an ASCII 10 and 13 for line
> feed/carriage return. These will need to be filtered out in Max to get to
> the real data. It’s not totally straightforward, so I’d look into
> arduino2Max, which essentially deals with these lists etc. so you can get at
> the data easily.
>
> This is also a *very interesting* related product which I desperately hope
> works with Max:
>
> http://www.emotiv.com/
>
> They have everything packaged in the headset, so you can have all kinds of
> EEG and expression data sent to the computer. If Max can read this stuff,
> which it probably can, the sky’s the limit for audiovisual interaction via
> the brain!
>
> I emailed them and asked if it would work with Max (like as a hi object, or
> via serial), but no response. Slackers!
>
> –CJ
>


July 4, 2008 | 5:04 pm

The emotiv system looks pretty interesting, nice price too. I hope
it ships when they say it will…

I did a project this past spring with neurophysiologist/musician
David Soldier. We used the BioWave system (http://
http://www.biocontrol.com/), which came with a Max patch and some simple
demos. It worked fairly well, but with only three electrodes the
data was rather gross (lots of interpretation/massaging). We also
found that human-things like sweating can really mess up the sensing,
so you need to keep a cool head while performing. :-) The BioWave
is a little pricey, too.

I’m a bit skeptical of claims of seamless control of params via EEG
data. The signal is *very* noisy, and extracting directly usable
information from EEG activity is tricky.

Zach Layton has also done some interesting EEG/sensor work. I think
he built his own system, so he may be a good person to contact for
DIY info.

brad

http://music.columbia.edu/~brad

On Jul 3, 2008, at 3:36 PM, Seejay James wrote:

> This is also a *very interesting* related product which I
> desperately hope works with Max:
>
> http://www.emotiv.com/
>
> They have everything packaged in the headset, so you can have all
> kinds of EEG and expression data sent to the computer. If Max can
> read this stuff, which it probably can, the sky’s the limit for
> audiovisual interaction via the brain!


July 5, 2008 | 12:37 am

It should. I’ve used it and its pretty good. Been in dev awhile too…

bt

On Jul 4, 2008, at 10:04 AM, Brad Garton wrote:

> The emotiv system looks pretty interesting, nice price too. I hope
> it ships when they say it will…



Mo
July 5, 2008 | 11:09 pm

Thanx for the info

I will keep you updated and let me know if there is a way to connect the Emotiv to Max .

BTW do you think using EEG boards instead of arduino would help , and do u recommend any model ?

Mo


July 6, 2008 | 10:51 pm

Here are some resources for a DIY EEG/EKG box from Adam Overton:

http://plus1plus1plus.org/Resources/EEG_EKG/

Quote: Mo wrote on Thu, 03 July 2008 01:57
—————————————————-
> Hi everyone
>
> My project is about connecting electrodes to Max through the adruino board to convert brainwave signals to sound .
>
> Does anybody know how to make Max 5 to read these brainwaves ?
>
> What type of amplifier I should use to connect the electrodes ?
—————————————————-


July 20, 2010 | 12:15 am

I have an office in Orange County California that specializes in Neurofeedback, Biofeedback, Psychotherapy, and EEG. If you need any help, please don’t hesitate to ask. http://hansinkandassociates.com and visit our web commercial http://eeg123.com


July 20, 2010 | 11:31 pm

I assume you are familiar with openEEG

http://openeeg.sourceforge.net/doc/

Another commercially available system is Neurosky

http://store.neurosky.com/products/developer-tools-2-1

http://store.neurosky.com/products/neurosynth

Someone recently posted some Max-MSP drivers to connect directly with this gear: provides three channels of info: ‘signal quality’, ‘meditation’ and ‘attention’.

Some reviews…

http://rheide.wordpress.com/2009/12/13/mind-control-for-the-masses-neurosky-mindset/

I’ve heard the major draw back is they don’t give you access to the raw signal: you can only access their filtered data i.e. alpha/theta/beta/Eye Blink etc. – though they may have changed this.

I’m planning on getting one in a couple of months!


August 30, 2010 | 9:07 pm

Neurofeedback in Orange County California and EEG treatment can help with so much..from ADHD, ADD, Headaches, Depression, Addiction…you name it. We can help with Neurofeedback, EEG, Psycotherapy, and Biofeedback. We are located in Orange County California. Please visit http://www.hansinkandassociates.com


Viewing 10 posts - 1 through 10 (of 10 total)