Instructables
Picture of DIY EEG (and ECG) Circuit
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!

 
Remove these adsRemove these ads by Signing Up
1-40 of 99Next »
RahulG2yesterday

Will the electrodes work without electrode gel? If not can anybody please suggest something if one wants to use dry electrodes?

Thanks.

sams111 days ago

a bit curious as to why the output is being read from between the 22k and capacitor in stage 6 rather than the output at the op-amp? It seems as though that last notch filter is not required.

Also i am making a smd version of this pcb. If it is alright with you i would like to post them up for people who wants to give this a try.

stanna1 year ago
i have a question, why are you using -9 V on the ground pin

Dual supply configuration for Op-amp

cah6 (author)  stanna1 year ago
I'm not: GND is connected to your body, +-9V are the supply pins.
nilan29 days ago

why not use a bandpass filter ? rather than using two filters HPF and LPF

RohanHundia1 month ago

Can you please explain me what is the exact role of an instrumentation amplifier does it amplify voltage or frequency and by how much?

The instrumentation amplifier is a very accurate form of the operational amplifier. These amplifiers compare two signals (such as in and feedback, or double in with some feedback [prevents extra noise from getting introduced]) and amplifies the voltage. The signals picked up are very tiny voltages, so these up that to something that can be read easily.

twizilla1 month ago

Try google. This is the link to the item in their store

http://store.ambu.com/am_esa/esa/ItemDetails.jsp?@where.ItemID@EQ=72615-M%2F10

That link for the electrodes doesn't work anymore

RohanHundia1 month ago

Hi cah6, I (READ_EEG) and Processing show my "unexpected token: }" in 166 line and next (Cannot find anything named "in") 143 line, CAN YOU HELP ME RECTIFY THE ERRORS.

THANK YOU

RohanHundia1 month ago

Hi cah6, I am a student keenly interested in this project of designing an EEG System. I have designed the circuit but I am facing issues in reading the data and the software part of it. I want to design a system which allows the users to play a ping pong game can u explain how should i go with the software.

Thank you.

is it possible to use a oscilloscope instead of a computer to show/process data? And thx for the great project good job

Zalo3 months ago

I hope you don't mind cah6, but to get some practice with 123D's Circuit building tools I transcribed this schematic and posted it online here: http://123d.circuits.io/circuits/212387-cah6-s-eeg...

Hopefully I didn't make any mistakes, it would be nifty to have a working buyable EEG PCB for hobbyist builders online.

Very cool project; do you mind if I mention it/possibly use a photo at an upcoming talk I'm giving?

What would you estimate as the overall cost of the project?

Here's the talk: http://solidcon.com/solid2014/public/schedule/detail/33422

hikinful4 months ago

As other have said, this is a great instructable, thanks! It occurred to me that much of the work done by your analog input circuit could be done by signal processing algorithms; is there a theoretical reason why it's better to apply filters and so on in the analog domain rather than simply amplifying it and digitizing it straightaway? I am naive when it come to this subject so thanks for understanding if this is a silly question.

cah6 (author)  hikinful4 months ago

Not a silly question at all!

Essentially, you only have a certain number of values you can put analog values into when you convert them to be digital. By doing some of the processing and amplifying the result to the max value, you're basically maximizing the resolution of the values you read in.

Say you have 1:9 signal to noise ratio, of which you can completely remove the noise. If you were to immediately do the analog -> digital conversion, say with 1024 bins to sort the data into, your actual data/signal is reduced to 102 bins, where the rest is just noise. If you filtered the signal before reading it in, magically removed all noise, and amplified the signal to its max height, you could get much better digital resolution when you read it into your computer. This is a really rigged example and I wasn't very precise with it, but it should give you the general idea of why it's good to filter early (especially if the actual signal is pretty small).

rbayareh mancilla made it!4 months ago

Hi! I made this proyect. I only used a High pass filter from 8Hz to 50Hz (alpha to beta waves) just for watch the changes between the waves. I used Labview and MyDAQ to observe the changes, programming a 60Hz notch filter, a graph and FFT to observe better the frequency of alpha and beta. Here are the results:

filtro pasa banda 8-13Hz.pngfiltro pasa banda 14-30Hz.pngCapture.PNGCapture2.PNGCapture3.PNGCapture4.PNGCapture5.PNGCapture7.PNG
theadi15255 months ago

I downloaded the program (READ_EEG) and Processing show my "unexpected token: }" in 166 line and next (Cannot find anything named "in") 143 line, Is the program correct ?

TheAlex6 months ago

Hello Cah6,

So glad that you made the project open. I have a quick question, as you use a 31Hz LPF in stage 4, is a notch filter absolutely needed in stage 2 ? Theoretically stage 4 will eliminate the line noise as well, right ?

-Alex.

judd127a6 months ago

Hey there cah6. I'm undergoing building this for my major project at university. I am intending on using the data acquired to be turned into music. Thank you so much for uploading a detailed description, and please don't feel obliged to answer since you have already taken so much of your time out to upload this.

previously in the comments someone said "Unfortunately, computer mike inputs all seem to have their own high pass filters, ranging from around 5 Hz for Macs (when they have one) up to 20-40Hz for PCs. With a Mac, you don't need the 7 Hz HPF. With most PCs, alpha and low gamma are toast. A good USB audio input adapter will go down to 5 Hz and get around this problem."

If this is the case, how did you connect your EEG to the soundcard? Did you use a USB input adapter as suggested?

Also at stage 2 it talks about the notch filter, i am a little confused as the image that goes with it doesn't show the notch filter as far as i'm aware. I can only see 1 notch filter at the end of the circuit. Excuse me if i have asked some pretty obvious questions, I am new to this.

