Using Brainwaves to Buzz Alarm
SUMMARY
Previously in the brain waves series we used GSM with the brain waves to detect if the person is sleeping. The same experiment can be extended further with a different perspective. Now presently in this article, I am planning to explore more applications of Brain waves.
Nowadays I am trying to meditate to keep myself calm. Since meditation helps a person in many ways, I thought to give it a try and it proved to be very helpful. However, while meditating I observed that I could not guess as to how well I am doing the meditation. As a result, I decided to use brainwaves to develop a device which could inform me if I achieve a certain level. It can also be helpful for practitioners and meditators in future.
Fig. 1: Image showing Meditation Level Detected using Brainwave Sensor
DESCRIPTION
you know that we are getting the values of all the Brain wave types from our Arduino, here, our task is just to find the wave which is most affected by meditation. Now alpha waves again show us a lot of variations according to our meditation. So, we first check out the values of alpha waves at different alertness levels. I have tried my meditation level and then have recorded them for testing purpose.
Fig. 2: Image showing meditation Level Detected using Brainwave Sensor
While testing it on myself, I found that the values of alpha waves crossed 2 Lacs very rarely and only when my concentration was the highest. So I set the level of 2 Lacs in my arduino coding. This value can be set by person to person. Since the values from mindflex vary from 1Lac to 7 Lacs, so we set a level at 2 Lacs and whenever the values were more than that we started sending signals to the speaker so as to make a sound .
Fig. 3: Block Diagram of MindFlex Brainwave Sensor based Meditation Level Detector
Hardware:
Please find the attached circuit diagram of the connections that we need to establish. We have taken a pin from T pin of the mindflex sensor and connected that pin to the Rx pin of our Arduino UNO. Also, we have shorted the ground of both Sensor and UNO by a wire. Please take special care while soldering anything to the Mindflex sensor as pins are very close to each other. After this, we have connected the 11th and 12th pin to a small 4ohm speaker.
Software:
Let us come to the software part. We have been receiving the values from the sensor to our arduino via T pin. Once we have received the value at any particular point, we just need to check when the values cross a particular limit. As soon as the values cross a particular limit, we raise the alarm by sending high and low values to the 11 and 12 pin of arduino. A loop of 100 has been provided to make a wave which is sent to the speaker to bell the alarm.
if (num1>309999)
{ for(int j=0;j<100;j++)
{
digitalWrite(11,HIGH);
digitalWrite(12,LOW);
delay(100);
digitalWrite(12,HIGH);
digitalWrite(11,LOW);
delay(100);
}
Few points to Note:
The sensor usually gives the strength from 60 – 80 % due to its orientation and the spot where we place it. Try to keep the metal sensor exactly above your left eye. I have also applied salt water at my forehead for better connectivity to the sensor. The signal strength also disrupts about how we solder the wire to the T pin. Try to shield this wire and also make sure that the references probes are correctly connected.
If you have any wire connected to the EEG pin of the sensor, please disconnect that wire as that will create a lot of disturbance in the sensor values. Try this experiment and share your experiences with us. Next, we will be working on controlling an appliance using relay.
Project Source Code
###
//Program to// Arduino Brain Library - Brain Serial Test// Description: Grabs brain data from the serial RX pin and sends CSV out over the TX pin (Half duplex.)// More info: https://github.com/kitschpatrol/Arduino-Brain-Library// Author: Eric Mika, 2010 revised in 2014#include// Set up the brain parser, pass it the hardware serial object you want to listen on.Brain brain(Serial);//char a[400];String a,a1;int v = 0;int z=0,output;uint32_t num=0;uint32_t num1=0;void setup() {// Start the hardware serial.Serial.begin(9600);pinMode(12, OUTPUT);pinMode(11, OUTPUT);}void loop() {// Expect packets about once per second.// The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:// "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"if (brain.update()) {// Serial.println(brain.readErrors());// Serial.println(brain.readCSV());//sprintf(a, "%c",brain.readCSV());a = brain.readCSV();v = a.indexOf(',');v = a.indexOf(',',v+1);v = a.indexOf(',',v+1);v = a.indexOf(',',v+1);z = a.indexOf(',',v+1);a1 = a.substring(v+1,z);num = a1.toInt();v = a.indexOf(',',z+1);a = a.substring(z+1,v);num1 = a.toInt();//Serial.println(num);Serial.println(num1);if (num1>309999){ for(int j=0;j<100;j++){digitalWrite(11,HIGH);digitalWrite(12,LOW);delay(100);digitalWrite(12,HIGH);digitalWrite(11,LOW);delay(100);}}// analogWrite(12,output)//brain.readCSV().toCharArray(a,200);}}###
Circuit Diagrams
Project Video
Filed Under: Brainwave, Electronic Projects, Tech Articles, Tutorials
Filed Under: Brainwave, Electronic Projects, Tech Articles, Tutorials
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.