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…







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:

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:
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


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).

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.

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.


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:

EEG Schematic

•August 15, 2008 • 48 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:


Link2 (for the original JDM progger):

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 )

Can ya hear my hearbeat?

•November 11, 2007 • 1 Comment

Ok, I decided to setup the basic single channel circuit and test it out to see if i could atleast register my own heartbeat. Easier said than done. A little bit of theory…

INA118 gain is determined by a single resistor Rg. And the Gain formula is : Gain = 1 + (50kilo-ohm/Rg)

Now, I thought i could manage to record my heartbeat with a nominal gain of 100 or so, but I actually had to crank up the gain to get a decent recording by using a 100 ohm resistor for Rg. Anyways, got that all setup and now, for the electrodes. I haven’t got down to creating the active electrodes yet, so I decided to simply use a pair of home-made ones. Each passive electrode simply consisted of a plastic cap with an office clip (yes! the all-useful office clip) and a sponge soaked in saline water. Here’s what it looks like:

Passive electrodes

A word of advice: Watch out for all that chest hair when you tape the electrodes to your chest. It can get excruciatingly painful when you try to pull the electrodes off! Don’t ask me how i know! 😀

Electrode positioning: Main electrode (V+) on the left chest close to the heart, other electrode (V-) on the right chest and the Right leg electrode on the right ankle (duh! obviously!!). The electrode cables were simple single cores with shielding.

OK, time for Testing! As I suspected, the circuit worked better with a dual power supply rather than a single 5v supply. (just hook up a couple of 9V batteries to 7805 & 7905 with supporting components and you’ve got your dual supply). Also, the right leg driver didn’t really improve the quality of the readings. In fact, I got better readings by simply connecting the Right Leg electrode to Vref which, in the case of a dual power supply, would be the Ground. The reading I got was pretty noisy but not bad, considering my electrodes were home-made. Recorded my heartbeats through the soundcard using Adobe Audition. Here’s a screenshot for y’all:

testing INA118 - heartbeats

It’s definitely not the cleanest of recordings… which brings to me to the next stage… Filtering!

See y’all in a while!

EEG for the braindead

•November 11, 2007 • 12 Comments

I was hoping to start this blog yesterday but I couldn’t find the time coz I went for a rock show. This little project is a resurrected version of something similar I worked on a few years ago. A lot of my inspiration comes from the OpenEEG project. So, if you’re ready for the ride, let’s begin!

I hope to be able to provide a few useful guidelines to those who’d like to build a cheap and affordable EEG recording circuit for themselves. My idea is to build a basic EEG circuit based on the venerable INA118 (precision instrumentation amplifier) and then record the data output either through a :

a) RS232 serial port (optoisolation achieved using 6N139)


b) Soundcard (signal is first FM modulated, optoisolated using CP Clare’s LOC 110 which is then fed into the Mic input and finally software demodulated into the original EEG signal )

One thing I definitely want is to have atleast 8 separate channels and I’m planning to employ Active electrodes (16 of them + 1 for the Right Leg Driver). The difference between a Passive and Active electrode is that the latter uses an op-amp combined with the electrode itself. This provides better readings and also better noise reduction. Now, the best part about this entire thing is that i plan on using ONLY ONE INA118 inst. amplifier for all 8 channels. This will be achieved by routing the signals from the active electrodes through an isolation analog multiplexer such as MAX4558.

It’s gonna take a while before i complete the entire thingamagic, but it’ll be worth it. If all works well, I’ll use this for my own neurofeedback training purposes.

Here’s a pic of the basic EEG circuit. What you’re looking at is the basic building block based on INA118 (the chip on the left) with a Right Leg Driver (RLD) running on TLC272 (to the right).

INA118 basic EEG circuit with RLD

Keep checking in every now and then. Once the circuit is completed, I will post the entire schematic. Will definitely keep you posted on any progress made in the meantime…