Controlling LED with your Brain Meditation using Brainwave Starter kit and Arduino platform

Call for Price

This step-by-step guide is intended to quickly get a typical Arduino board user up and running with the MindWave Mobile. This guide will show how to setup the HC-05 Bluetooth Module quickly for communication with the MindWave Mobile and gives example code to parse the output stream. The parsed output stream can then be used to perform various tasks such as to control the speed of a motor, to light up LEDs, and to control the position of a servo motor, etc.

SKU: Meditation-using-Brainwave-in-Arduino-MiniProject Category:

Description

Features

☞Interfacing the Mindwave Mobile with an Arduino board using HC-05 Bluetooth module

☞Acquiring the Meditation eSense values from the data stream.

☞LED controlled by Meditation level of mindwaves.

☞Display the Meditation levels in serial monitor.

Introduction

This step-by-step guide is intended to quickly get a typical Arduino board user up and running with the Mindwave Mobile. This guide will show how to setup the HC-05 Bluetooth module quickly for communication with the Mindwave Mobile and gives example code to parse the output stream. The parsed output stream can then be used to perform various tasks such as to control the speed of a motor, to light up LEDs, and to control the position of a servo motor, etc.

Demonstration Video

Required Materials

This application requires the following materials:

 

Hardware’s:

Mindwave Mobile Device

☞Arduino Board

HC-05 Bluetooth module

☞USB cable (for Arduino)

☞Connecting Wires.

☞Bluetooth dongle, if your computer does not have internal bluetooth capabilities

Software’s

☞Software’s

Project Materials

arduino-with-hc-05-and-mindwave-mobile

Connection Diagram

freeduino-with-hc-05-bluetooth-bee

Note: Keep the Rx (Pin1) line in Open connection

Steps to follow [Output at LED and Serial Monitor]

☞. Switch ON the Mindwave Mobile and unpaired the last connections, then OFF the Mindwave device.

☞. Program (Upload the sketch) the “Mindwave_Arduino_Meditation_LED_UART” source code to Arduino Board using Arduino compiler.

☞. Open the “Serial Monitor” in Arduino compiler with 57600 baudrate.

☞. Make all the connection as per the connection diagram, and then switch ON the Arduino Board.

☞. After the 7 Seconds when arduino board was ON, switch ON the Mindwave device.

☞. Now the Mindwave device and Arduino Board will pair automatically.

☞. Wear the Mindwave device in Head, and give the Meditation.

☞. Check the LED (D13) variation with respect your Meditation level.

☞. And also see the Serial Monitor to know your Meditation levels.

Steps to follow [Output at LED only]

☞. Switch ON the Mindwave Mobile and unpaired the last connections, then OFF the Mindwave device.

☞. Program (Upload the sketch) the “Mindwave_Arduino_Meditation_LED” source code to Arduino Board using Arduino compiler.

☞. Make all the connection as per the connection diagram, and then switch ON the Arduino Board.

☞. After the 7 Seconds when arduino board was ON, switch ON the Mindwave device.

☞. Now the Mindwave device and Arduino Board will pair automatically.

☞. Wear the Mindwave device in Head, and give the Meditation.

☞. Check the LED (D13) variation with respect your Meditation level.

Real View of Arduino with Mindwave Mobile

freeduino-with-hc-05-bluetooth-bee-2

Some Tips about Project

☞The Indication LED of Mindwave device glow continuously in blue color, when it’s paired with arduino HC-05 module.

☞If blue LED in blinking conditions means, it’s not pair with device.

☞The Mindwave Mobile and HC-05 module automatically paired, when we switch ON the both device.

☞Before sketch the program, you have to disconnect the Tx and Rx lines (Keep in Open connection).

 Output Details

The LED (D13) becomes ON, when you give High Meditation. It’s become OFF, when you give next High Meditation, like that every High Meditation you can change the state of LED.

Upload the sketch to Arduino board

upload-the-sketch-to-arduino-board-for-mind-meditation-using-arduino

Serial Monitor Output

serial-monitor-output-for-mind-meditation-using-arduino

Program for Mindwave_Arduino_Meditation_LED_UART

//                                                           //
//    Program       : Brainsense with Arduino                //
//    Interfacing   : HC-05 Bluetooth module                 //
//    Output        : LED Control using Meditation           //

#define BAUDRATE 57600
#define LED 13

byte payloadData[32] = {0};
byte Meditation[5]={0};
byte checksum=0;
byte generatedchecksum=0;
int  Plength,Temp;
int  Med_Avg=0,On_Flag=1,Off_Flag=0;
int  k=0;
signed int  j=0;


void setup() 
{
  Serial.begin(BAUDRATE);           // USB
  pinMode(LED, OUTPUT);
}

byte ReadOneByte()           // One Byte Read Function
{
  int ByteRead;
  while(!Serial.available());
  ByteRead = Serial.read();
  return ByteRead;
}

void loop()                     // Main Function
{
  while (1)
  {
    if(ReadOneByte() == 170)        // AA 1 st Sync data
    {
      if(ReadOneByte() == 170)      // AA 2 st Sync data
      {
        Plength = ReadOneByte();
        if(Plength == 32)   // Big Packet
        { 
          generatedchecksum = 0;
          for(int i = 0; i < Plength; i++) 
          {  
            payloadData[i]     = ReadOneByte();      //Read payload into memory
            generatedchecksum  += payloadData[i] ;
          }
          generatedchecksum = 255 - generatedchecksum;
          checksum  = ReadOneByte();
        
          if(checksum == generatedchecksum)        // Varify Checksum
          {             
            if (payloadData[30]==5)
            { 
              if (j<4)
               {
                 Meditation [k] = payloadData[31];
                 Temp += Meditation [k];
                 j++;
               }
               else
               {
                 Med_Avg = Temp/4;
                 
                 if (Med_Avg>80)
                 {
                   if(On_Flag==1)
                   {
                     digitalWrite(LED, HIGH);
                     On_Flag=0;
                     Off_Flag=1;
                   }
                   else if(Off_Flag==1)
                   {
                     digitalWrite(LED, LOW);
                     On_Flag=1;
                     Off_Flag=0;
                   }
                 }
                 j=0;
                 Temp=0;
               }
            }
           } 
         }
       }
     }         
   } 
}

Reference Documents Links

Interfacing Mindwave Mobile with Arduino

Reference Video Links

Interfacing Mindwave Mobile with Arduino

Configure HC 05 Bluetooth Module

Find the Mindwave IP address

Getting Started with Mindwave Mobile Using MATLAB

Additional information

Weight 0.100000 kg

Reviews

There are no reviews yet.

Be the first to review “Controlling LED with your Brain Meditation using Brainwave Starter kit and Arduino platform”

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.