Friday, September 4, 2015

Logbook 9/4

We have split up into sections; Mustafa and Mario are working on getting the TGAM chip which we harvested out of the MindFlex toy to work. It seems like the chip is very sensitive to voltage differences and bad ground.

http://store.neurosky.com/products/mindflex












We know the chip is good because we previously tested it using the toy. There is a ‘game board’ with a fan which runs at a variable speed based on your brain patterns, when you take the headset off or don’t connect it on your head right, the panel voices outloud “CHECK HEADSET”

Mario and Mustafa are trying to get the game to work using our electrodes. Since we disassembled it, using the original electrodes doesn’t even seem to work anymore. When monitoring the serial output from the chip, it reads  “200, 0, 0”. From the TGAM datasheet we know that the 200 indicates a too weak EEG signal.


Luckily, I ordered two of these Mindflex games so I am using the spare one to work on the code that will analyze the brainwaves. With the second game, I did not disassembl the headset, but just soldered in two wires for Tx and Gnd as to get the serial brainwave data. Originally I connected these to an Arduino and attempted to echo the data to the usb serial interface that comes with all Arduinos. Oddly enough…….. as soon as you connect the Arduino the “CHECK HEADSET” error reappears. I tried powering the Arduino with a 9V battery rather than the usb port, and the headset made the connection to the game board okay. When I connected the usb cable to capture the data…… the connection dropped and the game board once again went into “CHECK HEADSET” mode. I tested plugging and unplugging the Arduino to see the results, and it seemed that the brain connection would be lost everytime I plugged it in, but the connection was re-established when I disconnected the cable. My conclusion was that there must be some uncommon ground error between the TGAM chip and the laptop, perhaps we can fix Mario and Mustafa’s problem by checking their ground lines and powering their Arduino from a battery as well.

Our final product does not need to be connected to a computer, all brainwave processing will be done onboard with the Arduino. However, for testing we need to know what the thresholds of sleep brainwaves are, so I used a Bluetooth module to send the data out over wirelessly. It worked!



/* Echo Serial data to bluetooth */ 
#include <"softwareserial.h"> 

 SoftwareSerial mySerial(6, 7); 
 // RX, TX to TGAM 
//dedicated Tx and Rx to bluetooth 
 void setup() 

 // Open serial communications and wait for port to open: 
 Serial.begin(9600); // set the data rate for the SoftwareSerial port 
 mySerial.begin(9600); 


 void loop() 

// run over and over 
 while(mySerial.available()) 
 { 
 Serial.write(mySerial.read(); 
 Serial.println(); 
 } 
}

No comments:

Post a Comment