Go Down

Topic: neurofeedback with arduino (Read 24424 times) previous topic - next topic


but what are the chances of beeing electrocuted by 5V equipment?

Quite high actually, and it could be fatal. It's not the voltage that kills you it's the current. As you have attached electrodes to your body, probably using electrode gel you have a very low resistance. Therefore it doesn't take much to pass a few milliamp through you which could be sufficient to kill you.
Ad you touch the signals given at the output side of the amplifier you form a positive feedback loop which puts the whole of the supply of the op amp across the electrodes. If these electrodes are across the temples it can hurt.

I know, I did this back in 1973 hooking myself up to various voltage controlled oscillators of a synthesiser.



just happened to read the wiki article about the arduino and they mention this:

"The Programmable Chip EEG BCI" - an Arduino-compatible schematic and PCB retooled into an EEG brain-computer interface.


You guys know it probably already.


It's all rubbish, it doesn't work.


Grumpy_Mike, how can you say that? First of, it's proven technology. EEG has been used in the medical field for decades now, but without much pressure on further development because the huge, clunky and precise machines they use in hospitals fulfills their needs perfectly.

Now, what is an EEG? Something that picks up an electromagnetic field/signal, amplifies it and applies Fast Fourier Transform algorithms to the dirty, noise-like signal. Seems pretty straight forward, doesn't it..?

With hospitals using this tech for decades, and 3 different home-EEG products out, you can't really dispute the fact that it does work. So what are you whining about? What is it you think is rubbish? Do you not think we can consciously affect our brainwaves?

Check out http://www.nytimes.com/2007/08/26/business/yourmoney/26stream.html?_r=1

Here[ch8217]s how Omneuron uses fMRI to treat chronic pain: A patient slides into the coffin-like scanner and watches a computer-generated flame projected on the screen of virtual-reality goggles; the flame[ch8217]s intensity reflects the neural activity of regions of the brain involved in the perception of pain. Using a variety of mental techniques [ch8212] for instance, imagining that a painful area is being flooded with soothing chemicals [ch8212] most people can, with a little concentration, make the flame wax or wane. As the flame wanes, the patient feels better. Superficially similar to an older technology, electroencephalogram biofeedback, which measures electrical feedback across multiple areas of the brain, fMRI feedback measures the blood flow in precise areas of the brain.

Notice how medical experts are using fMRI (and EEG) to create a feedback loop that essensially lets the patient control activity in targeted areas of the brain? Ever read the countless studies about those pesky ADHD/ADD kids who get to play EEG-games where mental concentration and focus is rewarded/required? Check it out. The benefits they recieve are huge, even compared to putting them on drugs (not to mention more permanent, more healthy, etc.).

Lastly, I myself have the OCZ Neural Impulse Acutator. No, I am not one of those guys who sit through 30 minutes of randomness, and when the right thing happens go "YEAH, I did that, with my MIND!". I have used it (if sporadically) and can vouch for it working. When I look at the brainfingers screen I can, with a little effort, pull all the bars all the way down,and I have some control of one alpha and two beta channels.

My only real beef with the OCZ NIA is that once inside a game you don't see the analog feedback (brainfinger bars). You divide each bar into zones corresponding with an action (keypress, keydown, mouseclick, etc.) and without continous feedback it gets very difficult to know if you are moving the bar up or down.


Do you not think we can consciously affect our brainwaves?

It has been shown that we can control our mood and our mood affects the sort of brain wave activity produced. This has been used in therapy and I made a brainwave feedback sound synthesiser back 36 years ago. However, using thought to produce an action is just so much hockum.  Peoples ability for self delusion knows no bounds. It's a pseudo science. I know I am not going to convince you as you have convinced yourself already.

If brain wave analysis was any good then researchers would have made progress years ago. That is they would have found out things that they now can find out with magnetic resonance imaging. It is rather like connecting a long wire to a diode and listening to the result and trying to work out the news. What you get is all the AM radio transmissions being sent all at once. Without a filter it makes no sense. And just doing an FFT is not a good enough filter in this case.
When we have amputees controlling prosthetic limbs with mind power we will have cracked the problem. Until then you are just dreaming.


Jan 14, 2009, 06:20 pm Last Edit: Jan 14, 2009, 06:21 pm by vputz Reason: 1
I made a brainwave feedback sound synthesiser back 36 years ago. However, using thought to produce an action is just so much hockum.

Er, if you believe that we can control brain wave activity via mood, and that you made a brainwave feedback sound synthesizer, then that's all that's needed--just take the same data you were using to produce a sound level at some frequency, and make that instead move a ping-pong ball in a tube at an analogous height level.  OOOO, you're moving the ping-pong ball with your mind!  It might not make sense ("If I think agitated, angry thoughts, the ball moves up!") and would be a wretched control system, but it would be possible.

