Maker Pro
Maker Pro

EEG circuit - need help please!

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
You need to describe what these electrodes are, where they're placed, and the signal you're expecting. (if you know)
 
You need to describe what these electrodes are, where they're placed, and the signal you're expecting. (if you know)

The electrodes are used to read signals from the brain off the scalp. In the circuit they're placed at pins 2 and 3 on the instrumentation amplifier AD620AN, and for input signal they're placed on the scalp. I unfortunately do not know what value of signal to expect or how to test it on which pins/outputs/etc.
 
The electrodes are used to read signals from the brain off the scalp. In the circuit they're placed at pins 2 and 3 on the instrumentation amplifier AD620AN, and for input signal they're placed on the scalp. I unfortunately do not know what value of signal to expect or how to test it on which pins/outputs/etc.
Please take a look here : http://users.ece.utexas.edu/~valvano/Datasheets/AD620.pdf
The AD620 is an amplifier, and it's not a 'dual input' amplifier.. it's a differential amplifier.
What this means is that it is meant to amplify the 'Difference' in signal between the two probes.
You need to know the proper placement of these probes. You also need an oscilloscope that you can use to probe the inputs and outputs of each stage of your design.
I'm sure you've noticed the number of op-amps in the design... they are not all used for amplification... the remainder of the circuit is active filters. They are meant to condition the signal by stripping away noise and other frequencies that you are not interested in.
If you don't have an output... this could mean that the two probes are getting the same signal, (hence no difference to amplify) or that any one of the additional op-amp stages have been incorrectly wired or designed.
To fix it, you need the proper tools to analyse it. To build it, you should have a good understanding of how each stage works.
 
I realize that may not have actually been helpful, so I have additional notes for you. Hopefully you can adjust your circuit to make it do what you want.

Please note the 'filters' in your design can be identified here : http://www.bowdenshobbycircuits.info/opamp.htm
Take a look at the '2nd Order Opamp Filters' and see if you can find matches in the schematic that was provided to you.
I highly recommend drawing a rectangle around ALL of the components that make a specific type of filter as notes for yourself.

The formulas there may be a little difficult to fire into a calculator, so here is another resource to calculate the cut-off frequency for you : http://sim.okawa-denshi.jp/en/OPstool.php
The very first 'Stage' after the AD620 is a 2nd order High-Pass Filter that is tuned to roughly 2100Hz ... This means that the 7 - 30Hz you had mentioned earlier is actively being dampened and will not make it to the output stage of the device.

The second stage is a band-pass filter designed to pass a very specific frequency (or small range). I'm sorry but did not do the math required to tell you the frequency... this can be your homework.

I'm not sure what the third stage is...
4th stage appears to be simply an amplifier/buffer to drive the output for the 'mic jack' and the diagram is cut-off, so the very last one is unknown on it's intended purpose.
 
Please take a look here : http://users.ece.utexas.edu/~valvano/Datasheets/AD620.pdf
The AD620 is an amplifier, and it's not a 'dual input' amplifier.. it's a differential amplifier.
What this means is that it is meant to amplify the 'Difference' in signal between the two probes.
You need to know the proper placement of these probes. You also need an oscilloscope that you can use to probe the inputs and outputs of each stage of your design.
I'm sure you've noticed the number of op-amps in the design... they are not all used for amplification... the remainder of the circuit is active filters. They are meant to condition the signal by stripping away noise and other frequencies that you are not interested in.
If you don't have an output... this could mean that the two probes are getting the same signal, (hence no difference to amplify) or that any one of the additional op-amp stages have been incorrectly wired or designed.
To fix it, you need the proper tools to analyse it. To build it, you should have a good understanding of how each stage works.

Thank you so much for your help and patience. I really appreciate it! I'll be going through and checking everything tomorrow.
One more question though: will I need a physical oscilloscope or would a virtual computer one suffice? I'm sure a physical one would be better especially if the sound card is cutting out the signals, so I'll scavenge for one if need be, but I just wanted to check.
 
