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. 


- 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.


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


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Ω


- 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>I've doing everything but why not show the signal eeg or ecg do not know where the defect .</p><p>can you help me</p><p>please</p>
<p>Hello CAH 6 and congratulations for the excellent guide!!</p><p>I'd like to do a research about sleep stages on myself. I wanted to know if I can keep this device turned on in my head all night. It could be dangerous? </p><p>Thank you</p>
<p>I found that the 220nF tatulum capacitor is actually polarized. Should I match the positive side of it to where it connects to the 22kOhm resistor? or should I be matching the positive side of the 220nF capacitor with the positive side of the polarized capacitor on the right side of it? Cheers m8</p>
<p>does ECG electrodes work to capture the signals??? i didnt found EEG electrodes ,,so instead i bought ECG electrodes,, but i im confused that its working or not,, the changes of value is too small,, other thing does your electrodes work over your hair?? </p>
<p>does the ECG electrode works with you or not </p>
<p>Hi,</p><p>Can you provide a citation for this statement? </p><p>&quot;For example, alpha concentrations on the left motor cortex increase when you think about moving your right hand.&quot;</p><p>Claude</p><p>http://www.z-eeg.com </p>
<p>the left side of your brain controls motor functions for right side of body the right side of brain controls motor (I.E. muscles in arms legs etc. ) functions of left side of body. so the electrode connected to the left side of your head will pick up more when thinking about moving your right hand because left side of brain operates right side of your body.</p>
<p>Hi <br>can the owner of this circuit show me this circuit completely on bread board please </p><p>because i don&quot;t know what type of capacitor are there in circuit mention above </p>
<p>can i use OPA2134 instead of AD620 ?</p>
<p>hello !</p><p>i wanna build an eeg but my infromation isn't Complete i need your help !</p><p>plz give me infromation about it .</p>
<p>Hello there! Im trying to put it together on breadboard, but am finding it difficult to read the schematic pics, have u used 2 IC chips TL084CN, or 5 single Op.AMPS? I can barely notice the components of the first scheme? anyone can help? </p>
<p>I do not know how can you can run the code for reading eeg signal without any error. When I run the READ_EEG in arduino, it's contain 2 errors. When i try to fix the first error, the second error appear. I do not know why. Please help me to fix it.</p>
<p>See my comment above and try <a href="https://github.com/MarquisdeGeek/EEG" rel="nofollow">https://github.com/MarquisdeGeek/EEG</a></p>
<p>Hi, could you please show me what is the code for the two-player-version?</p>
<p>There is a clear error right above the highlighted braces in the first image you posted. It is a function call, and the parentheses must be closed with or without (one or more separeted by comma) parameters inside and followed by a semi-colon indicating the end of the command: timeSignal(); or timeSignal(PARAMETERS);</p><p>the second image i cannot tell because missing parts of code i must see.</p><p>i've not downloaded the code or started the project yet due to lack of time. but it's my intention for soon.</p><p>Let me know if im not being clear, beacause i'm out of pratice in english language.</p>
<p>Can you talk more clearly? because the author only public code file to share anyone. So, what is missing parts? i can take it from where to running correctly. Thanks</p>
<p>Does anyone got the useful code? These are full of errors! Thanks!</p>
<p>See my comment above and try <a href="https://github.com/MarquisdeGeek/EEG" rel="nofollow">https://github.com/MarquisdeGeek/EEG</a></p>
<p>Hi, could you please show me what is the code for the two-player-version?</p>
<p>THE CODE WORKS! I've made the code compile, fixed bugs involving (lack of) precision, and expanded it to read data from either Arduino (via serial) or the audio in (e.g. microphone). See README for how to switch between modes.</p><p><a href="https://github.com/MarquisdeGeek/EEG" rel="nofollow">https://github.com/MarquisdeGeek/EEG</a></p><p>I haven't built the circuit yet, but at least this is further progressed than the source provided above!</p>
<p>Hi, could you please show me what is the code for the two-player-version? </p>
<p>Hi,</p><p>I would like to know some things:</p><p>I'm going to use this circuit as an EKG, do I need a 31Hz low pass filter or just the other filters? And also can I put an switch button to &quot;skip&quot; the filter I mentioned before in case I want to have multiple uses for this device?</p><p>thanks</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>Hi, what did you use to read this code? Please let me know, I am having trouble using processing to read the data...</p>
<p>It was half year ago I stopped playing with my EEG setup. What exactly are you asking for? What code are you trying to read? What kind of trouble? What is the error message you see? On what computer, OS?</p>
<p>Hello Jan,</p><p>Just wondering how you got the code to work. I have built the amplifier but the code seems to have errors for me, I have fixed the line in issue and such but in the section which shift the input and makes the final collected data 0 has a error which i do not know how to fix. I am new to coding and have spent many weeks trying to learn but I cannot seem to solve this issue. </p><p>Any advice from anyone would be great as I really want to make this project.</p><p>Thanks</p>
<p>Hi Atah,</p><p>well, I have not even tried to run the Matlab based code. Instead, I connected the output of the last stage of the EEG amplifier to an ADC (MAX144), who's I read in using Rasppebry Pi. I wrote a C/C++-code for Rpi reading ADC via SPI interface and used Kiss-FFT code for the real time FFT.</p><p>This is rather different path than suggested in this tutorial. Not sure what would be the best path for you w/o knowing what is your background.</p><p>Thanks</p>
<p>sorry do you mean the processing based code. I just cannot seem to get anything to work and I would really like to it to be honest. I am not new to circuits but coding is really new to me. I just want to see some response from the circuit that I have built to be honest. I was thinking you may have debugged the code given to read the EEG through the soundcard. I am new but I have really tried my best to figure it out but there is a section which seems like its missing a lot of stuff. </p><p>It would seem that you have a much higher background in coding than me as I have really only started this past year. So the best way to describe it is that i am quite a newby to this. </p><p>Thanks for the response and I appreciate your help</p><p>atah </p>
<p>Hi Atah,</p><p>looks like the last common element in your and my step is the output of EEG amplifiers. What I see looks like at the bottom of my PDF - the wave forms vs. time. Perhaps you could connect your output to an oscilloscope and verify you see similar shapes? Alternatively, you could connect EEG output to an amplifier (e.g. external speakers w/ some amplifier). 10 Hz is on the verge of the audible spectrum, but you should be able to hear 30 Hz. You do not want to hear the 60 Hz buzz - then you know your analog part is not working properly. In my case it took me ... many many evenings to iron out all the filters, in particular to tune both 60Hz notch filters, correct wiring errors. This circuit described above have not worked 'out of the box' for me. </p><p>So a short answer: check with the scope that you see pulses from your (or your subject) brain and not the 60 Hz buzz. Take a snap shot and post it :). Then, worry about computer input, sound card, and the code.</p><p>hope it helps</p><p>Jan </p>
<p>BEST ADVICE. TRY AND GET THE CODING WORKED OUT FIRST.</p><p>I ran in to lots of coding errors before the program would even attempt to open. Also I did not receive much help other than my professors at my school and a lot of hours looking though someone elses code (which is still not complete yet. this project is still on the site ??????????????????why?!). if coding is not you strength, then don't bother here but the circuit is absolutely beautiful. </p><p>if you can't write your own code in arduino or processing 2 than don't bother with this project. This provided code did not work for me and i did not get a single helpful reply from the creators of this gem. i will be reading my eeg through an oscilloscope rather than my laptop. there goes the convenience of a screen shot.</p>
<p>Is there any way that you could send me your code? I will give you my email if you respond. </p>
<p>Does anyone here live in the Bay Area that would be willing to look at my circuit? It isn't working and I'm not sure what I should do...</p>
<p>i cant find 12ohm resistors anywhere. did u mean 120ohm?</p>
<p>Ebay has some</p>
<p>oh i also want to ask: how important are the values of the capacitors and resistors? is it ok if they are a tad off? </p>
<p>The electrodes go into the ad620an instrumentation amplifier at pins 2 and 3. </p><p>The written code is garbage. It does not work. everyone i have seen on this site has either used another avenue to make this circuit's raw data interpretation code work or they have purchased their own expensive software or hooked the device straight into an oscilloscope or another form of raw data interpretation.</p><p>the circuit works fine and the filters can all be made out of 741 op-amps in combination with the various listed amplifiers, capacitors, and resistors. </p><p>bit of advice, write the code first. if that doesn't work for you and you have no other form of raw data interpretation to display the actual wave forms of these readings, ABANDON the project. i have a 200 dollar eeg sitting next to me and a code that does not work so i can't use it. My coding skills are not that of a professional programmer i have had one programming in c class and this is not close enough for me to debug nearly 400 lines of code with errors popping up constantly. </p><p>the creators of this this instructible also mentioned a few years ago that they would not be answering any more questions or assisting any build. i am paraphrasing but don't expect help from them i tried. </p><p>personally i believe that this should be removed from the web sight. it is misleading and if you screw up and build the circuit first then you are left with an incomplete interpretation code.</p>
<p>Do you have pictures of the final circuit you built?</p>
<p>Theres only 2 electrodes? I thought there were 3 for the ground as well?</p><p>Have you tried the code posted by <a href="http://www.instructables.com/member/SteevAtBlueDust/" rel="nofollow">SteevAtBlueDust</a>? Please let us know if it works after you try it out.</p><p>Thanks</p>
<p>Sorry, I can not see the bars that I can do?</p>
<p>Does anyone know if the amplifier and filters and hpf gain are included in the &quot;complete design&quot; schematic? Or are we supposed to add those on as next steps? Thank you. </p>
<p>Where is a good place to buy the capacitors cheap? I can't find the tantalum ones either...</p><p>Thanks!</p>
<p>And do you want them to be polarized or not? Does it matter??</p>
<p>Hi, have you considered electodes like https://www.olimex.com/Products/EEG/Electrodes/EEG-AE/open-source-hardware ? They are from OpenEEG project. Will they work with yours?</p>
<p>Anything with conductive metal and a wire should work. Im pretty sure that almost all eeg electrodes work with all eeg circuits</p>
<p>take into consideration that this circuit requires you purchase electrodes as inputs and some sort of electrode gel that will set you back more than $10. even if bough on line.</p><p>There are a lot of parts to buy if you don't have a bunch of ICs and caps laying around you will end up buying online and paying shipping costs too. some were hard to find particularly hard to find were the tantalum capacitors. </p><p>be prepared to get the run around on ambus electrodes too. they charged me four times for my order before even sending me the right 2 products even though i only needed one set of electrodes and only wanted one. i have yet to dispute the charges due to just not wanting to deal with them any more. seeing as how i might need the electrodes when and if i ever get the code running.this project cost me closer to 100 dollars than 10. </p>
<p>are tantalum capacitors necessary? I found a few capacitors of the same values that are electrolytic. will different material capacitors alter the results alot? I'm new to circuits.</p><p>Thanks</p>
<p>Going to put in another question:</p><p>can the data be processed through audacity? </p><p>thanks</p>
<p>Thanks for sharing! I'm making it out , But,i got a lot of trouble when i made it,such as in my country,the notch filter work wrong ...</p>
Can someone explain me why author decided to connect the output signal to the sound card between 22k rezistor and 220n capacitor ? Why he didnt put it at the end of the circuit ? I mean output from IC LM358 connected to the sound card like in the first notch filter

About This Instructable


645 favorites


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