Tuesday, November 5, 2013

Homemade Passive Electrodes

After the challenge of getting oneself some decent EEG electronics, the next hardest part is getting some decent EEG electrodes.  Sure, there are lots out there that can be bought, but some folks have no interest in paying $8-$20 per electrode (plus shipping) because they know that they need to buy 6-10 of these electrodes and, well, that becomes a lot of money.  So, I decided to try to build my own homemade EEG electrodes.  Here's my story...(and for you impatient folks...yes, there's a fairly happy ending)

Wearing my homemade passive EEG electrodes.
(Beware of cheap cameras and flourescent lights)

The Idea: Use Cheap Bits from the Hardware Drawer

When I look at passive EEG electrodes, I just see a piece of flat metal with a wire attached.  Sure, I see the use of fancy metals (gold, silver / silver-chloride), but is that really necessary?  For EEG research or EEG medicine, the quality and repeatability provided by the fancy metals is necessary.  For EEG Hacking?  I'm not so sure.  So, if an electrode is just a piece of flat metal with a wire attached, it seems like I should be able to build one myself.

I started by searching through my hardware drawer to find a suitable piece of metal that is small and flat.  I found some lock washers with a solder tab (see picture below-left).  It is a very basic and inexpensive component.  I'm pretty sure that mine are from Mouser and cost $0.24 each.  You can probably get them cheaper.



I then grabbed a piece of wire, stripped the end, and inserted it into the tab on the washer.  Looks like it'll do nicely (see picture above-right).  To soldered the wire to washer, I simply placed it in my plastic-gripped vice and applied heat and solder (pics below).  If you don't have a vice, a traditional "3rd hand" soldering fixture would have worked fine, too.  This is not fancy work that we're doing here.


Once the wire was soldered to the washer, I realized that I should have added a piece of shrink tube over the wire to cover the solder joint.  But, once it was soldered together, it was too late to add the shrink tube (the other end of my wire already had a connector on it).  Dang!  When I made a second electrode, I remembered to add the shrink tube on that one.  As you can see below, the black shrink tube makes the second electrode look much nicer than the first one.

My First and Second Homemade Passive Electrodes.  On the second one, I remembered to add a piece of shrink tube to cover the solder joint.  It looks much better.
With the working end of the electrode complete, I could consider the other end of the wire...the end where normally on would add a connector for plugging into the EEG electronics.  Since I stole my wire from an old ECG lead wire, I have the "touchproof" connectors on the end of my electrodes.  But, you don't need anything that fancy if you want to spend less money.

The least expensive approach for "connectors" would be to solder on a male or female pin header, which are only about $0.04 per connection.  This kind of connection is perfect for connecting to OpenBCI, which is built around traditional 0.1" spaced pin headers.  So, if you put the mating gender of pin header on your homemade electrodes, they could plug right into the OpenBCI board.  Great!  Alternatively, if you use OpenEEG, you will want to terminate your electrode's wire with a 3.5 mm stereo phono plug.   That is what the OpenEEG is built around.  These pieces about $0.50 each.