Thank you so much for your help and patience. I really appreciate it! I'll be going through and checking everything tomorrow.
One more question though: will I need a physical oscilloscope or would a virtual computer one suffice? I'm sure a physical one would be better especially if the sound card is cutting out the signals, so I'll scavenge for one if need be, but I just wanted to check.
You are looking for a low frequency signal, I'm sure a USB one would be fine... what you want is sensitivity... the voltages present on the input of AD620 will be tiny. After the AD620, the levels will be easy to measure.
 
I decided to look at the instructable to find out what is expected...
The original designer claims the first and last stage are 60Hz 'Notch Filters' to get rid of 60Hz.
The second stage is a 'High Pass' filter and the 3rd stage is a 'Low Pass' filter... it does not look right to me... in addition to the 'filters' being incorrect, the last 'filter' isn't even wired correctly... the sound card gets connected @ the intersection of the 3rd stage output and 4th stage input.
Comments consist of people basically saying 'cool' or 'I can't get it to work' .
You have the basic idea of how this should work... I highly suggest you take apart the WHOLE darn thing. Delete the bookmark you have for instructables and build one yourself from scratch.

Use the instrumentation OPamp (AD620)
Then make your own filters. You know the frequencies you want, and I linked Low-Pass / High-Pass resources for you already.
 
I decided to look at the instructable to find out what is expected...
The original designer claims the first and last stage are 60Hz 'Notch Filters' to get rid of 60Hz.
The second stage is a 'High Pass' filter and the 3rd stage is a 'Low Pass' filter... it does not look right to me... in addition to the 'filters' being incorrect, the last 'filter' isn't even wired correctly... the sound card gets connected @ the intersection of the 3rd stage output and 4th stage input.
Comments consist of people basically saying 'cool' or 'I can't get it to work' .
You have the basic idea of how this should work... I highly suggest you take apart the WHOLE darn thing. Delete the bookmark you have for instructables and build one yourself from scratch.

Use the instrumentation OPamp (AD620)
Then make your own filters. You know the frequencies you want, and I linked Low-Pass / High-Pass resources for you already.

Do you think I'll be able to create a new circuit, but using the same parts? My issue is that I'm supposed to make this circuit three times over, so I have the parts available for three circuits from this schematic. These are the only parts I have available, and I'd prefer to avoid purchasing more parts if I can. If push comes to shove I will, however.
I did find this: https://decibel.ni.com/content/docs/DOC-26522 . The author uses the same Instructables circuit, but modifies it and gets it to work using a majority of the same parts. Do you think this is better, or should I move on with scrapping the Instructable completely?
 
Do you think I'll be able to create a new circuit, but using the same parts? My issue is that I'm supposed to make this circuit three times over, so I have the parts available for three circuits from this schematic. These are the only parts I have available, and I'd prefer to avoid purchasing more parts if I can. If push comes to shove I will, however.
I did find this: https://decibel.ni.com/content/docs/DOC-26522 . The author uses the same Instructables circuit, but modifies it and gets it to work using a majority of the same parts. Do you think this is better, or should I move on with scrapping the Instructable completely?
I think you should hang onto the parts and build your own EEG in stages. You should be able to use the parts you have, but may need replacement resistors or capacitors. I can't tell you which right now, but you can figure it out with a little time.

Use the following links :
- Op-amp filters : http://sim.okawa-denshi.jp/en/Fkeisan.htm
- More Op-amp filters : http://www.bowdenshobbycircuits.info/opamp.htm
- Active Notch filter : http://www.radio-electronics.com/info/circuits/opamp_notch_filter/opamp_notch_filter.php