I'm sure no one is suggesting that you can actually move objects with your mind, or that you can think 'move right' and your character 'moves right' JUST AS IF YOU WERE THERE.  But it's totally reasonable to think that you could map some sort of neural activity to some sort of input axis.  For that matter, it's been shown that humans can control blood flow, etc to a degree using their mind (ie, thinking "my hands are warm and heavy" to increase blood flow, or sexual arousal for that matter), so mapping skin temperature to a single-axis motion would work just fine, and indirectly you would be "moving something with your mind"--it just would be a nonsensical mapping.

When we have amputees controlling prosthetic limbs with mind power we will have cracked the problem. Until then you are just dreaming.

I hope no one believes that a single-axis device like Milton's Star Wars toy would be analogous to the incredible communication needed for a prosthetic limb!

Basically, what I'm getting at is that I think you both agree, but are differing on terminology.


Jan 15, 2009, 02:10 pm Last Edit: Jan 15, 2009, 02:38 pm by PlastBox Reason: 1
vputz, in reply to your reply to someone elses reply, I just have to say..

How do you define "nonsensical mapping"? When a human child is born everything it does would qualify as "nonsensical mapping" (except vital stuff like breathing, heart beating, etc). The kid waves it's arms and legs around building senso-motory correlations. I'm thinking that using an brain->computer interface like this would be the exact same thing. The reason it's damn sporadic when you try it is that.. well.. how good would you be at controlling your tail if you all of a sudden had one? I'm betting it would probably just flail wildly and "nonsensically" for a good bit of time before the cerebral cortex got it's connections straight and figured out what brain-action resulted in which physical-action.

I think that if someone got a mechanic arm controlled either by EEG or by a neural implant (in the cortex, which has been prooven to work btw), they would with enough trial and error learn to control the arm. Not only that, using the arm would become more and more intuitive!

Check this out: http://www.youtube.com/watch?v=BMovwbye7tE

A direct implant is more accurate than EEG readings, however the technologies do just about the exact same thing; extract a very general signal from the brain that changes depending on a multitude of unknown factors we have never had the feedback to conciously affect ourselfs. Still... see how naturally the monkey uses the arm to grab food and feed itself...? ;)

Edit: Don't missunderstand. I do know it is not possible to make a machine that will read your mind, like shooting in a game by thinking "shoot!". I also know that EEG machines are restricted by a rather low resolution compared to the immense number of neurons and dendrites in the brain, so I'm not saying we'll be seeing anyone sitting around knitting or soldering surface mount components with an EEG controlled prosthetic limb any time soon (or ever).

Just saying that for basic control of basic stuff, this will work given enough practice. It will also become more intuitive with use, so while I know I need to focus and relax to make the Beta1 channel on my OCZ NIA drop and somehow un-focus to make it rise, it is conceivable that with time making this small change to my all-over brain signal will be as natural as bending a finger.


Jan 15, 2009, 05:29 pm Last Edit: Jan 15, 2009, 05:31 pm by vputz Reason: 1
No, that's reasonable to an extent (and I totally dig the monkey/robot video, which I'd seen before--good stuff).  What I'm getting at is that most of those mappings are already established by the time you graft on some sort of reader, so that rather than establish completely new paths, you are using old paths and splicing an additional response onto that.

So certainly you can train yourself to get the new response, particularly if you could use a proper sensor (ie motor neurons to control an arm).  I'm saying it's nonsensical in the sense that you're not using motor neurons (or a "motor" portion of the brain proper) to control motion; it'd be like creating a device which allowed you to move an arm based on what smells you were remembering.  Theoretically you could play chess with it, with a good enough selective olfactory memory, but then someone could come along with roasted garlic and you'd punch the other player in the face.  It's the brainwave-scanning analog of something like a backhoe's hydraulic push-pull controls--simplified, and you can certainly use them to control (even skillfully) but it's not like an extension of yourself.

We're still in early days of this stuff, but I do have high hopes for prosthetics as well.  Surface eeg-style electrodes are just a long long long long way from targeted neural implants.


Jan 15, 2009, 10:54 pm Last Edit: Jan 15, 2009, 11:07 pm by PlastBox Reason: 1
...but then someone could come along with roasted garlic and you'd punch the other player in the face.

Seriously... I laughed ;D

From what I remember reading about the monkey-implant and other similar implants placed in humans, these devices tend to become very intuitive because the placticity of the brain is far beyond anything anyone imagined possible just a few decades back. I assume the signal read with an EEG can't really be connected to one single "brain-action", but of combinations so complex only our amazing brain and many, many hours of use can figure out the combo needed to do something. To elaborate on your brilliant example, "punch opposing player in face" would likely correspond with "remember rosted garlic"+"recall the feeling of scratching an inching ass"+"focusing"+"relaxing"+a gazillion other things too small/abstract/complex for me to put into words. The more you punch people in the face, the more reinforced all the neural paths involved become and the easier it becomes for you to repeat it.

