Hacking the EEG Signal
In this first experiment, we will try to hack the EEG signals. For this, we need to make some arrangements so that we can easily measure the signals.
For this, I have made a hole in the cover of the EEG sensor as pointed in the picture shared below.
Now after making the hole, the next task is to solder few wires to the desired pin so that we can measure the signals. I have soldered two wires for our measurement. One is at the EEG electrode pin and the other one is at the reference electrode pin.
I hope you can see clearly that there are two wires soldered here. One is Red and other one is Blue. The red wire is soldered to the EEG electrode pin and the Blue wire is soldered to the Ref electrode pin. You can again have a look at the previous article where pin description was explained.
Please make sure while soldering that the wire does not touch the adjacent pin, because that may harm the device. Also, as seen from the picture, there is very little space available to solder the wire so make sure you are aware of the precaution. I curled the wires among themselves so that any magnetic effect can be nullified to the maximum extent. I also tied a note of the wires in the sensor so that any tension in the wire (out of the box) does not affect the soldered pin and they are safely connected for a long time. After this, I closed the sensor and in the end I had two wires coming out of it as shown in the picture below :
So now we can connect these two wires to the CRO and can measure the signals. Now it is time to check the signals on CRO. I have worn the Brain wave sensor and have connected two wires from the sensor to the Oscilloscope. I have also removed my Laptop’s charger so that there is no chance of fluctuation or any other spikes in the ground.
After switching on the sensor, the wave which I receive is shown in the picture below. Keep guessing what I was thinking at that time!!
We have finally reached to a point where we could see our BrainWave directly on the screen. Now it is a matter of discussion about the wave, its various curves and values. Presently, we got a wave with the maximum voltage of nearly 65 mV and minimum of -10mV.EEG Signal Study.
We have successfully received and recorded the Brainwave signal or you can say the signal coming from the electrodes of TGAM1 chip. Now let’s take a focused and detailed look on the signal and try to analyse it.
As I discussed earlier there are mainly 5 types of Brain waves. We all try to find all these Brainwaves in this signal. Please note that these are just my assumptions and hence I might be wrong.
First we will look on Delta waves. Now the characteristic of Delta wave is that they are of very low frequency and are the highest in amplitude. Can you find some wave in the image, which is lowest in frequency and highest in amplitude? Low frequency means that the wave has a higher time period and must be appearing very less time in the graph. There is one such high crest in the graph and is appearing only once. So my assumptions say these waves are the Delta waves.
Now next comes the theta waves, the frequency of these waves are more than Delta but still very low and their amplitude is also very low. So please have a look on the crest I have thought of as Theta waves. These are low in both frequency and amplitude. After Delta and theta, it is the time for alpha waves. The frequency of Alpha waves ranges near 10 – 13 Hz with higher amplitude but not as higher as delta waves. Not by the frequency but by the second highest amplitude I have guessed the alpha waves.
Similarly for beta and gamma waves, you yourself can guess that the waves with higher frequencies are gamma waves and waves ranging in frequency between gamma and alpha are beta waves.
This is just an analysis by me for the wave I have captured. Now we will try to experiment more with this wave and will try to do certain things which are done by the TGAM1 chip.
Interfacing the Transmitter Pin
Let’s now hack the signals this TGAM1 chip is transmitting to the mindlflex board. The procedure is pretty same and we have soldered a pin at the “T” transmitter pin and one at the ground pin of the Headband circuit. I hope you can clearly see the red wire soldered to the T pin.
Similarly as before, we have taken these two wires , the red one (Transmitter) and the yellow one (Ground) too out of the sensor box and now you can see four wires coming out of it. These two wires are also curled among themselves.
Now after successfully soldering and taking these two wires out of the box, I have attached the CRO pins with these wires. Please have a look at the CRO output.
What are these signals? Can you guess?
Well, these are some bits which the EEG module is transferring to the MindFlex sensor serially. We have just hacked the pin and now we are seeing the result on screen.
Also, note that the Voltage is 3.3V around. This means that the communication of Mindflex and TGAM1 chip is 3.3 V serially and I have also observed that this communication is continuous as I have observed the bits coming out of the pin continuously. At this stage we can say that the TGAM1 is sending serial bits of 3.3V. Now our next task is to read the bits and find out how it is related to the Brain waves. May be there is some algorithm between the two boards. It is also possible that these two boards are handshaking with each other. Till now we can just confirm that the sensor is transmitting some values continuously. In the coming articles we will use a Serial3.3 V to Serial 5 V and then will try to read these bits at hyperterminal. Are you excited what these bits will be? Will we able to hack this toy using these pins? I also not sure about anything right now but we will be, after few articles.
Brain Wave vs Body Wave
Let us see what more we can do and experiment on this. I always wonder that if brain is emitting some wave than does our body also emits some sort of wave or is it just our brain? Let’s see what the answer is.
So for the experiment, I have soldered the EEG PIN and the ground pin with two wires. By the help of a hole I have taken these two wires out than have connected them with the CRO pins. Let’s have a look at the CRO screen when I will connect the electrode at my finger and brain.
First I connect my EEG pin to my finger and left the reference pin in the air. I left the reference pin in the air as I want to just measure the signals my body is emitting with respect to the stray signals of air . Making air the reference, I hope I have emitted the stray signals which would have come at my EEG pin. Please have a look at this.
The line is pretty straight. This can be said that the finger is not emitting any signal. In the above picture, the time per division is 500ns. This means that at such variation also, there is negligible change in the EEG graph.
Now let us have a look at the same EEG graph when the sensor electrode is connected to the forehead exactly above the right eye.
A can get a closer in the picture shared below.
Small waves and few high amplitude ones can be seen easily.
While performing this experiment, I noted a very important point and this can be crucial for you too.
I have tested the experiment with a PC oscilloscope. Now please have a look at the signals when the charger of the laptop is connected.
The analog values of our brain waves are of very small voltage in the range of 15mv to 50mv. While measuring their values, we need to take of the extra magnetic field present in the environment. We also need to take care that any stray fields in the environment can be present in our measurement. Also, any point of solder or any open point can act as antenna. We must have a proper reference, grounding and isolation while measuring the brain wave values.
I hope now you have a basic idea as to what are the basic problems coming while dealing with the brain waves or you can say that such problems are present while we measure any wave with such small voltage. Stay tuned for upcoming article on amplification of EEG chip and interfacing with Arduino.
Filed Under: Tutorials