Introduction: Mindvoice

Difficulty of Communication in dumbed people.To improve their life style we use their thought to communicate.To achieve this goal we use Brain computer interface(BCI).

Step 1: Block Diagram

*Block consist of 2nd section
*1st is sensing unit 2nd is Processing unit
*1st one is neurosky mindwave
*2nd one is aurdino uno

Step 2: Flowchart

Step 3: Circuit Diagram

Aurdino to HC-05
*TXD - - - RXD
*RXD - - - TXD
*GND - - - GND
*5V - - - 5V

Aurdino to aux
*PWM (3) - - - +ve
*GND - - - - GND

Aurdino to led
*13 - - - +ve
*GND - - - GND

Step 4: Hardware Required

*NeuroSky (mindwave headset).

* Arduino Board(processing unit).

* Output devices(speakers).

* HC -05 (Bluetooth module).





Step 5: Software Tools Required

*Arduino IDE
* EEG analyzer

Step 6: Configuration of HC-05

.HC -05 configure as master mode.
.Mindwave Kit act as slave device.
Step :1
Connection overview:
Aurdino to HC-05
*VCC---VCC
*GND---GND
*TXD---TXD
*RXD---RXD
*3V ---EN
Step:2
If connection established press the button in HC-05 and plug the USB cable to computer so the HC-05 gose to programming mode and it stop blinking Continuesly
Step :3
After this you need to open the serial monitor on aurdino IDE then type AT command given below

Step:4
*Commands:
* AT+UART=57600,0,0
* AT+ROLE=1
* AT+PSWD=0000
* AT+CMODE=0
* AT+BIND= ( 1234,56,ABCDEF )
* AT+IAC=9E8B33
* AT+CLASS=0
* AT+INQM=1,9,48
We get the address from the neurosky console
"A sticker is on the neurosky backside"

Step 7: After Configuration of HC-05 Connect the Components by the Circuit in Step:3

Aurdino to HC-05
*TXD - - - RXD
*RXD - - - TXD
*GND - - - GND
*5V - - - 5V

Aurdino to aux
*PWM (3) - - - +ve
*GND - - - - GND

Aurdino to led
*13 - - - +ve
*GND - - - GND

Step 8: Code for Aurdino IDE



#define LED 13
#define BAUDRATE 57600
#define DEBUGOUTPUT 0

#define GREENLED1 3
#include "talkie.h"

Talkie voice;
const uint8_t spHELLO[] PROGMEM ={0x00,0xC0,0x80,0x60,0x59,0x08,0x10,0x3D,0xB7,0x00,0x62,0x64,0x3D,0x55,0x4A,0x9E,0x66,0xDA,0xF6,0x56,0xB7,0x3A,0x55,0x76,0xDA,0xED,0x92,0x75,0x57,0xA3,0x88,0xA8,0xAB,0x02,0xB2,0xF4,0xAC,0x67,0x23,0x73,0xC6,0x2F,0x0C,0xF3,0xED,0x62,0xD7,0xAD,0x13,0xA5,0x46,0x8C,0x57,0xD7,0x21,0x0C,0x22,0x4F,0x93,0x4B,0x27,0x37,0xF0,0x51,0x69,0x98,0x9D,0xD4,0xC8,0xFB,0xB8,0x98,0xB9,0x56,0x23,0x2F,0x93,0xAA,0xE2,0x46,0x8C,0x52,0x57,0x66,0x2B,0x8C,0x07};
const uint8_t spHELP[] PROGMEM ={0x08,0xB0,0x4E,0x94,0x00,0x21,0xA8,0x09,0x20,0x66,0xF1,0x96,0xC5,0x66,0xC6,0x54,0x96,0x47,0xEC,0xAA,0x05,0xD9,0x46,0x3B,0x71,0x94,0x51,0xE9,0xD4,0xF9,0xA6,0xB7,0x18,0xB5,0x35,0xB5,0x25,0xA2,0x77,0xB6,0xA9,0x97,0xB1,0xD7,0x85,0xF3,0xA8,0x81,0xA5,0x6D,0x55,0x4E,0x0D,0x00,0xC0,0x00,0x1B,0x3D,0x30,0x00,0x0F};