thanks,

Callum.

gkai27 months ago

Hai... first of all thanks for putting up such a detailed description.

I need to make an EEG collection system which is a part of my major project "brain controlled switches"

I have some doubts regarding your model. You explained about alpha and beta waves. I want to know whether I will get 3 different signals for 3 different thought processes (right hand movement, left hand movement, left leg movement, etc.) using your EEG circuit. Also will a particular signal be the same when the process is done after some time for the same person.

Also when I read the comments below many are having trouble with the notch filter. Can u please update the final circuit diagram with the better notch filter and its details.

Hoping you will reply soon.

Thank you

cah6 (author)  gkai27 months ago

You'd have to basically use 3 copies of the circuit (one for each signal) and feed them to the analog pins of an Arduino or something similar to read them at once.

For the notch filter, I'd try http://members.shaw.ca/roma/nine.html. I'm not exactly sure what's up with the one I initially put up, since it worked for me, but I suppose people are having issues with it.

Kreshu8 months ago
This is a great project! I have started developing it. But a sketch READ_EEG_cleaner is not available anymore, could you put it somewhere again?
Thanks for sharing knowledge :)
cah6 (author)  Kreshu7 months ago
I decided to upload it to github, so you can get it here:

https://github.com/cah6/EEG
cshi18 months ago
hello, i just built this circuit but i think that i have a big problem, i measured the voltage at the end i've got 7.8 Volts(i think it goes above one of the amplifiers) and it doesn't change with the potentiometer. i'm checking the circuit over and over again. i tried to short the electrodes end and from the instrumentation amplifier i get 0.00 volts.
from the first operational amplifier i get 1,4 volts. i think that this is the problem, because if i get 0 from the instrumentation how can i get 1.4(that has to be amplified 80 times after...)

i'm using a tl084C(without the N) and only ceramic capacitors(plus the three electrolitic) all the measurements are in respect to the batteries ground(i've not connected the electrodes)
dhirajp158 months ago
if we use different opams for filter will there be any change in resistor and capacitor values??? if i use lm741 or op07 ic will i hav to change the values of resistance or capacitance???
rlabina8 months ago
Do I have to apply some changes in the circuit and/or code if I will use this as an ECG?
cah6 (author)  rlabina8 months ago
No changes are absolutely necessary, but:

Since ECG data isn't as sensitive, you can probably get good data right after stage 1. The other stages are mostly just cleaning up the data, but that's not as necessary with ECG data.

Regardless, you'll need to reduce the gain through the circuit, as ECG data is inherently higher amplitude than EEG data, either in stage 1 or 5. Your best bet is to keep the stage 1 gain the same, read off data while changing it in 5, and just seeing what works for you.
rlabina cah68 months ago
Is the gain reduced by adjusting the potentiometer? Or do I need to add a resistor or replace the pot with a higher resistance? Also, I tried to run the code on Processing but it only shows the "default display" because "Display 0 does not exist" according to the console. Do you have any idea on this?

I'm fairly new to this and I need to complete this project as a part of my thesis. So I would appreciate the help. Thank you very much..
I am trying to run this circuit through matlab (simulink). Can u tell what program i have to make ( like of haw many bandwidth bandpass filter i have to apply, when and where to apply them etc.). also pl tell of how many bandwidth the different brain waves should be.
rlabina11 months ago
I want to make an ECG using your instructable. My 100nF and 220nF tantalum capacitors looked nothing like in your breadboard. They're really, really small (see image) and I have no idea how to place them. Can I replace the tantalum capacitors with electrolytic/ceramic? Would this have any effect?

I would really appreciate it if you can answer my questions. Thank you very much.

2013-08-14 21.23.59.jpg
zachs858 rlabina10 months ago
Those look like surface mount capacitors, they are much harder to work with, and wont work in a breadboard without special equipment (if at all). You need through hole components.
rlabina zachs8588 months ago
Yes, I just found what they were. Thanks anyway. I think if you can solder some wires to the terminals, you can then place them in a breadboard. But that's too much work. I didn't know back then that you if you want to buy nF capacitors, you have to convert it into uF first. >_<
achuth rahul9 months ago
can you help me out how the same(EEG)circuit can be used as ECG circuit
skrastanov9 months ago
While this instructable was a lot of help to me, this here is most definitely NOT a notch filter. It is a high pass filter, which can be easily proven when deriving the transfer function (I can send you a mathematica notebook with the derivation). For more intuitive reasoning, the mere presence of C5 is sufficient to tell you that nothing passes through at low frequency.

You can find a fairly simple and quite versatile notch filter here: http://members.shaw.ca/roma/nine.html
abraham449 months ago
Thank you, this is such a nice project and very elaborated. Im just having a trouble with tantalum capacitors, idk where to connect the positive and negative terminal because in the circuit they are shown as no polarity but mines have a and -. Should I use ceramic capacitors instead of tantalum or which way do I connect them?. Thank you in advance!
abidik10 months ago
(removed by author or community request)
cah6 (author)  abidik10 months ago
For the instrumentation amplifier, you're intended to connect the two input signals to pin 2 and 3, with the output coming off pin 6. Connect the ground electrode to pin 5, and the others are just power supply pins / the two with the resistor across them. Does this answer your question?
abidik cah610 months ago
No.....No.. As I understand , I couldn't explain my problem.. I did not understand how can I make connections between the parts in the 3rd photo making with TL084CN. Because the legs of the parts and capacitor values in the stage 2 can not be seen clearly on the breadboard ... So sory for my simple questions.. because I am not an engineer ... I am only a MD and hobbyiest.. I am sending the photo about circut and confused parts marked in the attached file.... thanks for your patience


1-40 of 99Next »