Real Cyberpunks don’t use hair product, just electrode gel

•April 4, 2017 • Leave a Comment

Woke up with the smell of dried up electrode gel in my hair… my body felt weary but my mind was on fire and humming with thoughts and conclusions about the  experiment I had concluded just the previous night. I had emerged from a 3-hour long EEG recording session, during which I meditated so deeply, I felt I was one with the Machine. There were points at which I was in harmony with my EEG headset that I had built and upgraded over the years.. it felt strange and exciting at the same time. Anyone who has built their own equipment and actively experimented with EEG, Neuro-feedback and/or BCI may know what I’m talking about. When you work intimately with electronic devices (especially those you’ve built or put together) that provide you with audio or visual feedback of your own bio-rhythms (in this case, one’s own brainwaves), there are times when you’ll notice how the waves from each hemisphere come together in harmony, even if ever so briefly. And you feel the thrill of knowing that you can spot and identify those moments with the help of your recording equipment. When there’s this constant flow of information that gives you a picture of your own brain’s inner activity, your thoughts and recognition of it further strengthens it, thereby establishing a neuro/cognitive-electronic feedback loop. And those sparks of utter clarity and mini epiphanies are what we neuro-freaks live for.

I’ll get into the technicalities of the session in a while, but this is not going to be a purely objective report of what occurred. There are MANY philosophical implications and conclusions I arrived at while I was in that meditative state, and they are based on MY observations of various subtleties that one experiences in such a state while being hooked up to your EEG setup. So, feel free to take my thoughts with a huge grain of salt. Suffice to say, I’m extremely proud of this headset I constructed.. and I’m thankful to both OpenEEG and OpenBCI for all the great work they’ve done to make such circuitry and equipment easily accessible to those of us who truly wish to build devices to help us understand the inner workings of our own brains. THIS is as cyberpunk as it gets, atleast AFAIK in the local DIY electronics scene in my corner of the world.

 

To be continued…

 

 

 

 

 

 

Advertisements

New & improved EEG headset with OpenBCI

•March 14, 2017 • 2 Comments

Oh, how things have changed over the past 10 years! At the time when the only option you had to dive into Neuro-feedback was to create or build your own circuitry, spend hours and weeks fretting over the instrumentation board, matching the channel inputs correctly, etc. Now, you have plenty of options to choose from, so you can save yourself all the grief and heartache. If you have the money and you’re only interested in Brain-Computer applications, then either buy a wireless EEG headset from Emotiv (this company offers a decent 5 channel to 14 channels, but you have to PAY for being able to read raw data from the headset, which sux!), then there’s Muse, which is a sleek-looking brain-sensing headband that seems to be popular for meditation… and finally, NeuroSky (honestly, it looks like a toy headset to me with just ONE channel). This blog does a great comprehensive review of most popular & commercial EEG headsets, as well as the open-source options out there: https://www.diygenius.com/hacking-your-brain-waves/

However, if you have a small budget and don’t mind tinkering around but at the same time, if you dont want to re-invent the wheel, then I’d heartily suggest you get yourself the 4-channel Ganglion board from OpenBCI, which costs about $200: https://shop.openbci.com/collections/frontpage/products/pre-order-ganglion-board?variant=13461804483
I got mine last month and this is what it looks like:

OpenBCI Ganglion board

OpenBCI Ganglion board

The beauty of OpenBCI’s design astounds me and I’m SO impressed with what you can record with this board: 4 EEG channels + Accelerometer data, and you are not limited to recording only EEG data, you can also use it for ECG or EMG recordings as well! And since it has Bluetooth-LE onboard, that means you can wirelessly transmit your EEG data straight to your system. And OpenBCI’s software is just as impressive, not only does it stream raw EEG data in real-time for FREE (Emotiv & NeuroSky, you could learn a thing or two from these guys!), but you can also monitor the Accelerometer (which detects 3-dimensional movement of the head) AND the software also has  an Electrode Impedance checking section to boot! The Impedance checker is VERY handy, helps you to figure out if any of the electrodes are sitting loosely or if they require more gel to be added, etc.

Now if you have another $300 to spare, then it would make your life a LOT easier if you got yourself the Ultracortex Mark v3 or v4 headsets, because they’ve been designed for fast application, doesn’t require electrode gel (since they use dry Ag/AgCl electrodes) and most importantly, the Ganglion board fits as smoothly as a baby’s butt at the back of the UltraCortex headsets 😀  I would’ve preferred to get myself the Ultracortex Nova atleast, but the DIY experimenter in me just couldn’t stand the thought of having to waste the previous EEG headset that I had already built. So, I decided to incorporate OpenBCI with my existing EEG headset.. I added the board on top of the headset, fixed it with a few screws, melted a bit of plastic to make a small seat for the 9V battery to sit comfortably and tied it securely to the headset with good ole electrician tape! Here’s what it looks like:

