Maker Pro
Maker Pro

EEG circuit - need help please!

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
I'm currently designing a project that involves the use of this Instructable's EEG circuit.
FR5NQTRH3QFL7UP.jpg

At the end of the Instructable (Step 12), the author talks about using an Arduino Uno to observe 6 inputs instead of the original circuit's 3 inputs. My plan is to have the Arduino observe 6 inputs, and to also feed that information into my laptop, which I'm designing an EEG reading program for.
I'm very new to electronics, so please excuse my lack of knowledge, but I have a few questions about project feasibility:

1. Would hooking up the Arduino to the circuit involve changing the circuit in any way? The Instructable says you wouldn't need any extra circuitry, so I wasn't sure.
2. Will I still need the two 9V batteries to power the circuit if I'm plugging the Arduino into my laptop?
3. Also mentioned in Step 12 is a multiplexer chip. If I used the multiplexer chip for my inputs instead of the Arduino, would the circuit have to change? And what would be the best way to input that data into my laptop?

Thanks in advance, I know it's a lot. I really appreciate any help I can get, though!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,738
Joined
Nov 17, 2011
Messages
13,738
A word of caution: An EEG is a medical device and there are risks involved when applying it to a person.
Be aware of the risks and take all necessary precautions.
We reserve the right to remove this thread if we think it's going in the wrong direction.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
I'm currently designing a project that involves the use of this Instructable's EEG circuit.
FR5NQTRH3QFL7UP.jpg

At the end of the Instructable (Step 12), the author talks about using an Arduino Uno to observe 6 inputs instead of the original circuit's 3 inputs. My plan is to have the Arduino observe 6 inputs, and to also feed that information into my laptop, which I'm designing an EEG reading program for.
I'm very new to electronics, so please excuse my lack of knowledge, but I have a few questions about project feasibility:

1. Would hooking up the Arduino to the circuit involve changing the circuit in any way? The Instructable says you wouldn't need any extra circuitry, so I wasn't sure.
2. Will I still need the two 9V batteries to power the circuit if I'm plugging the Arduino into my laptop?
3. Also mentioned in Step 12 is a multiplexer chip. If I used the multiplexer chip for my inputs instead of the Arduino, would the circuit have to change? And what would be the best way to input that data into my laptop?

Thanks in advance, I know it's a lot. I really appreciate any help I can get, though!
As harald mentioned, there must be considerable care in such a device to make it 'properly'. Some answers are 'yes', but should be 'no', or 'not in this case'.

1. Perhaps. The output is going to be linear. This is your preference if you want to use built-in ADC on an Arduino, or use dedicated external ADC. Benefits of using external components would be higher resolutions or polling speeds, in addition to being able to scale and use more inputs than the Arduino originally comes with.

2. Personal preference here... I would suggest YES, so that you don't risk connecting your device to a faulty 5V AC-DC converter. This is connected to your body afterall... and every precaution should be met to make sure you don't accidentally create a circuit with your body for dangerous current to pass through... using an AC powered supply can be dangerous... as manufacturers don't always follow best practices.

3. There is not single answer here... you can capture multiple analogue inputs at a time, or you can use a multiplexor to very rapidly sample between the various inputs as you send them to the PC.
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Also... please note that 'isolation' is your friend!
Isolation will help prevent noise and current from passing from the laptop to your circuit and to your body.
 

AnalogKid

Jun 10, 2015
2,894
Joined
Jun 10, 2015
Messages
2,894
I've seen this circuit before, and it is a very poor piece of design. It uses 5 chips where 2 will do, is basically just some filter stages and a gain stage, and has no power decoupling. The hard part, a differential amp with the mandatory common mode rejection, isn't even shown. If you search for 'eeg amplifier schematic' you will get many circuits that are better.

ak
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Of all the good circuit sites available it amazes me how many people get sucked into the black hole called Instructables. It's not an electronics site and its 'how to's' are poorly screened, if at all!

Chris
 

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
Thanks all for the replies.

I think I'm going to go the route of using a multiplexer chip to cycle through my electrode inputs. Then use an Arduino to pass the information into my laptop.
Thanks all for the safety notices too. Caution and safety are my utmost concerns, and I'll be sure to be as careful as possible.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,886
Joined
Jun 21, 2012
Messages
4,886
@eboaylag I would never blindly copy anything on the Instructables web site without fully understanding exactly how and why it is supposed to work... because it probably won't. This site is a fool's-gold mine of misinformation because it is mostly unmoderated in its submissions. Please don't misunderstand: I really like the projects featured there. It's just some of them don't make sense in their implementation, which can be downright dangerous especially for the novice "maker". Best to come here, as you did, for a reality check before proceeding.

On home-made EEG monitoring: unless you are fully aware of the dangers created by ground loops and "stray" leakage currents, don't go there. Battery operation helps, but it is no guarantee that something bad won't happen if things go south.

On multiplexing the EEG inputs: this defeats the purpose of multiple EEG electrodes canceling common-mode noise influences. I would use an instrumentation amplifier on each lead and then process the now high-level outputs. I would go even further and use optically-coupled isolators to make sure there was no conductive path between my body and the real world, which would include your Arduino and its connected laptop.
 

AnalogKid

Jun 10, 2015
2,894
Joined
Jun 10, 2015
Messages
2,894
Opto couplers are not ideal for analog signal isolation. OK, they suck. The LED and phototransistor have different gammas; what could possibly go wrong??? Fortunately, both ADI and BB make isolation amps with DC recovery.

ak
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,886
Joined
Jun 21, 2012
Messages
4,886
@AnalogKid There are many different variations on optical couplers, not just the LED and phototransistor variety. You probably already know this, but maybe don't know the history of optical couplers.

One of the earliest versions I used had a neon lamp optically coupled to a light-dependent resistor (a CdS cell), cleverly packaged on a small circuit board and covered with black shrink-wrap tubing . We cut off the shrink wrap and replaced the neon lamp with a small incandescent lamp and then used the CdS cell in a battery-operated voltage divider to control the repeller electrode on a small reflex klystron, used as a local oscillator to heterodyne with a signal from a 70 GHz microwave horn-antenna. What a kludge that was.

You are correct @AnalogKid . There are better (and commercially available) ways to obtain analog signal isolation. My preferred method is to convert the analog signal to a digital signal and then use optical isolators to transfer the information to the real world. The Burr-Brown/Texas Instruments ISO122 does this with capacitive isolation in a single package. Optical or not, it would be my first choice for isolating an EEG/EKG instrumentation system.

The Analog Devices AD210 is also a candidate isolation solution, based on internal galvanic isolation using transformers. Except for the small-size form-factor, I fail to see how this is any better (or worse) than galvanic isolation using an external, high-quality, isolation transformer. Nice to have it all in one easily replaceable package though.

The real advantage of using custom optical isolators is higher voltage standoff with minimal or no leakage. You can use light-pipes to hold off millions of volts while controlling electronics operating at that elevated potential. You can control the separation between the light source and the light receiver to isolate almost any potential difference, all with almost no chance of leakage or flash-over. You want bulletproof? Hard to beat Lexan® polycarbonate for either windows or light-pipes.

@eboaylag: I went to the Instructables page you referenced and read it. All of it, including the comments. If you read the comments you can get a feel for what sort of person steps off the deep end of the pool to try to build this project. The instructable cited is actually a pretty good design and is well-documented. The problem is most of the people who tried to duplicate it have insufficient knowledge and ability to do so. It would have been better if the author had submitted it here in the Project Log Discussion area of the forum, but that's water over the dam.

I've seen this circuit before, and it is a very poor piece of design. It uses 5 chips where 2 will do, is basically just some filter stages and a gain stage, and has no power decoupling. The hard part, a differential amp with the mandatory common mode rejection, isn't even shown. If you search for 'eeg amplifier schematic' you will get many circuits that are better.

ak
If you go visit the actual website you will find that the "extra" op-amps are only there because the author couldn't find a single op-amp symbol in his drawing package. He actually used two quad op-amps for the active filters. And there is an AD620AN used as a front-end differential-input instrumentation amplifier for two of the three electrodes. He didn't do a very good job of explaining what that third electrode was for. I didn't run a sim on the filters, but apparently they work okay as notch and band-pass filters to reject power-line radiation from wiring in the walls and noise from moving the electrode wires around. Many of the comments on the Instructables site were related to software, but who knows how well that was written? As for the details of power supply by-passing and circuit layout... NADA! Not a good feature for the beginner trying to do a "monkey say, monkey do" project, which is typical of the Instructables reader. Even with all that, I would give the author of the Instructable a "B" for a good effort, and maybe an "A" for some nice pictures of the bread-board setup. Gotta wonder whether or not he went on to put it all together in a pretty package.

Thanks all for the replies.

I think I'm going to go the route of using a multiplexer chip to cycle through my electrode inputs. Then use an Arduino to pass the information into my laptop.
Thanks all for the safety notices too. Caution and safety are my utmost concerns, and I'll be sure to be as careful as possible.
You will need one of the instrumentation amplfier/active filter circuits for each pair of electrodes, and the multiplexing will involve using the high-level conditioned outputs NOT the electrode leads themselves. Those electrodes must never get anywhere near the multiplexor, Arduino, or laptop circuits.

EEG signals are particularly difficult to process because the electrical activity must make its way from the brain, through the skull, and onto the skin. It is always accompanied by all sorts of electrical noise that has nothing at all to do with brain activity. Triboelectric voltage introduced by movement of the electrode wires is always a problem, best "fixed" by taping the wires down after affixing the electrodes to your head. And there are myoelectric currents to eliminate too, caused by involuntary muscle movements.

