This is the complete step by step guide of Brain wave decoder project.We will cover each and every step with details and practical results.There are three main parts of the project The hardware,circuit designing and the software.In the hardware section we will discuss about EEG project applications,The selection of electrodes for capturing EEG waves. The circuit designing part consists of designing filters for extracting EEG waves.The last part is about test results and real time EEG wave simulations. The brain wave controlling EEG project consists of many sub sections.The complete project will be covered in the following posts.
- Brain wave decoder EEG project step by step guide
- What is EEG and How it works
- What is the History of EEG waves and Neuro imaging techniques
- Brain computer interface BCI monitoring systems
- Functionality and Applications of the brain wave EEG project
- Material required for portable EEG system development
- How to select electrodes for brain wave EEG project
- circuit designing steps for EEG portable monitoring device
- How to design filters for EEG circuit
- Schematic diagrams of brain wave EEG project
- Simulation analysis of brain wave controlling EEG project
- Challenges and Problems in EEG brain wave controlling project
- Final results of brain wave decoder EEG project
- How to filter EEG waves on MATLAB
- Future research for EEG project
- Hardware and software list for EEG project
Reading the EEG signal
The EEG signal reading process consists of five main section that is based upon filtering and amplifying. These five sections have an important purpose that helped to reduce noise. As we are using Arduino microcontroller we will need a clamper circuit for Arduino operating voltages. we will discuss about this in detail in coming section In the five sections include signal picking, filtering, amplifying, offsetting the AC signal and clamper to make the brain signal readable.
The five section of EEG amplifier circuit:
- Instrumentation amplifier AD620
- 60 HZ Notch filter
- 31 HZ second order low pass filter
- Final amplifier and DC offsetting
- Clamper circuit
Instrumentation Amplifier AD620 (Pre-amplification)
The first part of the circuit configuration is the instrumentation amplifier. The instrumentational amplifier takes a differential AC signal, this part is the difference amplifier. To make the system portable we have decided instead of making circuit with three operational amplifiers (Op-Amps) there is a pre-built instrumentational amplifier package that is the AD620 IC that only requires a resistor in the configuration for adjusting the gain of the circuit.
The resistance RG of the instrumentation amplifier circuit has to be adjusted.
This is the equation for adjusting gain of AD620.
The resistance of 2kΩ, has been used for our circuit that yields a gain of 25.7 V/V. This gain will multiply with the final gain of the final amplification so, we have to adjust the most suitable gain according to the circuit.
This part of the circuit picks the microvolt signal from electrodes and takes the difference and reject the common mode and make the signal readable by the rest of the circuit. The signal is not visible on the oscilloscope because of the noise but using function generator signal it gives the sine wave at the output after this part.
The instrumentation AD 620 comes with 8-lead SOIC and DIP packages. The AD 620 is high accuracy low cost IC.
Search the pin out of the AD620. The circuit of AD620 is quite simple as we need only one resistor. That resistor sets the gain. The circuit needs both positive and negative power. As the pin 4 in negative and we have to make a three channel supply. This is the very first part and it has the most important role because it picks the signal and the rest of the circuit is only the signal processing part. The electrodes are connected as according to the pinout defined in the figure 3-8. As the pin 2 shows the negative the negative electrode part goes into this. The positive is 3 the positive electrode goes into this and the ground will be on pin 5. The ground will be same of the whole circuit. Remember this is the ground not the negative of the circuit. The output is on the pin number 6 and then goes to the next part of the circuit.
The Notch filter
This filter is used to eliminate any noise present at 60 Hz. Notch filter can be made up of using 4 Op-Amps. The Notch filter has also come up in a IC package that is UAF42 that needs some simple resistors to calibrate at 60 Hz. Making a notch filter using amps is a time taking task. We need shortest circuitry to get the low noise EEG signal.
A notch filter is used to remove a specific point of frequency. At the point of notch, the particular frequency has been rejected. As in our case we need to remove 60 Hz line noise so, we need to remove the frequency coming at 60 Hz.
If we look at the response of the notch filter the response at 60 Hz will be a flat wave. Because there is notch at 60 Hz. It allows the higher or lower frequencies but not the 60 Hz.
Any signal that is passing after notch circuit will lose any 60Hz noise that is
generated. We still need another filter to remove further noise. Further we will discuss about notch filter in the simulation section of notch filter.
The next stage is the low-pass filter to remove the higher frequencies. We need a beta wave for our circuit. The beta wave has a frequency range of 12 to 30 Hz so need a second order low pass filter. The TL084 operational amplifier used.
There are different filter topologies for developing a good response circuit for EEG. We can use any of to construct a 31 Hz low pass filter. The filter equations are quite simple and easy to find resistor and capacitors values. We can also use online filter values calculators to find the exact resistor and capacitor values. As they only required the cut off frequency and provides the corresponding values at the desired cutoff.
We have also developed and checked different Low pass filters to check the response of our EEG signal. We have made a simulation of second order low pass filter on MATLAB and tested different ways that suits most to our circuit.
The Fig- shows the circuit of second order low pass filter on MATLAB simulation that we have tested before using any other constructed circuit.
The MATLAB is only used for designing and analyzing the response of filters. As we have designed and tested before making on the hardware. The simulation on the MATLAB is because of identifying the transfer function and values of the components. We can plot any of desired response in it as we compared to the other simulation software like multisim. We can also produce a noise in the circuit using MATLAB to test the results.
After the notch filter the signal passed through second order low pass filter. At this stage the circuit should response on the movements of arm or eyes. If it not responds that means the system still has noise. The circuit responds at this stage it was a good response. If the circuit does not respond at this stage, this means there is still enough noise available in the circuit that is affecting the EEG circuit. We have placed the electrode on the frontal lobe. The signal reacts either in the positive amplitude pulse changing or negative whenever we move an eye to the left or right.
We are using the multiple feedback loop topology for our low pass filter designing.
We will discuss more about the circuit in the simulation section. At this stage the circuit will reduce much of the noise. The next stage is the gain stage the final amplification part. After amplification the circuit comes to in a stage where we can see the signal on oscilloscope. There is need to check each and every part separately for good response. We can check using function generator signal the wave form on the oscilloscope will be lower on higher frequencies.
Gain Stage and DC offsetting
The Gain Stage section is used to adjust the final gain of the circuit. The init6ial gain was 25 V/V so it will multiply with the final gain of the circuit.
The signal will amplify after this part and it will easily readable and detected by oscilloscope.
So, the final gain was approximately 200 V/V. We can increase or decrease the gain of the circuit for better response and according to the behavior of the circuit.
All the circuit have been made with the Op-Amps. The Quad Op-Amps used for the circuits. The TL084 IC is used which have 4 operational amplifiers in it. So instead of using 4 Op-Amps and to reduce noise and complexity of the circuit only 1 TL084 IC used for all the stages.
The final part of the circuit is the clamper circuit. This part of the circuit is only used for Arduino microcontroller. We are getting the output at the analog input of the Arduino board and Arduino has only 5V operating voltages. For the reason we used a clamper circuit. The clamper circuit will offset every voltage from below 5 volt and above zero so that the Arduino can read without any high voltage spike.
By the definition of clamper, the clamper changes the DC level of a signal to the desired level. It will change without the changing of original signal shape. In our case the clamper will keep the signal voltage in the range from above 0 and below 5 volts.
There are different types of clamper Positive, negative and biased clampers. After this part of the circuit we are able to take the signal to the Arduino microcontroller. The Arduino board reads the signal and converts it into digital form to perform any task or to control any thing that is connected to the Arduino board or wirelessly. We are using MATLAB for real time signal plotting and analyzing through Arduino board.
Everything will be cleared in step by step guide so stay connected for more tutorials and guides.If you have any query about the project feel free to comment below and Subscribe to our YouTube channel for video tutorials and project application ideas.stay happy and stay motivated.