Build Order...
Start with the 620, then ignore everything in-between and build an amplifier. You should be able to use your sound-card to view the noisy signal at this point.
Disconnect the line from the 620's output and amplifier input... build a Low-Pass or High-Pass filter (At 31Hz or 7Hz respectively) and stick it inbetween the 620 and amplifier. You should be able to see a noisy signal at this point as well, but frequencies above or below your cut-off should be much less noticeable.
Repeat the process with the other complementary filter... if you built a Low-Pass, it's time to build the High-Pass. This can be stuck in-between the 620 and your first filter, or after the first filter and the amplifier. Again, connect to the sound card and take a look at results.
The 'Notch filter' is only required to remove 50Hz or 60Hz hum that is picked up from power-lines inside and outside your home... think of it like the City's EEG xD The Notch filter placement would be right before the amplifier after your first two filters. (Your Low-Pass filter should attenuate this a considerable amount anyway... but the breadboard or circuit board may pick it up again... so try to keep the wire from the Notch-Filter's output to the amplifier as short as possible.
At this point, you have followed the template from Instructables, but have ensured that your filters are set to the proper values, and most importantly, you have tested it from start to finish, so if you get no output, you have a better idea of where it went wrong!

Although... as mentioned previously, the PC input may have a built-in high-pass filter, so it may be a good idea to test this before you attempt to use it with your home-made EEG. Additionally you should be careful to limit the output so you don't fry your sound card. Measure for DC voltage first before making the connection. Should be 0V!
Please build the circuit with 9-V batteries as recommended, and if possible, make a 'fake' brain you can connect the circuit to.
You could copy a recorded EEG signal or make one with Audacity and slap it on an MP3 player (confirm the output with your sound card to make sure it playes...) then take the output from the MP3 player and send the signal through a voltage divider... This will reduce the signal to a fraction of a mV which you can practice the circuit with.
You know have a known input, and an expected output. As long as the MP3 player and PC sound-card can play-back and record 7-30Hz you should have all the tools you need.
 
Build Order...
Start with the 620, then ignore everything in-between and build an amplifier. You should be able to use your sound-card to view the noisy signal at this point.
Disconnect the line from the 620's output and amplifier input... build a Low-Pass or High-Pass filter (At 31Hz or 7Hz respectively) and stick it inbetween the 620 and amplifier. You should be able to see a noisy signal at this point as well, but frequencies above or below your cut-off should be much less noticeable.
Repeat the process with the other complementary filter... if you built a Low-Pass, it's time to build the High-Pass. This can be stuck in-between the 620 and your first filter, or after the first filter and the amplifier. Again, connect to the sound card and take a look at results.
The 'Notch filter' is only required to remove 50Hz or 60Hz hum that is picked up from power-lines inside and outside your home... think of it like the City's EEG xD The Notch filter placement would be right before the amplifier after your first two filters. (Your Low-Pass filter should attenuate this a considerable amount anyway... but the breadboard or circuit board may pick it up again... so try to keep the wire from the Notch-Filter's output to the amplifier as short as possible.
At this point, you have followed the template from Instructables, but have ensured that your filters are set to the proper values, and most importantly, you have tested it from start to finish, so if you get no output, you have a better idea of where it went wrong!

Although... as mentioned previously, the PC input may have a built-in high-pass filter, so it may be a good idea to test this before you attempt to use it with your home-made EEG. Additionally you should be careful to limit the output so you don't fry your sound card. Measure for DC voltage first before making the connection. Should be 0V!
Please build the circuit with 9-V batteries as recommended, and if possible, make a 'fake' brain you can connect the circuit to.
You could copy a recorded EEG signal or make one with Audacity and slap it on an MP3 player (confirm the output with your sound card to make sure it playes...) then take the output from the MP3 player and send the signal through a voltage divider... This will reduce the signal to a fraction of a mV which you can practice the circuit with.
You know have a known input, and an expected output. As long as the MP3 player and PC sound-card can play-back and record 7-30Hz you should have all the tools you need.

So, the order should be: amplifier (ADN), notch filter, then my two filters (one low one high)? Is there any use for the potentiometer anymore (or is that up to my design)?

