Using brain waves to emit alarm
SUMMARY
Previously in the brainwave series, we used GSM with brainwaves to detect whether a person is sleeping. The same experiment can be extended further with a different perspective. Now in this article, I am planning to explore more applications of Brainwaves .
These days I'm trying to meditate to stay calm. Since meditation helps a person in so many ways, I thought of trying it out and it proved to be very helpful. However, as I meditated, I noticed that I couldn't guess how well I was doing in meditation. As a result, I decided to use brainwaves to develop a device that could inform me if I reached a certain level. It may also be useful for practitioners and meditators in the future.
Fig. 1: Image showing the level of meditation detected using the brainwave sensor
DESCRIPTION
you know we are getting the values of all types of brain waves from our Arduino, here our task is just to find the wave which is most affected by meditation. Now the alpha waves show us again many variations according to our meditation. So, first we check the alpha wave values at different alert levels. I tried my level of meditation and then recorded them for testing purposes.
Fig. 2: Image showing the level of meditation detected using the brainwave sensor
When testing on myself, I found that the alpha wave values crossed 2 Lacs very rarely and only when my concentration was highest. So I set the level to 2 Lacs in my Arduino coding. This value can be defined from person to person. As the values of mindflex range from 1Lac to 7 Lacs, so we set a level at 2 Lacs and whenever the values were higher than that we started sending signals to the speaker in order to output a sound.
Fig. 3: Block diagram of meditation level detector based on MindFlex brainwave sensor
Hardware:
Please find the attached circuit diagram of the connections we need to establish. We take a pin from the T pin of the mindflex sensor and connect this pin to the Rx pin of our Arduino UNO. Additionally, we short-circuited the Sensor and UNO ground by a wire. Take special care when soldering anything to the Mindflex sensor, as the pins are very close to each other. After that, we connect the 11th and 12th pins to a small 4ohm speaker.
Software:
Let's move on to the software part. We have been receiving the values from the sensor to our arduino via T-pin. Once we receive the value at any specific point, we just need to check when the values cross a certain threshold. As soon as the values exceed a certain limit, we trigger the alarm by sending high and low values to pins 11 and 12 of the Arduino. A 100 loop was provided to make a wave which is sent to the speaker to sound the alarm.
if (num1>309999)
{ for(int j=0;j<100;j++)
{
digitalWrite(11,HIGH);
digitalWrite(12,DOWN);
delay(100);
digitalWrite(12,HIGH);
digitalWrite(11,DOWN);
delay(100);
}
Some points to note:
The sensor typically provides 60 to 80% resistance due to its orientation and where we place it. Try to keep the metal sensor exactly above your left eye. I also applied salt water to my forehead for better connectivity with the sensor. The signal strength also messes with how we solder the wire to the T pin. Try shielding this wire and also make sure the reference probes are connected correctly.
If you have any wire connected to the EEG pin of the sensor, disconnect that wire as it will create a lot of disturbances in the sensor values. Try this experience and share your experiences with us. Next, we will work on controlling a device using a relay.
Project source code
###
//Program to// Arduino Brain Library - Serial Brain Test
###
Circuit diagrams
Circuit-Diagram-MindFlex-Brainwave-Sensor-Meditation-Level-Detector |