So, overall, I estimate that cost of each one of these electrodes is: $0.24 for the washer, about $0.36 for a meter of stranded wire (it's more flexible than solid wire), and $0.50 for a 3.5mm connector.  That's $1.10 in parts, which is a nice reduction compared to commercially available electrodes linked at the top of this post.

But do my homemade electrodes work?

Homemade Electrodes for ECG

As discussed in my previous post, I always like to start my testing by doing ECG measurements.  Because the heart signals are so strong, it is an easy way to confirm that your EEG system (and EEG electrodes) are working to some degree.  So, I got out my tube of Ten20 conductive paste and stuck my electrode to my wrist.  I attached one electrode to my left wrist and the other electrode to my right wrist.

Attaching my homemade electrodes to my wrists to measure my ECG.
The shiny stuff on my skin is Ten20 conductive paste

 How well did they stick?  Well, not nearly as well as the self-adhesive disposable ECG electrodes.  But, the surface area on those sticky ECG electrodes is HUGE, so of course my little electrodes won't stick as well.  Given how small my electrodes were, though, I think that they adhered adequately well.  I think that the big hole in the middle of the washer is not helpful.  If it were solid, I think that these electrodes would stick better.  I'll remember that when I go to make my next set of homemade electrodes.

Once I got the electrodes attached to my wrists, I connected plugged them into my OpenBCI board and had the Arduino pipe the data to my computer, as usual.  Example ECG data from these electrodes is shown below.  I'm showing 6 heart beats.  As you can see, the sharp R-waves and the broad T-waves are both very clear.  The amplitude of the ECG is similar to what I showed in my post yesterday when I used real ECG electrodes.  So, while my signal trace does look a bit noisier than yesterday, I'd say that this is a successful test!

My ECG As Recorded through OpenBCI Using my Homemade Electrodes

Homemade Electrodes for EEG

Since I was successful with the ECG, I made the next step and used my homemade electrodes to acquire some EEG signals.  I am still pretty fixated on my Mu waves, so I decided to use my electrodes to see if I could pick up my Mu waves.

Following a simplified version of my previous procedure, I put one electrode near the top of my head near Cz and one the left side of my head near C3.  As you can see in the photo, it is very tricky to accurately place electrodes on one's own head.  In retrospect, it looks like the one on the top of my head was a bit too far forward for Cz and the one on the side of my head was a bit too far back and a bit too low for C3.  Regardless, they should be good enough to record *something*, so let's see what I got.


Placing my homemade electrodes near
Cz (top of head) and near C3 (side of head).

Using my OpenBCI electronics, I started recording data from my brain.  I spent some time with my eyes closed to generate Alpha waves (Posterior Dominant Rhythm), I spent some time with my eyes open and my right arm and hand relaxed (to hopefully generate Mu waves), and I spent some time with my eyes open and my right hand clenching and un-clenching.  The results are plotted below as a spectrogram.  Unfortunately, it is not very clear where the boundaries were between these different activities, so it is not clear what we *should* be seeing.  We do clearly see the Alpha waves caused by my eyes being closed.  In the middle of the plot, we might also see some Mu waves, but they are very weak.  I would say that these results are fine for Alpha and bad for Mu.


To try to get better results, I moved the homemade electrode that was on the side of my head.  I moved it a little higher to be closer to where C3 is supposed to be.  Then, I repeated my recordings.  This time, I pressed a button on my computer to mark the boundary between each activities to make my post-test analysis easier.  It turns out that the simple act of pressing the button caused my EEG wires to jiggle, which shows up as artifacts within the data.  It makes it clear when I shifted my activity.  See the results below.


As before, the Alpha waves are quite clear.  This time, though, I do think that I see Mu waves during those periods when my eyes were open and my hand and arm were relaxed.  Then, when I moved my hand, I think that I see that the Mu waves go away.  That's exactly what should happen!  At the end, when I relax again, I think that it is interesting that it takes a while for my Mu waves to come back.  Clearly, I am not very good at relaxing.  That's not much of a surprise to me.  I can be quite excitable...especially when I'm EEG HACKING!

Homemade Electrodes Seem to be Good!

So, with this second test, I'm quite pleased with my homemade electrodes.  The signals that I recorded were pretty good.  There was a lot of 60 Hz noise (not shown in these graphs) but that could be due to me not using the traditional 3rd electrode connection (variously named the "bias" or "driven ground" or "driven right leg") for these recordings.  I also felt that these electrodes did not stick to my head as securely as the gold electrodes that I used previously.  I think that the stickiness can be improved by using a piece of metal with more surface area...maybe a regular flat washer instead of the skinny lock washer.  Still, for about a dollar per electrode, I think that the results are pretty darned good.  I'm pleased.

How about you...have you made your own electrodes before?  How did you do it?  Did they work?


Follow-Up: More graphs and discussion of the data is in this post
Follow-Up: Want to see my data from this experiment?  Check out my github!

25 comments:

  1. Good job Chip! Could you please add an image showing the EEG trace? Thanks.

    ReplyDelete
    Replies
    1. Ask, and you shall receive. Follow-up post here: http://eeghacker.blogspot.com/2013/11/waveforms-from-homemade-electrodes.html

      Delete
    2. This comment has been removed by the author.

      Delete
  2. Thinking towards adding an JFET Op-amp (TL072) and turning these into active electrodes. I've started looking around. Found this:

    http://www.bioera.net/bw/ae/active_prototype2.html

    ReplyDelete
    Replies
    1. Turns out that this is part of a thread of active electrode trials summarized on the OpenEEG page...

      http://openeeg.sourceforge.net/doc/hw/ae.html

      Delete
  3. Thanks for this. This is great ! So simple really. Had not had time to think this through.

    ReplyDelete
    Replies
    1. I'm looking for something better than that lock washer. The ring of the lock washer is too narrow...not enough surface area to stick to the skin. Do you know of any other bits of hardware that would work better? A regular washer has more surface area, but I solder wouldn't stick to it. Any thoughts?

      Delete
  4. Chip, perhaps a brass washer from your local hardware store. To enhance the connection, get out your Dremel tool and drill a couple of tiny holes to feed the wire through. That would get you both mechanical strength and a bunch of surface area.

    You might also think about using a twisted pair for the lead. My guess is that grounding the non-signal wire at the electronics end might reduce the ambient noise and give you a better signal.

    ReplyDelete
    Replies
    1. Hi Rod. Thanks for the suggestion and the encouragement. My motivation to make homemade passive electrodes has diminished a bit every since I found that the electrodes below are $8 for a set of 10. That's really cheap. And, while they say that they are "disposable", they're perfectly usable for many sessions...I just think that you might not be able to sterilize them, so they're called "disposable" because that's how hospitals would use them. For you and me, they're pretty sweet.

      http://www.neuro-source.com/product.php?id_product=544

      Delete
  5. Hai, im kinda interesred in EEG, can you give me some advice on it because im totally new with it. Im interested in what software that you used in measuring the brain waves and what are the tools that used to measure them except the electrode. thank you

    ReplyDelete
    Replies
    1. To record EEG, you need some electronics to amplify and digitize the signals on your body. I used OpenBCI (http://www.openbic.com), which I'm helping to develop. It just completed its Kickstarter, so hardware is not yet available for sale. If you want something right now, I've also used OpenEEG, which can be bought from Olimex in Europe:

      https://www.olimex.com/Products/EEG/OpenEEG/EEG-SMT/open-source-hardware

      For software, OpenBCI has a couple of software options that were built just for it. You can get those on OpenBCI's GitHub (https://github.com/OpenBCI/OpenBCI). Both OpenBCI and OpenEEG are compatible with BrainBay (http://eeghacker.blogspot.com/search/label/BrainBay), so that might be a good choice.

      Good luck!

      Chip

      Delete
  6. Is there any other method to check the working of electrodes

    ReplyDelete
    Replies
    1. Another good method of checking the effectiveness of one's electrodes is to measure the impedance across the electrode->skin interface. This feature is often supported by EEG and ECG hardware. You'd use the impedance-check feature to ensure that each electrode shows less than 5 kOhm.

      If you don't have EEG / ECG hardware that has this feature (OpenEEG does not), you could try using a handheld multimeter (DMM) to measure the resistance. Be sure to use a battery powered DMM! Do not use one that you plug into mains power!

      With a DMM, you could attach a pair of electrodes to your skin. Then, you could clip one side of the DMM to the wire from one electrode and you could clip the other side of the DMM to the wire from the other electrode. Since you're measuring across a pair of electrode->skin interfaces, you're hoping to get a total resistance of less than 10 kOhm.

      The main problem with this method is that the DMM is measuring the DC resistance. EEG/ECG signals are AC signals. The DC resistance might not be indicative of the AC resistance. Maybe it'll work, maybe it won't work. Give it a try and let me know what happens!

      Delete
  7. I also use ECG as a first test on EEG amp. A tip is to use Lead II so you get an upward deflection. Lead II is also the largest amplitude of Leads I,II or III Lead II is
    RA -, LL + and RL common

    ReplyDelete
  8. Hi,
    That's absolutely an awesome post.. I am very new to EEG Hardware hacking (only worked with commercial devices before, Neurosky etc..)
    If I want to buy dry active electrodes for a simple BCI setting which would you recommend??

    ReplyDelete
    Replies
    1. I've never bought dry active electrodes, so I can't be much help. Sorry!

      I'm very interested, though. So, if you buy any, come back here and leave a comment telling me if they worked for you!

      Chip

      Delete
  9. You do the novice a disservice my suggesting that a terminal lug will produce satisfactory results. What you suggest is wrong on so many accounts that I find it disgusting. Do some homework!!

    ReplyDelete
    Replies
    1. Perhaps I was a bit to dramatic in my previous post. If the reader tries what you suggest, then they will find that there signals are noisy. Further the introduction of dissimilar metals at the solder junction interface will produce corrosion that will in itself will produce even more noise. Copper ions are know to be toxic... so the user will be introducing a mechanism for introducing undesirable compounds into their body. Eventually, the electrodes will become polarized and all but unusable. We use Ag/AgCl2 electrodes because they are low noise, free from polarization, and have a well established track record of success.

      Delete
    2. Please remember that the title of this blog is "EEG Hacker" and "hacking" is what we do.

      I agree that purpose-built, well-designed electrodes will perform better. But making "better" electrodes wasn't my point. My goal was "if you don't want to buy electrodes, what could be done DIY?".

      I'd like to think that my experiments here might have de-mystified electrodes a little bit...maybe made electrodes seem less like a magical device...maybe brought them within the purview of someone's own hacking...maybe allowing someone to try out their own improved or specialized design. That's what I was going for, at least.

      I am totally interested in safety, though. So your comment about copper toxicity catches my attention. Can you share any links or additional info that you think is trustworthy? (And I'm talking specifically about poisoning from contact with the metal, not copper poisoning from copper ingestion.)

      Thanks so much your interest,

      Chip

      Delete
  10. Chip: As much as we would sometimes like to think that we can just hack something together that will work, the truth is that in the case of electrodes this was done along time ago. After a while, tired of failing those "hackers" of a previous age got down to making a science of understanding what was going on. There is a common misconception about hacking. Good hacking in this case starts with understanding the chemistry of a metal/electrolyte/body interface and a serious study of prior art.
    For a better start at hacking electrodes start with electroninks.com I love their stuff. So will you!
    And BTW, a really good electrode IS magical, and does come from the laboratory of wizards!

    ReplyDelete
    Replies
    1. I think that we have an important disagreement over the goal of hacking. To me, hacking is different than engineering. I'm an R&D engineer. That's my day job, so I know something of the way to engineer something.

      To me, though, "hacking" is different...to me, hacking is more about the joy of learning something new, the empowerment of making something (sorta) work, and the fun of sharing what you've done so as to motivate oneself and others to get up off the couch and do something other than watch TV.

      The process that you've described is indeed the way to properly engineer something. It is the more effective and reliable process for making something better than what has existed before. It is the process by which something excellent is made.

      But, "excellent" is not my goal. Learning, empowerment, up-off-the-couch...those are my goals. There are many paths to achieve my goals.

      Delete
  11. Why do you waste you time to make passive electrodes yourself if you can get high quality EEG elctrodes online at low prices at: www.greenteksensor.com. You deserv the convenience.

    ReplyDelete
  12. He already stated 2 years ago.:"My motivation to make homemade passive electrodes has diminished a bit every since I found that the electrodes below are $8 for a set of 10." IMO this blog has evolved into open hardware / software solutions to work with EEG. No wizards needed in this realm, just curiosity. Thanks Chip!!

    ReplyDelete
  13. This was extremely helpful in that I now understand the simplicity of making an electrode. That flashpackets guy has a poor way of communicating. There should be a sign next to his name stating "does not play well with others". lol. I feel he could have enlightened us without the sass. Thanks Chip! Now I don't feel so intimidated about going from using electrodes to proposing new materials for creating electrodes.

    ReplyDelete
  14. Hey Chip! Really didnt't know making them could be so dirt cheap. What do you think about using aluminium foil as an option? Do you think it will work?

    ReplyDelete