Also, for the "fake brain", would I use an audio cable and alligator clips to get the fake signal from an MP3 of 7Hz-30Hz to the circuit? And the voltage divider should output around the ~100uV range that was mentioned above?

And also just to be clear, is ground for this circuit based the reference electrode and a 0V ground set up like this, correct?
741-9v.gif
 
Last edited:
So, the order should be: amplifier (ADN), notch filter, then my two filters (one low one high)? Is there any use for the potentiometer anymore (or is that up to my design)?

Also, for the "fake brain", would I use an audio cable and alligator clips to get the fake signal from an MP3 of 7Hz-30Hz to the circuit? And the voltage divider should output around the ~100uV range that was mentioned above?
Build order will vary slightly... mainly because you will want to make sure the AD620 and the final amplifier works. The AD620 and Amplifier are the first to be built and wired together without ANY filter between them. Then you can put the filters in-between. You can build the filters in any order you want. (If you record the input with something like Audacity, you can analyse the stream and plot the spectrum to see if it made a difference)
The circuit should be:
AD620 > Band-Pass > Notch-Filter > Amplifer

The Band-Pass is simply a High-Pass and a Low-Pass built one after the other. the order of which does not really make a difference as far as I know. The Notch-Filter is optional, but is a good idea anyway, as the circuit itself of other wires may pick up ambient 50Hz or 60Hz noise from the local power-grid. The potentiometer is still a good thing to have. You can use it to adjust the gain on the Amplifier. (Is it a linear or log potentiometer? If it's a log, then it's good for audio volume adjustment... otherwise, use it to adjust gain.)

And why not. Alligator clips will be just fine. And yes. Build a voltage divider to get about 100uV 'difference' into the AD620.
If the MP3 player outputs 1V, you can use a 10KΩ and a 1Ω, or a 100KΩ and a 10Ω. You get the idea.