Ever read about the work of Professor Bach-y-Rita? Amazing research on brain placticity though he worked on the exact opposite thing; sensory substitution.

I see your point, and it's very valid. But I still want to argue a bit. ;) If I use an apparatus that reads my Beta waves (level of awareness) and uses it to something useful like controlling the computer cursor up and down, what's to stop the brain from developing, "hooking up" so to speak, a way to generate the desired output seperate from actually altering my state of awareness?

I remember reading about a project, german I think, where a paraplegic patient got this exact same implant. If he was not trying to do anything special, the cursor moved down. If he emulated the feeling of waiting anxiously for the light to turn green, the cursor moved up. This allowed him to use custom software to write, e-mail, control his tv and the lights in his apartment.

What's even cooler (and actually to the point :P) is that this man, who was forced by his handicap to use this system for hours and hours every day, told the researchers that eventually he was in fact moving the cursor up and down as naturally as if moving his arm up and down (ie. no longer having to visualize the red light etc.). In addition to this, tests they did showed that his actual level of awereness no longer greatly affected his control of the cursor much.

Alas, the sources are all but lost. I read about this man about 4-5 years ago, back when brain-computer interaction seemed the stuff of science fiction. :P


Actually, I find all that reasonably believable and very exciting.  The confusion I have is whether or not the old patterns still run or not (say your fellow who could move the cursor with feelings of anxiety so that he could write email--would this eventually work so that anxiety and cursor movements are separate, or would it just eventually evolve into a PATHOLOGICAL TERROR OF EMAIL?--okay, mostly kidding there, but you get the idea).

The other side of this is that a permanent implant is, well, permanent and thus probably training to some extent at all times.  By its nature, a surface scanner is only in place for minutes at a time, so I can only imagine that training would take much longer and be less effective.  It's still worth pursuing, though.


Well, like I said, a physical action is not directly bound to one, or even a thousand, clearly definable actions. When that guy visualized waiting for the light to turn green, "charging up" to instantly slam his foot on the acceleration, his brain was likely doing a ton of other stuff that affected the implant and the algoriths parsing the signal as well. Every brain is vastly different, every movement, thought, recollection including many different parts of the brain.

My guess is, the brain can find many different ways of emulating the signal that caused the cursor to respond. There are.. what? Three billion neurons in the brain (give or take a few)? That beeing said, I think it would be pretty much impossible to pick out the patients awareness from the incredible jumble of things that go on inside our heads.

Reverse the process and make a device that reacts to some given signal from the brain and provides feedback, and no matter what that signal might be the brain (through a feedback loop and reinforced learning) will eventually figure it out.

Kinda like brute forcing with the worlds most powerfull parallell processing park, where the solution is the desired output that causes the cursor to move, and the movement of the cursor is an instant reward telling the brain: "Hey! That was pretty close man, do it again!" :D


Yeah you're right. I am also here to share some good thoughts for you guys. I know this really can help. This is about choices for healing - body, mind, spirit.
Create Your Health (CYH) is designed to inspire and give you choices regarding improving your life - physically, emotionally, and spiritually.  Each episode will introduce you to a particular therapeutic tradition and demonstrate what a treatment within that practice is like. Check out their website createyourhealth.com  and discover several alternative health practices and take charge of your life to be able to live pain free again - no drugs and no surgeries.


I know this is old but i was just looking into the eeg/arduino/uc idea.

There is near ZERO risk from 5v from any source. Theres a reason they use 10k+ voltage to execute people.. the resistances in your body are very high. The gell is used to bypass Skin resistance. The skin is just the first line of the bodies defense. Additionally unless you just put a bridge rectifieer directly to the wall receptacle power supplies just cant output that kind of amperage/voltage. Yes if you attach a professional voltage supply directly to yourself you could probably electrocute yourself. Attach a 5v wall plugin power supply though.. it cant happen. The voltage would have to fry every component in circuit without frying the traces and fuse it all into one big conductor. In this univers that isnt ever going  to happen.

If someone figures out the electode/gell/amp setup id LOVe to try this. Might try hacking up some small uc (2313 etc) electrodes so that you not only amplify at the electrode but encode it then send it to a full on decent Uc for processing.


I know this is old but i was just looking into the eeg/arduino/uc idea.

There is near ZERO risk from 5v from any source. Theres a reason they use 10k+ voltage to execute people..

Dammit. There goes my idea for an arduino electric chair.

Go Up