# Sleep and Dreams > Research >  >  Homemade EEG

## apsinvo

Hi all. I've long wanted an EEG. For those who don't know, an EEG measures tiny voltages across the brain frequency range to map electrical activity in parts of the brain. We can use it to see beta, alpha, gamma, theta, delta, epsilon, etc brain wave activity in the different areas that we can monitor. Unfortunately, a professional one, even second hand, is too expensive. 

I am building an OpenEEG device openeeg.sourceforge.net/doc/ and I've gone for the maximum configuration/complexity with 6 channels. 6 channels means that we can measure voltage differences across 6 different areas.

I have three purposes for it;

1. Use it for neurofeedback training - i.e. practice with it to achieve the desired isolated activity/synchronous activity in/across different brain areas.

2. Look at meditation sessions, regular sleep, DILDs and WILDs. I have a good idea of what I expect to see here, but would be very interested to look at any interesting anomalys. 

3. Test Thomas Yuschak's explainations and research on LD supplements, and tie the different supplements into modified brainwave activity.

I have already set up a push button USB interface so that I can have my finger over a small touch sensitive button during any practice sessions. All I need do is apply the slightest bit more pressure over it, and it will log the timestamp. This will not interrupt meditation sessions or WILD. I plan to apply small pressure each time I 'switch out' another step through the relaxation/WILD process, and then tie up my markers with the brainwave activity.

If anyone is interested in any progress I make on this or has any other suggestions for uses or research in this area, please let me know and I will update the thread  :smiley:

----------


## nina

I am definitely interested. I've wanted one myself for years now. That's pretty awesome that you made one yourself.  ::shock::  How accurate is it? and how can you tell without a real EEG?

----------


## apsinvo