I've used Audacity to make some example plots as well.. hopefully it helps:
Filters.gif
This was made with Pink/Brown Noise... forgive the typo (It's not 'Grey Noise')
To do this. I launched Audacity, selected some 'audio' and hit 'analyse'. There is a 'Plot Spectrum' option you can use to get a result like this.
Your sample will look much different than mine hopefully... but you can still test with Pink/Brown Noise to see if the filters work.
You will notice of course that there still seems to be a lot of other frequencies present. This is normal... they will be 'attenuated' not 'eliminated' . Every 3dB is half the power... so although it looks like lots of other frequencies, their amplitude is very small in comparison to the 'Band-Pass' frequencies that were chosen with the Low-Pass and High-Pass filter.
 
The circuit should be:
AD620 > Band-Pass > Notch-Filter > Amplifier

Alright, so I've come up with this in terms of basic schematic layout/format. Working on the calculations, but I wanted to check and make sure this was correct before moving too far ahead.
Full_Size_Render_2.jpg


The op-amp filters are all from the websites you mentioned.
Alpha and beta wave amplitudes are around 20-60 microvolts and 10-20 microvolts, respectively. Should I be trying to use the AD260 to get them into millivolt or volt range?
 
Last edited:
Alright, so I've come up with this in terms of basic schematic layout/format. Working on the calculations, but I wanted to check and make sure this was correct before moving too far ahead.
Full_Size_Render_2.jpg


The op-amp filters are all from the websites you mentioned.
Alpha and beta wave amplitudes are around 20-60 microvolts and 10-20 microvolts, respectively. Should I be trying to use the AD260 to get them into millivolt or volt range?
You may need to play with this a little... the AD620 is going to amplify the 'difference' between the two pads ... that means if one of the pads or wires is picking up noise that the other isnt... you will also amplify that noise. You do want this signal to be as strong as you can get it though. I would certainly be aiming for high mV range at the very least personally.
This drawing looks better than the one on the instructables site IMO. I'd love to have @hevans1944 or @AnalogKid take a peak at what you are designing. My concern is the part #s of the opamps. Certain parts have certain limitations, and to be blunt. I simply don't know the 'ideal' voltage that you should try to bump the signal out of the AD620 in order to filter the results.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
You may need to play with this a little... the AD620 is going to amplify the 'difference' between the two pads ... that means if one of the pads or wires is picking up noise that the other isnt... you will also amplify that noise.

I'm going to go out on a limb and say that even though EEGs employ differential inputs the leads should still be high grade, exceptionally flexible shielded cables. The shields should be tied to circuit GND at the 620 end of the cables.

If anyone has any doubts about this let me know. I'm retired now but I used work in the Bio-Med Electronics dept (inside contractor) at a large hospital. I can make a call to coworkers (also retired) that used to service (ECGs) EKGs.

Chris
 
The #1 reason filters do not work as well as predicted is because the R and C components are not the theoretically-perfect values. This is WAY easier to achieve when the values are not impossible to buy. Since you need signal gain anyway, I recommend changing the first two filters to the equal-component-value variation of the Sallen-Key Butterworth filter. It is located in the lower half of this page:

http://www.electronics-tutorials.ws/filter/second-order-filters.html

Each stage will have a gain of 2, which helps a little with the overall system gain without being so high that you have to worry about the gain characteristics of the opamps. The only part of the circuit that bothers me is the notch. A good notch filter is has difficult component sensitivities and introduces many phase distortions, so they sometimes create more problems than they solve. What are the corner frequencies of the two filters before it?

ak
 
I'm going to go out on a limb and say that even though EEGs employ differential inputs the leads should still be high grade, exceptionally flexible shielded cables. The shields should be tied to circuit GND at the 620 end of the cables.

If it helps, I bought ALPTA brand passive gold plated copper EEG electrodes from Ebay. I bought touchproof adapters from PlasticsOne, and soldered the ends of the adapters to male jumper cables so they fit in my board at pins 2 and 3 of the AD260, and one into the ground power line of my circuit as a reference electrode.
I didn't ground the electrodes at pins 2 and 3 however.

What are the corner frequencies of the two filters before it?

ak

Thank you, I'll look into that link! The first filter is the high pass, with a cutoff frequency of 7Hz. Next is the low pass at 30Hz.

My concern is the part #s of the opamps. Certain parts have certain limitations, and to be blunt. I simply don't know the 'ideal' voltage that you should try to bump the signal out of the AD620 in order to filter the results.

I'm not sure what limitations you're considering, but if it helps, I have quad op-amps (TL084CN) and the datasheet can be found here!
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
If it helps, I bought ALPTA brand passive gold plated copper EEG electrodes from Ebay. I bought touchproof adapters from PlasticsOne, and soldered the ends of the adapters to male jumper cables so they fit in my board at pins 2 and 3 of the AD260, and one into the ground power line of my circuit as a reference electrode.
I didn't ground the electrodes at pins 2 and 3 however.

Well if there's no shield on those leads then there's nothing to ground. Obviously you can't ground pins 2 & 3. Bottom line, if the plugs on those leads indicate only single conductor IE not coaxial, then I was very wrong about them being shielded. I probably should have made a call before I posted that. It was an assumption and we all know what can happen with them. :)

Chris
 
Thanks for jumping in again guys.

It looks like component values will change a little, and although CDRIVE assumed shielded leads were in use for the electrodes, his assumption was made with good cause.
Unshielded wires to the electrodes are going to pick up a lot of noise. You can reduce this noise by twisting the pair of wires (so each wire picks up the same noise they can cancel out). This is a limited solution though because you can't actually twist the wires all the way from the electrodes to the AD620.

AnalogKid, thanks for the tips on the Fitlers and the Notch!
 
Thanks, all!

Alright, so I'm going to work on revising the circuit with the new filters and try calculating component values. I'll post again when I have a circuit ready, or if I have any issues.
Also, do you think using simple voltage followers between stages would be beneficial? I've done some preliminary research, and I've seen a few people suggest that they're good to put in between stages with op-amp filters. Let me know what you think.
 
Top