So now, my EEG headset is a mixed EEG system and allows a total 6 channels (4 from OpenBCI + 2 from OpenEEG/my circuit). The trick to combining both systems seamlessly is to ensure that both systems share the same floating Driven Ground (i.e., the DRL in usual parlance) and the way I achieved this was to build a couple of earclip electrodes… from clothes pegs! 😀 I combined the pegs with pure silver electrodes that I got made especially for this purpose and they work extremely well, even without electrode gel! So, one of the earclip electrodes acts as the Reference electrode (I used it on the left earlobe). And with the other earclip, I’ve sandwiched the right earlobe between two DR electrodes, i.e., combined both Driven Grounds so that the DRL electrode from OpenEEG sits on one side of the earlobe while the other side is covered by the Driven GND from OpenBCI. This way, both systems will share the same Driven Ground, thereby ensuring that all readings are correctly recorded with respect to the established common reference.

 

To record data from the Ganglion, I’d need the Bluetooth CSR dongle for OpenBCI, which interfaces well with their open-source software, whereas with my old circuit / Olimex, all recording takes place through a USB cable. So far, the readings I’ve taken from both sets of electrodes and systems look great (except for one channel but I’ll have to look into that). I’ll add more info and pictures the next time I take an EEG recording with my new & improved OpenBCI/EEG Headset. Ciao for now!

EEG Headset with Active/Passive Electrodes

•May 4, 2013 • Leave a Comment

DSC01105

This took me a while to get around to but I finally constructed an EEG headset for my neuro-feedback experiments. Took an old pair of headphones and converted it into my headset, using a pair of active electrodes I built (based on the concept and design shared at the OpenEEG project) as well as passive electrodes from olimex. The advantage of implementing active electrodes in this headset is that you do not have to apply any electrode gel, plus it’s useful because the gold-plated pin array helps to get past hair and maintain contact with the scalp at the back of your head (occipital region).

20130505_162749
The passive electrodes work fine as they are, coz they sit comfortably on the forehead just above the eyebrows (frontal ridge); again, no gel needed.

20130502_193620eeg-headset-forehead
If you choose to construct a headset like this with an active+passive electrode combo for each channel, then you will have to match the output signal levels between the electrodes in each set (i.e., between active and passive on the Left and then Right). The active electrodes are more sensitive to movement artifacts but they have better noise rejection since each active has the gain amplifier on board (I didnt have the time or inclination to experiment further, but I’m sure it will be much better if you construct active electrodes with SMD components).

If any of y’all construct a similar headset of your own, feel free to share your photos & comments!

EEG, risen from the dead…

•April 23, 2013 • 1 Comment

It’s been years since I posted anything new. So many projects have come & gone, but I still return to my neurofeedback favorite from time to time. In addition to my own circuitry, I recently acquired this neat & simple, 2-channel EEG-SMT device from Olimex.

Image

This company basically sells a spin-off variant of the main ModularEEG circuit from the OpenEEG project. Costs about 140 euros (with 2 pairs of active electrodes, 1 pair for each channel obviously… and 1 passive electrode for the DRL). If you have the money but you dont have the time to dick around with building your own circuit, then just do yourself a favour and buy one of these for yourself! Check out Olimex’s EEG page here:

https://www.olimex.com/Products/EEG/

EEG Schematic

•August 15, 2008 • 41 Comments

Alright, so here it is! Finally, after all that experimentation, it all boils down to this. As of now, this schematic incorporates only ONE EEG channel measured by an INA118, which is then fed to an inverting amplifier followed by a Fliege Filter (cut off frequency is set at 33.86 Hz). I previously used a dual supply to power the circuit, but with the help of TLE2426, I’ve been able to use just a single +5V supply (which comes from a 7805 connected to a 9V battery). If you have any questions at all, feel free to post here or email me at:

teknomage's EEG schematic

EEG schematic

For the electrodes, I got good results by replacing the gel layers in medical electrodes (already used) with sponges soaked in warm saline water.

Future plans:

  • Precision analog multiplexer to expand this circuit into 8 or more EEG channels
  • Using this circuit for neuro feedback – specifically Alpha & Theta training

In case you’d like to read more about creating your own EEG circuit, check out Solson’s EEG page. He’s got some neat info on his EEG hardware as well as on Neuro-feedback.

By the way, I’ve also been working on a circuit that kinda replicates the results that you can get from Dr. Robert Becker‘s Brain Tuner. You can read more about the Brain Tuner here. basically incorporates Cranial Electro Stimulation at very low currents. In my version of this device, I’ve programmed a PIC 16F628A to generate specific sinewave frequencies (very low Hz) followed by a low DC current that suddenly switches polarity at the required moment to place the user in a light alpha state. More on this later…

Why doncha PIC on someone yer own size!

•April 27, 2008 • Leave a Comment

April 27, 2008

Well, there’s been a whole lotta heavy experimenting goin on, but i just haven’t found the time to post what I’ve been up to. First things first… the LTC clocked filter was a total flop, so I had to incorporate a 4 stage Sallen Key filter (wonder if you love & hate analog like i do)… Later, I switched to a Fliege filter. Results are pretty clean (for now)… And there’s more to come in the Bio-signal front…