All this makes an EKG recording seem like a walk in the park, although the same considerations apply. An EKG is produced from a central location (the heart) by a very strong emitter. You almost don't even need to attach electrodes to measure heart activity, but that is where I would start. Get the EKG working and then go for the EEG instrumentation.

Actually, I have a head-start (chest-start?) on all this, having a heart pacemaker/defibrillator implanted last year that has all sorts of recording stuff inside and a remote wireless readout system by my bed. My cardiologist still insists on hooking me up for a twelve-lead EKG just about every time I visit. I think they are all amazed that I am still alive, but then their equipment is galvanically isolated. Make sure your homemade version is too.

Remember, we are here to help. Make one of the signal conditioning boards first, power it up with a pair of 9V batteries, connect it to the souind-card input of a laptop running on internal batteries only, write some software, then let us know how the project is going. Ask some more questions if you run into problems.

Hop
 
Last edited:

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
@hevans1944 , thanks so much for the advice! I've read through the comments, too, and they're definitely helpful in terms of explaining how people did it and how they solved any problems they ran across. I'll be sure to ask more questions here when I come across them.
 

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
Hi all,

I've started building the circuit and it's been going well so far! I just have a couple of questions, and I thought someone here might be able to help.
PhotoLayout.png Schematic.jpg After comparing these two, I noticed a few discrepancies. The black wire all the way to the right that links the positive and negative strips of the two different power strips as seen in the photo layout seemed odd to me, and I couldn't find that connection built into the schematic. Am I missing something, or is that wire not supposed to be there? [EDIT: After doing some searching, I found this, which I think explains why that wire is there. Am I correct in thinking this?]

Also, the blue and green wire as seen in the photo layout is supposed to correspond to a connection from R4 to C6 as seen in the schematic, but in the photo layout the wire connects C6 between R2 and C5. I've followed what the schematic instructs in my breadboard build, but I just wanted to double check.

Thanks all!
 
Last edited:

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
Alright. I'm having issues. I've have many people check over my circuit but everything seems to be fine in terms of being connected correctly. My issue is that when I plug the circuit into my laptop via audio cable with this program (which was provided by the Instructable creator), nothing registers. I know the program works, because I've tested it with microphones before, so I'm assuming it's the circuit. I just don't understand where it's going wrong. I've read through all the comments on the Instructable and tried to find out what the issue is, but nothing's helped so far. Can anyone help?
 

Gryd3

Jun 25, 2014
4,098
Joined
Jun 25, 2014
Messages
4,098
Alright. I'm having issues. I've have many people check over my circuit but everything seems to be fine in terms of being connected correctly. My issue is that when I plug the circuit into my laptop via audio cable with this program (which was provided by the Instructable creator), nothing registers. I know the program works, because I've tested it with microphones before, so I'm assuming it's the circuit. I just don't understand where it's going wrong. I've read through all the comments on the Instructable and tried to find out what the issue is, but nothing's helped so far. Can anyone help?
Instructables is usually enough of a source to make me cringe.
Time to troubleshoot... but if you don't have the proper test equipment it's going to be very hard to tell what works and doesnt.
 

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
Instructables is usually enough of a source to make me cringe.
Time to troubleshoot... but if you don't have the proper test equipment it's going to be very hard to tell what works and doesnt.

How would you recommend testing it?
 

AnalogKid

Jun 10, 2015
2,894
Joined
Jun 10, 2015
Messages
2,894
Start at the front, with the 620. It has no inputs. What do you expect to see at its output, and what do you actually see there?

ak
 

Alec_t

Jul 7, 2015
3,591
Joined
Jul 7, 2015
Messages
3,591
What frequencies are you hoping to detect? A PC sound card typically has a frequency response which drops off sharply below ~25Hz.
 

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
What frequencies are you hoping to detect? A PC sound card typically has a frequency response which drops off sharply below ~25Hz.

Looking for alpha/beta brainwaves, which range from 7-30Hz. Should I test the circuit on a Mac? What's their frequency response?
Also, would reading through an Arduino via USB 2.0 bypass the frequency response issue?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Start with responding to @AnalogKid. What is the 620 connected to?
 

eboaylag

Jan 7, 2016
46
Joined
Jan 7, 2016
Messages
46
Start at the front, with the 620. It has no inputs. What do you expect to see at its output, and what do you actually see there?

ak

@(*steve*) sorry, I'm just lost and I didn't even know how to reply to @AnalogKid .
The 620 actually has two inputs, which are the two "reading" electrodes. I'm not sure what I'm supposed to get through its output, nor how I'm supposed to test it. I know it's supposed to amplify the electrode signal input with a gain of 89.2 due to the 560 ohm resistor where G = 1 + (49.4 kΩ/RG).
 
Top