Still in progress - should be either finished or failed within 2 weeks  :smiley: . I suspect that as long as the circuitry and cabling is well shielded, and the electrodes make good contact, it will be quite accurate. I wont need a real EEG to benchmark accuracy. An inaccurate EEG won't show say loads of theta waves when there are really loads of beta waves, instead, there would just be inconsistent results everywhere and lots of noise that makes the brainwaves indistinguishable. I think that as long as I'm able to consistently repeat experiments with the same results, and see minimum line noise (there is a specially fitted DRL circuit that's supposed to help), the machine is accurate.

----------


## Jplecas

wow! Last week i was thinking about trying something like this for biofeedback purposes. Am very glad you posted the site where you are getting your resources from. Ill have to look it over later tonight. I would be interested in seeing photos of your progress and possibly trying this myself.

----------


## IAmCoder

Sweet bro, I have been working on an app for this, called "Lucid Scribe". It graphs and logs everything and has triggers that can play a song or recording when certain conditions are met. Let me know if you want to test, and I can get you the beta version. Thus far, however, I have only been able to get it to accurately trigger on the REM state through an accelerometer which picks up blinking. But perhaps with 6 channels it might work better on the EEG.

----------


## anderj101

I'm very interested to hear how this project works out. I've always been interested in the EEG devices, but never stumbled upon the OpenEEG project before.

----------


## apsinvo

> Sweet bro, I have been working on an app for this, called "Lucid Scribe". It graphs and logs everything and has triggers that can play a song or recording when certain conditions are met. Let me know if you want to test, and I can get you the beta version. Thus far, however, I have only been able to get it to accurately trigger on the REM state through an accelerometer which picks up blinking. But perhaps with 6 channels it might work better on the EEG.



Sure. I'd love to. I'm using active-robots.com/products/phidgets/sensors-phidgets-force-pressure.shtml to measure REM sleep. They're technically meant for measuring force, but when taped to the closed eyelids, during NREM sleep, they remain idle, only moving +/- 2 on a scale of 0-1000. During REM sleep they fluctuate +/- 30 so is easily detectable

----------


## Philosopher8659

The only time I was interested in an EEG was when I started learning things in lucid dreaming. I thought I might have somekind of brain malfunction, so I schedualed an EEG, which, turned out normal. 
Making one would be interesting, but learning how to read it might pose a challenge.

----------


## IAmCoder

> Sure. I'd love to. I'm using active-robots.com/products/phidgets/sensors-phidgets-force-pressure.shtml to measure REM sleep. They're technically meant for measuring force, but when taped to the closed eyelids, during NREM sleep, they remain idle, only moving +/- 2 on a scale of 0-1000. During REM sleep they fluctuate +/- 30 so is easily detectable



Perfect. I have written Lucid Scribe plugins for other Phidgets sensors and their SDK is great, so I should have this ready for you in no time...

----------


## IAmCoder

This one: 1131 - Thin Force Sensor?

----------


## apsinvo

Sorry for the late reply bud. I didn't see your reply. Yes, that's the one I'm using. Depending on what you have developed already, you could just take the force sensitive resistor and use it as-is, rather than getting the interface kit too..

----------


## IAmCoder

Ok, here is Lucid Scribe in all its beta glory. For now it should only pick up your CPU usage - just to show some functionality, so don't expect anything.

I will start on the force sensor plugin right away. How far are you with the EEG device?

Who can guess what file extension it will use to save Lucid Scribe Data!?  :Shades wink: 

And if anyone has biofeedback hardware that you would like a plugin for and can help me test - just let me know...

----------


## apsinvo

.lsd  ::D:  Software looks real nice. I'm still quite far with the EEG. In short, it works. It does detect and amplify signals correctly, and has produced some meaningful results on an oscilloscope. Actually hooking it up and reading data on the PC is some way away yet, although I'm 99% sure that I'm on the right track and that this is actually going to work, and that I'm not going to come up against some unsolvable issue at this point.  ::D: 

One thing you might want to look to integrate is the neurosky headset - I have one of those hopefully arriving tomorrow although according to DHL it's been damaged in transit :<

----------


## IAmCoder

Thanks! NeuroSky looks like it has some great support so I am sure we will be able to integrate it if the damage isn't irreparable. Were you able to run the base version of Lucid Scribe on your machine? And any luck with the test app for the force sensor?

----------


## apsinvo

I didn't run it just yet - note that you can use Phidget's API and open source drivers to fetch info from their sensors. Got the mindwave from Neurosky today. I'm not best impressed with it. I mean, you can see that it works in principle, i.e. when you breathe and clear your thoughts, the meditation arrow goes up, and when you focus intently on an object, the attention bar goes up. That's about as good as it gets though - great for 30 minutes of messing around. The raw EEG output is all over the place, looks to be quite inaccurate. There's only 1 channel which makes anything more advanced impossible. I've emailed to ask them if I can return it, and if yes, I might look at the emotiv one instead  ::D:

----------


## IAmCoder

Bummer about the mindwave. I am using Phidget's SDK in the test app, that is just their InterfaceKit-simple sample with an extra line of code to log the output to file. If you have Visual Studio or want to download the Express Edition, you can just run the sample and send me the screenshot instead.

----------


## apsinvo

Well my friends, I have completed the OPENEEG and unfortunately I have good and bad news. The good news is that it works. The bad news is that it doesn't work close to well enough for my purposes here. 

It works in so far as I can attach it and focus all my energy on something, to watch beta rise. I can then shut my eyes, clear my mind and take some meditative breaths for about 15 seconds, and see beta drop and theta rise. Quite impressive to see this in action.

Unfortunately, there is way too much noise, signal distortion and mess to really perform any real analysis further than watching meditation vs focus.

I have bitten the bullet as such, and purchased the Emotiv Research Edition ($750). I'm awaiting it's delivery, and very much looking forward to the results  ::D:

----------


## IAmCoder

Lucky man - let us know how the Research Edition works out for you.

Have you had a chance to run the Phidgets test app or sample code?

----------


## futureghost

That's F**king awesome.  :Shades wink:

----------


## IAmCoder

What app did you use to display the output of the OpenEEG? Any chance we can get a screenshot, please?

----------


## Ev

It's really cool to find this thread, and it's great to hear that you got this to work!

I also wanted an EEG  for quite some time. Would it be possible to combine the noisy homemade EEG with noisy homemade pulse oximetry, skin conductivity, actigraphy, breathing rate or something else to get a better understanding of the person's mental state?

 One of my projects involves a wearable sensor array based on Lilypad Arduino. It has an accelerometer, temperature sensor and (hopefully) will have a pulse oximeter. It is bluetooth enabled and should send data to an Android phone. The phone does data processing, and has an accelerometer and (light sensor?). I got the stuff ready, sitting on my desk, but my hands are tied with my latest Android project. It already involves actigraphy, and works. The next step would be to integrate bluetooth enabled EEG, or pulse oximetry sensor...

Together, there's a lot of data, maybe it would lead somewhere  :smiley:

----------


## Jplecas

any updates apsinvo? I really think some useful information could come from this kind of work and hope you are still at it!

joseph

----------


## apsinvo

Hi all, sorry for the delayed reply. My homebrew EEG is no good. In the basic form, it does work. For actual meaningful results, it is no good. There is too much noise, and the device is too unreliable and needs manual tweaking and calibration all the time. 
I am however still just as interested as before. I have purchased the RESEARCH edition of Emotiv's headset which includes raw EEG output and capture. It's a very good headset. I have performed several meditations with the headset on, and recorded meaningful and verifiable results. Also several 'active' tasks like math and playing piano and also noted expected results. Now the issue is, if you look at the picture of the headset on their site, you will see you can not lie down in it, or put your head on anything. How can you sleep in it? I am desperate to record the sleep cycles with it, and also an LD. It seems that the sensor pads can be removed, and a length of cable can be soldered to each plate, to extend it. How I can actually make a good reliable headset that will not fail as soon as I put my head down, and that i can sleep comfortably in (otherwise I will never be able to sleep or LD) I am not sure at all... Any suggestions?

Edit: If anyone wants EEG results or brain map pictures of me performing any particular task though (within reason  :wink2: ), I will be happy to send it

----------


## apsinvo

> What app did you use to display the output of the OpenEEG? Any chance we can get a screenshot, please?



Not using the OpenEEG any more but I used OPENVIBE with it. I can send pictures of the Emotiv EEG output if you want of any particular task

----------


## Jplecas

that looks like a fantastic headset. and the price is much less than i thought it would be. i would be interested in seeing an example of a meditation session. also would be interested in seeing what you were able to get with the DIY setup, just to compare how clear it is, since i was considering making one too. as far as lying down with the headset on.. that does look like an issue, how it extends far out. There is no way to rotate it? to get the headset frame rotated over the top of your head rather than the back? if not, i dont see why you wouldnt be able to just use a narrow pillow down towards your neck. and another pillow for supporting the top of your head. im sure there is a way to make it happen. It looks like a really great headset. I havent seen any wireless ones like that before. i would love to pick one of those up!

----------


## argo

I'm also on the quest for cheap EEG for use in lucid dreaming applications.

I'm playing with the Neurosky mindwave and I'm not all that impressed either.  I can't even really see a difference between when I focus or relax, the response seems random and if I clip earpiece to one finger and put another finger against the head sensor the results are pretty much the same as if I wear it on my head which makes me a bit dubious of their tech.

I'm looking at the Emotiv now, and you say you've been working with it with some success, is it worth the money?  Are you getting verifiable results that are not just randomly generated to appear you are doing something?  

I would think with the number of sensors on their headset it would be significantly better than Neurosky's single sensor if it actually works as they say.  I'm puzzled that Neurosky doesn't just make a "stereo" head set with right and left sensor pairs to improve the quality of the collected data.

----------


## apsinvo

argo -  My findings with the neurosky are the same - I sent it back. The Emotiv is very good, but pricey. If you want the raw EEG output you need the researcher's version - $750. It IS worth the money, but I suggest for that price you think hard about what you want it for. Fortunately, I have several purposes for it and things I want to test. If, as some people I have spoken with, they want to capture some sleep and an LD, then once you've slept in it a few times and marvelled at the EEG output, you're left with an expensive 2nd hand toy with no real use. Make sure you have several long term projects you can do with it so that you don't end up in that position!

----------


## Mental

apsinvo,

I can't help you with your project, but I can tell you I've wanted to try the same thing for at least 10 years.  The cost has always held me back.  It's always fun to find like minded people, especially with a goal that is such a niche.  In fact, it is a niche goal within another niche goal.

I will at least share my logic in wanting to do this, so other's might understand if they don't already.

1.  I want to be able to lucid dream any night.
2.  Accomplished meditators have enhanced awareness that makes lucid dreaming easier to achieve.
3.  Neurofeedback offers an accelerated way to gain skill in meditation.
4.  Sleep studies use the same type of EEG equipment that one would use with neurofeedback, and offers graphing of one's sleep cycles.
5.  Since Neurofeedback equipment and sleep study equipment are basically the same, and both are usefull for LD goals, then there you go...

Best wishes with your endevours, I'll be looking forward to more reports.

----------


## apsinvo

Thanks for your interest in my post! I am travelling at the moment but back home on Tuesday. I'm going to capture a few sessions;
1. Self hypnosis/theta trance
2. Breathing meditation
3. Transcendental meditation

I'd be interested to see the differences here. I'm going to wait an hour between each session to return to normal waking reality before going onto the next. There are some other variables to consider;
1. Combined effect of previous meditations
2. Time of day

I'll post results back ASAP.

----------


## IAmCoder

Bump!

----------


## shadowofwind

A word of caution in relation to neurofeedback, which I've worked with before:  it seems safe in the sense that you're not introducing any weird chemicals or other 'artificial' stimula into your brain.  However, by observing brain activity that's usually subconscious, you can control stuff that you can't usually control, just by being able to see the effects of your mental adjustments.  That stuff is all subconscious for various reasons, and one reason is to protect you from dangerous feedback loops.  This is akin to how an amp rings out of control and damages itself.  And since the neurofeedback is affecting your brain, which is intimately connected to both your emotions and your judgment, its compromising the only thing that can warn you if you're developing a serious problem.  Personally I wouldn't do neurofeedback unless I already had a really serious neurological problem and thought that the potential help outweighed the risk.  Otherwise its like doing surgery on yourself when you're not sick.  I know I must sound like a spoilsport naysayer, so knock yourself out if you want to.  But I think its not too different from how people used to experiment with powerful drugs without understanding the risks.

----------


## IAmCoder

No. Awareness always creates greater order (lowers entropy).





> I know I must sound like a spoilsport naysayer, so knock yourself out if you want to.



 Ok:





> And since _reading_ affects your brain, which is intimately connected to both your emotions and your judgment, its compromising the only thing that can warn you if you're developing a serious problem.  Personally I wouldn't* read a self improvement book* unless I already had a really serious neurological problem and thought that the potential help outweighed the risk.



 :Cheeky: 

Although I must admit that I have had my share of worries about the proximity of electricity to my brain in my *R&D* of custom devices.

----------


## kidjordan

So how's this project coming along. I want to try this, but before I invested the money, I would want a neurofeedback training manual and a list of EEG prices, etc. Is anybody pursuing this seriously?

----------


## kidjordan

Comparison of consumer brain

Ok. So I've been researching this for a while now and the Emotiv systems definitely seems like the way to go. THAT, OR the OpenEEG project (I haven't looked into it too much).

EDIT: After looking into OpenEEG it seems like it's less appealing than Emotiv. If you want to go through the entire process of building an EEG for the fun of it, then go ahead and do it, but I don't even know what a soldering iron is (though it sounds familiar) so I'm not even going to attempt to build my own.

----------


## IAmCoder

I finally got around to writing Lucid Scribe plug-ins for the Emotiv EPOC and the NeuroSky MindSet. It would be sweet as if you could test them. If we get them working I have a bunch of experiments that might prove interesting...

----------


## kidjordan

> I finally got around to writing Lucid Scribe plug-ins for the Emotiv EPOC and the NeuroSky MindSet. It would be sweet as if you could test them. If we get them working I have a bunch of experiments that might prove interesting...




The EPOC is kinda worthless eh? I want something that actually works. I can't tell whether my brain is changing or whether it's misreading my brain.

----------


## IAmCoder

Can you get it running in Lucid Scribe? And post a minute of data from the EPOC?

----------


## IAmCoder

NeuroSky just sent me a free device to test the plugin and they want to make my app available from their store: NeuroSky Store - Lucid Scribe!  :Bliss:

----------