…In the meanwhile, I was also working on setting up a decent Serial Data Logger (opto-isolated, no less). Can’t mess around with your life when it comes to recording bio-signals… so the best way to go is definitely optoisolation. Anyways, I played around with the 8 bit, 8 channel ADC 0809 coupled with the USART 6402 and MAX232 plus 6N139 (for the optoisolation of course). It was all a miserably failed attempt. And I’m glad it failed… coz I found an easier way to get the signals logged.

Enter PIC 16F73 (or 76 or 876… you take your PIC 😉 ) . I had already created a custom-made Serial Data Logger software in Visual Basic and it was designed for 8 bit sampling ranging from 1200 bps to 57600 bps. I didn’t want to rewrite the code for 10 bit sampling, so I just stuck with the 16F7X series instead of the 87X series. Well, once you decide on your PIC, you obviously need to have a programmer. Prior to this, I made a cute l’il programmer for 16F628A, but it wasn’t a generic programmer… so I had to build another one from scratch.

The programmer I chose was a modified version of the famous JDM programmer. The good thing about this progger is that you can use it for most PICs ranging from 8 to 28 pins. Please check out the links below if you wanna build yourself a highly affordable generic PIC programmer:

Link1: http://www.stmental.net/~dfoster/dmf_picprog/

Link2 (for the original JDM progger): http://users.tpg.com.au/btkelly/jdm_b.htm

Note: There is a small correction to be made in the schematic at Link1. The Drain and Source of the MOSFET as shown in the diagram need to be reversed. I learnt this the hard way. Everything else in the schematic is A-OK.

Here’s a pic of the modified JDM Progger I made myself (couldn’t find a 28-pin ZIF, so had to use a 40 pin socket instead)

After plenty of coding an recoding and tweaking and twisting, I finally managed to get a decent output from the PIC. Since it has an inbuilt ADC as well as a UART, it made my job MUCH easier. The only thing I had to get was a 20 Mhz crystal to run the PIC, but after that, everything just worked perfectly (almost… still get a couple of glitches in the output… will have to iron them out soon).

Here’s a snapshot of data sampled by the PIC and fed to the computer via the Serial port. Say Hi! to my very own Serial Data Logger software:

Serial data logger

The beauty about this software i wrote is the flexibility. My favorite part is choosing the number of channels… a corresponding number of data display frames are automatically created and I can view each multiplexed channel separately in its own frame.

Here’s a picture of the Opto-isolation section of the Data Logger circuit. You can’t see the chips clearly, but those are MAX232 and 6N139 along with 7805 for power supply regulation.

Max 232 with 6N139

On the output side of the 6N139, the MAX232 and 6N139 are powered by a cable that runs directly from my PC’s own power supply. I used the 9V terminal from the PC supply and regulated it with 7805. If you dont wanna use the regulator, you could always use the 5V terminal from your PC’s power supply connectors instead.

On the input side of the 6N139, everything is powered by a 9V battery (regulated to 5V by another 7805). This ensures that your bio-signal end is galvanically separated from your PC.

And for the finale, here’s a pic of the PIC 16F73. The serial output from the PIC goes to the input of 6N139. I segmented the two parts, so that I could experiment and fine tune each one separately first…

PIC 16f73 - ADC with UART

Stay tuned for more updates. The next time I blog here, it’ll be all about putting this entire mess together and just hoping that it all works like a charm :-))

Filter, o Filter… where art thou?

•April 27, 2008 • Leave a Comment

December 02, 2007

Filters… I’ve always had an aversion for analog filters especially the multiple stage Butterworth types… So, i thought i’d try to use an alternative. Enter LTC1063… a 5 stage Butterworth filter all included in a single chip that only requires an external RC to set its cutoff frequency. I was so excited at first, coz I thought this chip would solve all my problems. Well, it would have, only if my operating frequency wasn’t so low. Imagine using this chip to drastically reduce every frequency from 50 Hz and above. The clock frequency has to be ten times that… and unfortunately, that falls within the audible range. What that means is that the clock frequency is bound leak into the circuit and guess what? It did!! I would’ve had to have added another butterworth filter just to remove the clock frequency itself. So, i shoved LTC1063 aside and decided to revert to the old-fashioned method…

Back to the 5 stage butterworth Sallen-Key stuff… Played around with different variations to see if I could get a decent result. My aim, as stated before, is to simply reduce all the frequencies above 50 Hz. Not really interested in experimenting with High Gamma brainwave frequencies as of now. I managed to arrive at a good Sallen-Key setup… will post the component values and the calibration scope results in a while. Until then, Ciao!

EDIT: I found a better filter topology called the FLIEGE FILTER. It’s amazing to find free info like this from Texas Instruments. I’m now using this filter in my circuit (check out the schematic in one of the posts above )