Op amp and EEG Circuit Help

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
I'm trying to make an Arduino EEG but the LPF (LM4250, second from top) and the second HPF (LM358, first from top) do not seem to work as the outputs after each of them individually appear to be DC voltages. Does anyone know what is wrong? The EEG is single supply so I used voltage dividers in the circuit. The second Bode Plot is from the whole schematic and the first is from the two op amp filters only.IMG_3143.JPG Screen Shot 2017-02-09 at 9.13.30 PM.png Screen Shot 2017-02-09 at 9.11.47 PM.png
 

MrChips

Joined Oct 2, 2009
30,810
Welcome to AAC.

Building an EEG amplifier is not for the faint of heart nor the uninitiated.

For a start, please post a circuit schematic.
 
The March 2017 issue; Vol 38,#2 of Nuts and Volts has an article entitled "Build your own ECG-EKG Unit, Ron Hoffman. Cost to build was around $50.00 USD. It's built around a quad MCP6024-IP amplifier by Microchip.

The article says that there are DC voltages created at the electrodes which can swamp the measurement and there are noise sources like RF and primarily the mains frequency.
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
My apology - this is the full schematicScreen Shot 2017-02-10 at 8.59.56 AM.png except for an instrumentation amplifier AD620AN at the front which has a gain of 89.2.
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
Are you supplying a single source or a double source power supply to the TL08xx op-amps?
I used LM4250 and LM358 amps but they are not in the simulation software. I used 5V single source but the circuit somehow doesn't seem to work in real life though!
 

AnalogKid

Joined Aug 1, 2013
11,044
All numbers refer to the TL081 datasheet. Looking at just the last stage (OA6):

The DC gain is 371, so any input over 13 millivolts will saturate the output at 5 V. Since the worst case input offset voltage is 15 mV, that could be the whole problem, but it isn't. The maximum output voltage swing is Vcc-3 V typical, meaning the output cannot swing higher than +2 V. This reduces the maximum input voltage before saturation to 5.4 mV, an even smaller percentage of the worst-case input offset voltage error. And the offset voltage will be at its worst because the ratio of the two input resistances is 1 million divided by 270, or 3700:1.

But the real problem is the input stage. The input common mode voltage range does *not* include the negative rail (like the LM358). So for your single-supply circuit, the input signal has to be at least 3 V (typ) before the input circuit sees anything. Then it tries to amplify 3 V by 371, which cannot happen with a 5 V rail.

But the real REAL problem is the single power supply. When the positive rail is +5 V, the minimum negative rail is -5 V. The device cannot function with less than 10 V across the power pins. Period.

Bottom line, OP6 is the wrong part for the job *and requires* bipolar power supplies.

Why is the R13 - C11 network impedance so high?

ak
 
Last edited:

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
The March 2017 issue; Vol 38,#2 of Nuts and Volts has an article entitled "Build your own ECG-EKG Unit, Ron Hoffman. Cost to build was around $50.00 USD. It's built around a quad MCP6024-IP amplifier by Microchip.

The article says that there are DC voltages created at the electrodes which can swamp the measurement and there are noise sources like RF and primarily the mains frequency.
All numbers refer to the TL081 datasheet. Looking at just the last stage (OA6):

The DC gain is 371, so any input over 13 millivolts will saturate the output at 5 V. Since the worst case input offset voltage is 15 mV, that could be the whole problem, but it isn't. The maximum output voltage swing is Vcc-3 V typical, meaning the output cannot swing higher than +2 V. This reduces the maximum input voltage before saturation to 5.4 mV, an even smaller percentage of the worst-case input offset voltage error. And the offset voltage will be at its worst because the ratio of the two input resistances is 1 million divided by 270, or 3700:1.

But the real problem is the input stage. The input common mode voltage range does *not* include the negative rail (like the LM358). So for your single-supply circuit, the input signal has to be at least 3 V (typ) before the input circuit sees anything. Then it tries to amplify 3 V by 371, which cannot happen with a 5 V rail.

But the real REAL problem is the single power supply. When the positive rail is +5 V, the minimum negative rail is +5 V. The device cannot function with less than 10 V across the power pins. Period.

Bottom line, OP6 is the wrong part for the job *and requires* bipolar power supplies.

Why is the R13 - C11 network impedance so high?

ak
I used LM4250 for OA5 and OA6 is LM358. They were not in the simulation software. Do the same problem still exists?
 

AnalogKid

Joined Aug 1, 2013
11,044
Yes. The 358 positive output range is only about 3.5 V when powered by 5 V. Also, AC coupling the waveform into the last stage means that the output will resemble only part of the input. The *average value* of the right side of capacitor C13 will be at GND. If you have a pulse-type waveform, much of it will be below ground and will be cut off by the OP6 input stage.

Do you really need a gain of almost 400 in the final stage. If the overall system needs that much gain, the last stage is the worst place to put it. That stage is amplifying the combined noise of all previous stages. It almost always is better to put the majority of the gain up front, so the later filter stages filter some of the gain stage's noise.

ak
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
Yes. The 358 positive output range is only about 3.5 V when powered by 5 V. Also, AC coupling the waveform into the last stage means that the output will resemble only part of the input. The *average value* of the right side of capacitor C13 will be at GND. If you have a pulse-type waveform, much of it will be below ground and will be cut off by the OP6 input stage.

Do you really need a gain of almost 400 in the final stage. If the overall system needs that much gain, the last stage is the worst place to put it. That stage is amplifying the combined noise of all previous stages. It almost always is better to put the majority of the gain up front, so the later filter stages filter some of the gain stage's noise.

ak
I did use voltage dividers (as seen in the actual circuit) so the output signal is centered at 2.5V and the negative signal would not be clipped. But this is interesting though. The output signal does seem to be staying at 3.5V. But why are there no fluctuations in the output? I'll adjust the gain a bit and see what happens.
 

AnalogKid

Joined Aug 1, 2013
11,044
There is no voltage divider establishing a Vcc/2 reference potential in the schematic in post #4. Without seeing how you implemented it and how it is connected to the circuits there is no way to evaluate its effectiveness. BUT, even if there were that DC offset would be eliminated by C13 before entering the output amplifier OA6.

What are the functions of OA1, OA2, and OA5? Please be specific: AC gain, DC gain, any applicable corner frequencies, etc.

Does V1 have any DC offset component?

If OA1 and OA2 are TL081s, they will not work for the 2nd and 3rd reasons in post #7. This probably is the reason there is no output. Nothing times three hundred seventy-one equals nothing.

ak
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
There is no voltage divider establishing a Vcc/2 reference potential in the schematic in post #4. Without seeing how you implemented it and how it is connected to the circuits there is no way to evaluate its effectiveness. BUT, even if there were that DC offset would be eliminated by C13 before entering the output amplifier OA6.

What are the functions of OA1, OA2, and OA5? Please be specific: AC gain, DC gain, any applicable corner frequencies, etc.

Does V1 have any DC offset component?

If OA1 and OA2 are TL081s, they will not work for the 2nd and 3rd reasons in post #7. This probably is the reason there is no output. Nothing times three hundred seventy-one equals nothing.

ak
They are not in the scheme but they are in the actual circuit shown in the first pic in post #1.
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
None of OA1, OA2 or OA5 amplifies the signal so they all have gain of 1. OA1 is a 60Hz notch filter. OA2(HPF) cutoff is around 7.5Hz and OA5(LPF) is 17Hz. Since I used an instrumentation amp DC offset should be coupled. OA1 is LM358 and OA2 is LM4250.
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
None of OA1, OA2 or OA5 amplifies the signal so they all have gain of 1. OA1 is a 60Hz notch filter. OA2(HPF) cutoff is around 7.5Hz and OA5(LPF) is 17Hz. Since I used an instrumentation amp DC offset should be coupled. OA1 is LM358 and OA2 is LM4250. I can see output after OA1 and OA2, just not after OA5...
 

AnalogKid

Joined Aug 1, 2013
11,044
Look at the LM4250 datasheet. While it is not characterized for a single 5 V supply specifically, you can look at the listed conditions and see that the input voltage range does not include the negative rail. Post #7, reason #2.

What are the expected positive and negative peak voltage values at the output of OA5?

ak
 

AnalogKid

Joined Aug 1, 2013
11,044
They are not in the scheme but they are in the actual circuit shown in the first pic in post #1.
That image has no reference designators, no indication of which chip is which, no indications of which wires are inputs and outputs, no indication of which power connections are where, and no value. Schematic, schematic, schematic.

OBTW there are no decoupling capacitors on your schematic. Are there any in the circuit?

ak
 

Thread Starter

Grace Gu

Joined Feb 9, 2017
9
Sorry for the incomplete information -- this is really my first time posting. Below is the more complete schematic with the voltage divider which shows everything except for the instrumentation amplifier and the Arduino.

I expect the amplitude of the raw signal to range from a few microvolts to 100-300 microvolts since brain alpha wave frequency varies greatly (http://www.psych.westminster.edu/psybio/BN/Labs/Brainwaves.htm) and I'm trying to obtain alpha and beta waves. Since V1 shows the amplitude after the instrumentation amplifier I expect the amplitude be ranging from close to 1 millivolt to tens of millivolts (centered at 2.5V).

I also discovered that it is possible to customize op amps so I entered most of the data for LM358 and LM4250 from their documents and labeled them. I used the online simulator Circuit Lab and the schematic can be found here https://www.circuitlab.com/circuit/458c6bee4tgc/eeg/. From what I see from simulation OA1 and 2 show normal behavior but OA3 and OA4 do behave differently from the original schematic which shouldn't happen. Why would this be the case?Screen Shot 2017-02-13 at 7.23.58 PM.png
 

AnalogKid

Joined Aug 1, 2013
11,044
Besides decoupling at each opamp, you need to seriously decouple the virtual ground voltage divider to the real ground. I suggest a 0.1 uF ceramic, 1 uF ceramic, and 100 uF aluminum electrolytic all in parallel with R23. This can affect how every stage behaves.

ak
 
Top