#define powercontrol 10

// checksum variables
byte generatedChecksum = 0;
byte checksum = 0;
int payloadLength = 0;
byte payloadData[64] = {
0};
byte poorQuality = 0;
byte attention = 0;
byte meditation = 0;

// system variables
long lastReceivedPacket = 0;
boolean bigPacket = false;

//////////////////////////
// Microprocessor Setup //
//////////////////////////
void setup() {

pinMode(GREENLED1, OUTPUT);
voice.say(spHELLO);
voice.say(spHELP);


pinMode(LED, OUTPUT);
Serial.begin(BAUDRATE); // USB

}

////////////////////////////////
// Read data from Serial UART //
////////////////////////////////
byte ReadOneByte() {
int ByteRead;

while(!Serial.available());
ByteRead = Serial.read();

#if DEBUGOUTPUT
Serial.print((char)ByteRead); // echo the same byte out the USB serial (for debug purposes)
#endif

return ByteRead;
}

/////////////
//MAIN LOOP//
/////////////
void loop() {


// Look for sync bytes
if(ReadOneByte() == 170) {
if(ReadOneByte() == 170) {

payloadLength = ReadOneByte();
if(payloadLength > 169) //Payload length can not be greater than 169
return;

generatedChecksum = 0;
for(int i = 0; i < payloadLength; i++) {
payloadData[i] = ReadOneByte(); //Read payload into memory
generatedChecksum += payloadData[i];
}

checksum = ReadOneByte(); //Read checksum byte from stream
generatedChecksum = 255 - generatedChecksum; //Take one's compliment of generated checksum

if(checksum == generatedChecksum) {

poorQuality = 200;
attention = 0;
meditation = 0;

for(int i = 0; i < payloadLength; i++) { // Parse the payload
switch (payloadData[i]) {
case 2:
i++;
poorQuality = payloadData[i];
bigPacket = true;
break;
case 4:
i++;
attention = payloadData[i];
break;
case 5:
i++;
meditation = payloadData[i];
break;
case 0x80:
i = i + 3;
break;
case 0x83:
i = i + 25;
break;
default:
break;
} // switch
} // for loop

#if !DEBUGOUTPUT

// *** Add your code here ***

if(bigPacket) {
if(poorQuality == 0)
digitalWrite(LED, HIGH);
else
{
if (poorQuality == 54)
voice.say(spHELLO);
else{}
if (poorQuality == 200)
digitalWrite(LED, HIGH);
else{}
}


digitalWrite(LED, LOW);
Serial.print("PoorQuality: ");
Serial.print(poorQuality, DEC);
Serial.print(" signal strenght: ");
Serial.print(attention, DEC);
Serial.print(" meditation: ");
Serial.print(meditation, DEC);
Serial.print("\n");
switch(meditation/10) {
case 1:

break;
case 2:


break;
case 3:

break;
case 4:

break;
case 5:

break;
case 6:

break;
case 7:

break;
case 8:

voice.say(spHELP);
break;
case 9:

break;
case 10:

break;
}

switch(attention / 10) {
case 0:

break;
case 1:
digitalWrite(LED, HIGH);
break;
case 2:
digitalWrite(LED, HIGH);

break;
case 3:
digitalWrite(LED, HIGH);
break;
case 4:
digitalWrite(LED, HIGH);

break;
case 5:
digitalWrite(LED, HIGH);
break;
case 6:
digitalWrite(LED, HIGH);
break;
case 7:
digitalWrite(LED, HIGH);
break;
case 8:

voice.say(spHELP);
break;
case 9:
digitalWrite(LED, HIGH);
break;
case 10:
digitalWrite(LED, HIGH);
break;
}
}
#endif
bigPacket = false;
}
else {
// Checksum Error
} // end if else for checksum
} // end if read 0xAA byte
} // end if read 0xAA byte
}
Arduino Contest 2019

Participated in the
Arduino Contest 2019