loading
EEGs are a noninvasive way to look into your brain. While the brain is extremely complex, areas of it can lock into circular firing patterns, resulting in telltale brain waves that one can observe with the right equipment. Intensity of these waves change depending on your internal state. The waves we will be most easily able to distinguish are alpha and beta waves -- alpha waves occur at around 8-12 Hz and when measured from the frontal lobe provide an estimate of how relaxed a person is, while beta waves are around 12-30 Hz and correspond to how much a person is concentrating or how alert they are.

The concentration of each wave can also tell more specific things about your thought patterns depending on where you measure them from. For example, alpha concentrations on the left motor cortex increase when you think about moving your right hand. Regardless of where you're taking measurements, looking at the concentrations of waves in real time - a process called biofeedback - can give you much greater control over them.

This tutorial is an in-depth guide on how to make your own simple EEG circuit. Along with monitoring brain wave concentration, the final circuit can also be used as an ECG, as a way to see your heartbeat trace. The circuit will use 3 electrodes - 2 to measure a voltage difference across your scalp, and one as a reference to ground. Depending on how many parts you already have, the circuit could only set you back around $10.

The aim for this project is to be easily available and understood by people of every technology background. For those electronically savvy, I will include up front a finalized schematic so you can jump right into making it yourself. For those that want more guidance, I will include a detailed description / explanation of every section of the circuit, showing you what it does and why you need it. 

Then, I'll move onto the software (Processing based), which is a very important piece in actually interpreting the raw data you receive.

So - let's start!

Step 1: Parts

I purchased most of my parts from Digikey (and Amazon). Their layout might seem slightly intimidating at first glance, but they seem like the cheapest place to get parts. And they have the USPS first class shipping option ( < $3 for small orders, choose this! It will save you a lot.), meaning you don't have to spend the same amount on parts as shipping, as it is on some websites. 

Chips:

- 1x Instrumentation Amplifier - AD620AN - This is the most expensive, and most important part. While technically you can make your own instrumentation amplifier from 3 op-amps, I could never get my own to give me good results. Precision cut resistors in this ensure that it'll do its job.
- 2x Quad Op-Amp - TL084CN - Any Op-Amp will do. You need 5 single amps, this one just includes 4 in each chip.

Capacitors: 

I would strongly suggest buying a capacitor bundle from ebay or the like, espcecially if you plan on ever doing some other sort of electronic project. One bundle and you're basically set for life. Regardless, whether you buy them in a pack or individually, make sure to include these capacitors :

- 1x 10 nF, ceramic
- 1x 20 nF, ceramic
- 1x 100nF, tantalum
- 5x 220nF, tantalum
- 1x 1uF, electrolytic
- 2x 10uF, electrolytic

Resistors:

Same as capacitors, I suggest a bundle. This is a very good one, has all the values you need (minus the potentiometer). The individual values you'll need, though, are:

- 1x 1kΩ Potentiometer - via Digikey - very useful to adjust your gain on the fly.
- 2x 12Ω
- 1x 220Ω
- 1x 560Ω
- 2x 22kΩ
- 1x 47kΩ
- 2x 100kΩ
- 2x 180kΩ
- 1x 220kΩ
- 2x 270kΩ
- 1x 1MΩ

Connectors:

- A breadboard to wire everything on. This one is large enough, and comes with useful jumper wires. I suggest saving the jumper wires specifically for connecting the various stages of the design. This will make it very modular, and easy to reorganize/reorder if you end up needing to.
- Wires for everything else. I like that pack, since it's pre-cut and keeps your board tidy. You can also get plain wire and cut it yourself.
- 3.5mm audio cable.
- 2x 9V batteries for power.

Electrode Supplies:

- Ambu Neuroline Cups seem to be the most cost-effective method, found here. Thanks to user jonencar for the link in the comments.
- electrode gel
<p>What values of capacitors and resistors do I use in the notch filters for 50Hz? Because it's 50Hz where I live.</p>
<p>Your power outlet freq. has nothing to do with the circuit, because you will be using 9V batteries to power the circuit, which is DC.</p>
<p>I know but the circuit will still experience this ambient noise, as mentioned in step 4.</p>
<p><a href="http://www.calculatoredge.com/electronics/sk%20high%20pass.htm" rel="nofollow">http://www.calculatoredge.com/electronics/sk%20hig...</a> This will defiently help</p>
<p>Totally! Thanks! :D</p>
<p>I want to use 6 electrodes, which would require me to create 3 same circuits. The question is, how do i connect electrodes to arduino? I simply ignore sound card, and wire it to analog input?</p>
<p>You should be able to go directly to an analog input. Just make sure the voltages are positive.</p>
<p>One more question. Tantalum capacitors, as far as i know, are Polarized. I can't seem to find + and - markings in schematic of the circuit. Only for electrolytic one.</p>
<p>You could just use ceramic capacitors instead of tantalum ones.</p>
<p>Then what is the point of semiconductor capacitors if they can be replaced? Just curious :D</p>
<p>I'm not sure why he chose tantalum capacitors over ceramic.</p>
The parts list have tan capacitors marked nf, but i cannot find any 220nf caps, only 220uf caps,, is the parts list correct?
<p>Initially I had similar issues as I could not locate tant caps with 100nF and 220nF ratings but ultimately I found a vendor (here in India).</p><p><a href="http://www.industrybuying.com/capacitors-multicomp-EL.CA0.1500908/?q=tant+capacitor&cat=" rel="nofollow">http://www.industrybuying.com/capacitors-multicomp...</a></p><p>and</p><p><a href="http://www.industrybuying.com/capacitors-multicomp-EL.CA0.1500909/?q=tant+capacitor&cat=" rel="nofollow">http://www.industrybuying.com/capacitors-multicomp...</a></p>
<p>can i use it in a car for a car safety? that is when a driver feels sleepy the alarm makes the driver alert....can i make it....please reply fast.....if it is possible can you sent me the circuit diagram?</p>
<p>Hi I am actually trying to do the exact same thing right now for an EDD (Engineering Design and Development) class and I am having trouble with the coding part of it right now if you know anything about that maybe we could try to figure this out together! </p>
<p>Hi I am trying to put the code from Read_EGG into the processing system that it tells you to download and when I hit run it comes up with a lot of different errors dealing with &quot;FFT&quot;, &quot;minim&quot;, &quot;in&quot; etc... I don't know what to do I don't really know coding all to well can anyone help me please! I need a response fast! </p>
<p>please help me, sir</p>
<p>can i make it with only the 1mohm potentiometer, and no other potentiometers, or do I have to buy all of them</p>
<p>can I make it with only the 1kohm potentiometer, but no other potentiometers</p>
<p>How would I export the data to an app? </p><p>And also could you give me some links for quality dry electrodes for if I use the helmet? </p>
<p>hay first thanks a lot for the shared info ... for a project of mine i have a question before i start making the object : im trying to use the signal from the ecg or eeg as sound that can be audible using speakers analogically without using computer .. did you ever try that or do you think its possible?</p>
<p>You could amplify the signals and put it through a speaker. Sure. What do you expect to hear?</p>
<p>hello sir -- please if we put a voltmeter directly after the first the ad 620 an .. how much the voltage would be ?</p>
<p>Very small. On the order of milliVolts. You will not get any meaningful information by using a voltmeter.</p>
<p>I wonder, would it be possible to replace the AD620AN with an ADS1015 see <a href="https://www.adafruit.com/product/1083" rel="nofollow">https://www.adafruit.com/product/1083 </a> which I read contains a 16x amplifier - the reason I am interested in this is that the ADC on this chip can sample at 3.3ksps and output via I2C, I think this would be useful for outputting to a esp8266 so that the output from the sensor can be streamed over wifi.<br><br>I'm wondering about adding this functionality as cheaply as possible, hence wanting to swap the the amplifier - but it's only 16x and running at 3.3ksps for 12bits... what do you think, would it be useful on both counts of gain and sample rate &amp; resolution? I understand that this is a lot lower than we would find in a sound-card.</p>
<p>Not quite. The ADS1015 is an analog-to-digital converter. You need an instrumentation amplifier like the AD620AN. They are two different circuit components.</p>
<p>Hello sir - and everybody else!<br><br>First of all, thank you very much for the instructions. Since English is not my mothertongue and I never did a (electronical) project like this before I don't quite get this information:</p><p>&quot;2x Quad Op-Amp - <a href="http://www.digikey.com/product-detail/en/TL084CN/296-1784-5-ND/277429" rel="nofollow">TL084CN</a> - Any Op-Amp will do. You need 5 single amps, this one just includes 4 in each chip.&quot;</p><p>Quad Op-Amps always include only 4 single amps, right? So... will 4 be enough? And if not, what should I search for to find one with 5 single amps? Am I missing something?<br><br>It would be very helpful if someone could clarify this for me.<br><br>Thank you very much :)</p>
<p>You will need 2 TL084 amplifiers or 3 TL082 amplifiers.</p>
<p>This is a very good Instructable. Well done.</p>
Your missing the 25nF in the list of capacitors bud. You have it only in the schematic.
<p>I was wondering could you measure certain thoughts with this EEG module device, because I am planning to use this as a component for a project at school. Thank You !!!</p>
hello sir -- <br>could you please identify the GND line ? that has to be put in the ear ? <br>thank you sir --
<p>Cool!</p>
<p>An alternate source of hobbyist components I highly recommend is Mouser Electronics (<a href="http://www.mouser.com/" rel="nofollow">http://www.mouser.com/</a>). </p><p>They were founded by a educator who tired of minimums and inflated shipping charges and still do not have a minimum and shipping is billed at their cost. </p>
Great project! However.. there's a very small, but real hazard in connecting to your computer. Clinical EEG/ECG/EMG etc equipment always passes signals through some sort of isolator before connecting to A/C powered equipment. Use a laptop running off the battery and you're safe.
<p> Seconded. Also, the use of 9V batteries should be emphasized. You do <strong>NOT</strong> want to use any sort of wall power. </p><p> An optoisolator such as listed below would be a good output option. With this, a true isolating transformer supply might safely be used for main power, with a battery only on the output.</p><p>https://www.sparkfun.com/products/retired/784</p>
<p>GREAT!!..</p>
<p>Hey guys, so I, unlike most of the people who completed this seem to have done, did this project on a breadboard. After everything is said and done, it seems to work. When I run the code, i can make the graph spike and jump mainly by shaking my head or occasionally when blinking eyes. It seems that the gain on my model is not high enough, as beta waves (i.e. when shaking head, moving eyebrows, etc.) show up strongly and alpha waves are hit or miss at best. I'll go back and check my circuit to make sure it was all done correctly and such which may address the problem. That being said, assuming I made no egregious errors, the graphs you will see will not look like the image provided in all probability (at least not on your first few go-arounds). The waves were not nearly that defined for me and they looked to be generally like a series of arches that specific data points, and, for me, the bars on the bottom did not really move. Whether it was an issue with the code or my setup, I'm not sure. That said, I did some extensive testing on this system and it does indeed do what it is advertised to do and I made sure that it was indeed brainwaves that were being measured and not random interference, albeit not at the same advertised resolution, at least for now. </p><p>Something very useful I found out: if you have access to a 3d printer at your university/school or anywhere else, I suggest using it. I used 3d models from a company called OpenBCI, which is an open-source BCI company that allowed me to use their models for free to create this headset. It improved comfortability and increased accuracy of electrode placement a hundred times over, and I would advise attempting it if you have such a thing at your disposal. Overall a great journey. I'm planning on improving this one and hopefully moving on to a better version later on by applying some upgrades of my own that I've been formulating. Good luck to anybody attempting this, the instructable was missing a few things (i.e. working code and had some ambiguous statements at times), but it was solid overall, especially for one of such length. If anybody is curious, this guy, Marquis de Geek made some great improvements to the code if you're not one of those people who can code well, and his version seems to work well. here's the link: <a href="https://github.com/MarquisdeGeek/EEG" rel="nofollow">https://github.com/MarquisdeGeek/EEG</a></p>
Hello sir. .. i really appreciate your kindness and for distributing knowledge among people . ..<br>Please. . I just want to do another experiment. . So I just want to detect the signal. .. so can the signal after amplification be detected by the regular oscilloscope? <br>Thank you very much sir
<p>It depends on several factors, but, in short, not really. Of course it is entirely feasible for you to switch out that 560 ohm resistor for another to increase the gain (all the way up to 10,000 if you felt like it, following the specifications of the instrumentation amplifier and the formula provided to determine the gain) and it would be then entirely possible to read it on an oscilloscope, provided your scope had the proper specifications (bandwith, min/max input voltage, etc.). The problem I foresee here though is that these filters that are included are entirely necessary for a few reasons. Even if you have built-in low and high pass filters on you oscilloscope to satisfy the Nyquist Criterion in order to even read the frequency spectrum, you still willl invariably need that 60 Hz noise filter. Let me provide an example to show you what I mean. If you read a signal of say, 12 microvolts, then amplify it 10,000 times, but you don't remove any of the noise, you've amplified the ambient voltage from your lights and your computer, and whatever nearby electronics there are, also by 10,000 times. So, if you went to read the signal then, you would only see random fluctuations of ambient noise and you would have much less signal than you do noise, so chances are you wouldn't see any noticeable movement based on what you were thinking or doing with your body from the eeg signal, because your noise was amplified so much it was covering up any signal you may be trying to measure. But, if we do it as above, providing a small pre-amplification, then filtering out noise (like 60Hz electrical hum), then amplified the signal the rest of the way to whatever your desired amplification is, you will only have amplied your signal (at least in an ideal circuit) and you could easily measure that on your scope.</p>
<p>It depends on several factors, but, in short, not really. Of course it is entirely feasible for you to switch out that 560 ohm resistor for another to increase the gain (all the way up to 10,000 if you felt like it, following the specifications of the instrumentation amplifier and the formula provided to determine the gain) and it would be then entirely possible to read it on an oscilloscope, provided your scope had the proper specifications (bandwith, min/max input voltage, etc.). The problem I foresee here though is that these filters that are included are entirely necessary for a few reasons. Even if you have built-in low and high pass filters on you oscilloscope to satisfy the Nyquist Criterion in order to even read the frequency spectrum, you still willl invariably need that 60 Hz noise filter. Let me provide an example to show you what I mean. If you read a signal of say, 12 microvolts, then amplify it 10,000 times, but you don't remove any of the noise, you've amplified the ambient voltage from your lights and your computer, and whatever nearby electronics there are, also by 10,000 times. So, if you went to read the signal then, you would only see random fluctuations of ambient noise and you would have much less signal than you do noise, so chances are you wouldn't see any noticeable movement based on what you were thinking or doing with your body from the eeg signal, because your noise was amplified so much it was covering up any signal you may be trying to measure. But, if we do it as above, providing a small pre-amplification, then filtering out noise (like 60Hz electrical hum), then amplified the signal the rest of the way to whatever your desired amplification is, you will only have amplied your signal (at least in an ideal circuit) and you could easily measure that on your scope.</p>
<p>hello sir :)</p><p>please i have a question --</p><p>why a lot of these kind of circuits they use a/d converter and then present it on pc ?</p><p>can they use an oscillator like ( usb oscillator ) like this ---</p><p></p><p>im waiting for your answer :) thank u for ur kindness ..</p>
<p>Hopefully, I'm understanding your question correctly. As far as why many of these types of circuits use an ADC, the reasoning behind this has to do with optimization for more complex circuits. While, in a simple EEG setup like this one, an analog cable such as the 3.5mm one used here is fine for relaying the data to the computer, but in larger systems it's not as efficient. In systems with, say, 16 channels, you would use an analog multiplexer to to read and pass all of these various signals to your high-speed ADC which would then allow you to pass it all at once through a bus (like a USB) to your computer which can then read it all without the need for the added complexity of keeping your analog signals isolated. Though there's not much reason to build this section yourself, both for the added complexity and cost as well as decreased reliability, and you could easily accomplish this by passing your signal into a pre-built micro-controller like an Arduino or something and hooking that straight up with a USB to your computer. I hope that answers your question.</p>
<p>If we do the helmet, do we need to use the gel anymore?</p>
<p>no you don't need the gel anymore if you go the helmet route, the electrodes are dry electrodes. They run slightly more expensive, but are definitely worth it.</p>
<p>Dude! The helmet is way wicked cool! A true brain bucket! I'm probably going to use the ole &quot;silver spoon&quot; technique for style -- but that sci-fi lookin headgear is making you the envy!</p>
<p>Can we know more thing thing then just the relaxation state of a person with this.</p>
<p>I would like to be someone's subject and have my brain readouts send to me via email explaining what they mean. I know that I don't have the know how to even understand how to build one of these devices myself or the time to do so I would like to have someone do it for me and be their test subject so I can learn more about how my brain functions. Anyone interested please let me know.</p>
<p>Hi,</p><p>It took me some time to build this complex amplifier so nicely described in this initial post.</p><p>My electronic is powerd with 2x9 V bateries. </p><p>One non-significant change : the readout is using ADC to digitize the wave forms, sampled at 200 Hz (MAX144), FFT is done on the computer.</p><p>On the qualitative level my setup looks like it is working - at least I see on the scope a stream of pulses in the range between few to ~30 Hz </p><p> with the amplitude of ~50 mV. When I blink (or touch the electrods) the pulses goes over the scale (exceed few V).</p><p>So far so good - my problem is I can't find the alpha waves ( 5-10 Hz) lasting for at least a second.</p><p>I have tried many electrodes locations, ask the human subject to close the eyes, concentrate, then open the eyes - there is no discernable change in the wave form patterns.</p><p>Attached is PDF with more details:</p><p>- location of electrodes,</p><p>- FFT amplitudes for a 40 seconds long measurement (2D plot)</p><p>- examples of raw wave forms with closed &amp; opened eyes (two 1D plots)</p><p>Perhaps someon sees what I do not see? A mistake in electrod location, a pattern ?</p><p>I'd like to turn on a LED with my thoughts - but I do not see how to controll with my though the brain waves which I measure.</p><p>Any advice is welcome</p><p>Thanks</p><p>Jan</p>
<p>hey jan,did you figure out how to control led using brain waves?if so please share.Thanks</p>

About This Instructable

676,477views

1,017favorites

License:

More by cah6:DIY EEG (and ECG) Circuit 
Add instructable to: