Introduction: Mindflex EEG With Raw Data Over Bluetooth

Picture of Mindflex EEG With Raw Data Over Bluetooth

The Mindflex (and Mindflex Duel--the relevant hardware is supposed to be the same) toy lets you control the height of a ball with mental concentration. I will explain how to attach a $3 Bluetooth module to make this into a full-functioned Bluetooth EEG headset with raw data output that should be usable with most apps that supports the Mindwave Mobile EEG headset (the Mindflex uses basically the same ThinkGear chip that the Mindwave Mobile does). Since you can get Mindflex headsets on ebay for $15 or less, that means the cost of the project can be as low as $18.

With the raw data, you can also capture ECG images of heart activity, though you need to be particularly careful, especially being careful that the device not be connected to the mains, as the heart is very sensitive to small electrical currents.

There are many EEG projects based on the Mindflex toy on Instructables (here's one, here's another and here's another) and elsewhere. What makes this one different?

  • No Arduino, just a simple Bluetooth module (cheaper, simpler). (Full disclosure: You will need a second TTL serial link to set the baud rate on the HC-06, and you can use an Arduino for that, but you can also use a second HC-06 module, a Brainlink device, a USB-to-TTL-serial link, etc.)
  • Powered from the headset's own batteries.
  • No need for SMD soldering to enable raw output mode, and the modified device should still work as the toy.
  • Compatible with Mindwave Mobile apps (with simple initialization app).

Disclaimer: Anything electrical hooked up to your head (or heart--you can use this for heart monitoring) is potentially risky. Don't use it if you have cuts where the electrodes go as that can decrease skin resistance. USE AT YOUR OWN RISK. That said, the project is only powered by three AA batteries. This is not a medical diagnostic or treatment device.

What you need?

  • Mindflex headset, either from the original toy or from the Mindflex Duel (doesn't matter which one).
  • Bluetooth-to-TTL-serial module. My instructions will assume that this is an HC-06 module. Plenty of those on Amazon. Get one with cables to save some work. Make sure your module can be powered by the 4.5V DC input that powers the Mindflex.
  • A device that can do 9600 baud TTL serial output. This can be a second HC-06 module, a USB-to-TTL-serial link, an Arduino or a Brainlink (I used a Brainlink). This is not a part of the finished project but is needed once to set the baud rate on the HC-06 module. (If you use a more expensive RN-42, you may be able to configure it via Bluetooth.)
  • Soldering iron, solder, miscellaneous wires, electrical tape.

Acknowledgments: I got the idea for stuffing the BT module inside the Mindflex headset from this Instructable. I then edited the Instructable to reflect this, since it was a great idea.

Step 1: Some Background

Picture of Some Background

Feel free to skip this background, but it explains why some things are done as they are. For safety, EEG headsets need to be isolated from anything plugged into mains. The Mindflex, Mindwave Mobile and a number of other EEG headsets use a ThinkGear ASIC chip. This chip communicates over TTL serial with a radio, and the radio in turn communicates with other devices, like the Mindflex toy base station. This isolates the headset electrically.

Unfortunately, while the Mindwave Mobile's radio is Bluetooth, the Mindflex toy uses some other kind of radio. To use the Mindflex EEG with other devices, we will simply connect the ThinkGear chip's receive and transmit lines to an HC-06 Bluetooth radio (about $10 with cables).

Well, maybe not quite so simple. While that's all that's needed in terms of hardware, there is a software challenge. The ThingGear ASIC has several modes of operation. As embedded in the Mindflex toy, an SMD resistor sets it to mode 0x01 by default. In mode 0x01, the chip transmits at 9600 baud, and sends processed data every second: Meditation, Concentration and values for various parts of the power spectrum, presumably derived by an FFT. But we want to have access to the raw EEG data. This requires switching the Mindflex headset to mode 0x02. In mode 0x02, the chip transmits at 57600 baud, and in addition to the same once-per-second update that it does in mode 0x01, it sends raw differentially amplified EEG sensor data 512 times per second. This is the mode in which the Mindwave Mobile headset functions by default, so if you can switch the headset to this mode, not only do you get raw data, but you should be able to use it with all Mindwave Mobile compatible apps.

One can switch the Mindflex to mode 0x02 with some SMD soldering work, but I am terrible at soldering (as you'll see in later pictures), so that's not an option for me. Also, that solution makes the headset no longer work with the rest of the toy, and I don't like breaking things.

Fortunately, the communications protocol for the ThinkGear chip allows you to switch to mode 0x02 very simply by sending 0x02 to its serial receive line. While this doesn't survive powercycling, nonetheless it should make things simpler: just make sure the receive line of the chip is connected to the Bluetooth radio's transmit line, and send 0x02. But there is a hitch. The 0x02 has to be sent at 9600 baud, while the subsequent data will be at 57600 baud. And unfortunately there is no way to control the HC-06 Bluetooth radio's baud rate dynamically in use.

But there is a solution that surprisingly works. 9600 = 57600 / 6. If you could just send a bit six times at 57600 baud, that would be the same as sending it once at 9600 baud. The only hitch is that when sending things via RS232 serial or its TTL variant, you don't get to control each bit. Instead, assuming the usual 8N1 communications setting, the bits are packaged into bytes, with each byte starting with an extra 0 "mark" but and ending with an extra 1 "stop" bit. The mark and stop bits are out of our control. But we can work around this. It turns out that if we send the hex string 0x00, 0xF8, 0x00, 0x00, 0x00, 0xE0 at 57600 baud and then pause for at least the length of a 9600 baud bit (a millisecond will be more than enough; idling is the same as sending 1's in the RS232 protocol), that's like sending 0x02, with four glitches (and some extra zeroes up front), each glitch being 1/6 of a bit in length. If we're lucky, the 9600 baud receiver will ignore the short glitches. And somewhat surprisingly it works! The chip switches to mode 0x02, starts transmitting at 57600 baud, and all is well. In fact, with the HC-06 as the transmitter it works 100% of the time (using a Brainlink, it sometimes requires a retry).

So there are three components to the project:

I. Set the HC-06 Bluetooth radio to 57600 baud. This setting survives powercycling. This is cumbersome but needs to be done only once.

II. Solder connections to the headset to connect it to the HC-06 radio.

III. Make sure that the headset goes to mode 0x02 by sending the magic hex string (or some variant on it) at 57600 baud. This could be done by building the magic string into EEG software, or by writing a simple program that sends the magic hex string to the device, and then the device can be used with any software compatible with the Mindwave Mobile. I did both: I wrote some EEG software in Java that can be run on a PC (probably also Mac and Linux but I haven't tested it there) and that sends the magic string before display the raw and processed data, and I made a simple Android app that simply sends the magic string (or a variant on it) at 57600 baud and activates the Mindwave Mobile compatible mode. Both programs are open source.

Step 2: Part I: Set Bluetooth Module to 57600 Baud

Picture of Part I: Set Bluetooth Module to 57600 Baud

You need to configure your Bluetooth module to 57600 baud. The instructions below are for the HC-06. If you have an HC-05 or RN-42, you can find instructions elsewhere online.

To set the HC-06 Bluetooth module's baud rate to 57600, you just need to send AT+BAUD7 (without anything else--no CR, no LF) to the module over the serial link, when the module is in command mode. It's very easy to put the HC-06 in command mode: just power it up, and make sure nothing is connected to it via Bluetooth. In command mode, the HC-06's LED is flashing.

So to change the baud rate from the default of 9600 baud, you need to power up the module, connect it to some other device that can send serial data at 9600 baud, and send the AT+BAUD7 command.

You can power the module by connecting it to the Mindflex's battery pack. Just squeeze jumpers between the battery and the terminal at the two ends of the three AAA sequence in the pack, connect the minus end to the GND terminal marked on the Bluetooth module and the plus end to the VCC terminal on it. (Make sure you don't reverse it.) The female terminals on the cable that you can get with the module will help. If all works well, the LED on the module will flash.

After having checked that you can power up the module, disconnect it from power.

You now need a computer and another device that can allow the computer to transmit TTL-level serial data at 9600 baud. A second HC-06 should do the job, but the simplest is probably a USB-to-TTL-serial adapter. I used a Brainlink device myself, which has a built-in battery that I also used to supply power to the HC-06. Make sure that whatever device you use runs at TTL levels, rather than at the higher voltage of RS232 serial.

You can also use an Arduino with a simple sketch that sends the AT+BAUD7 command (cf. the sketch here).

Connect the transmit line on your second serial device to the RXD line on the HC-06 you are configuring. Connect the ground line on that device to the HC-06 GND and the negative end of the power supply. To verify that the change has taken place, connect the receive line on your serial device to the TXD line on the HC-06. Power up both devices as needed.

Now connect your computer to your second serial sevice, but NOT your HC-06, and connect to the second serial device with a terminal emulator at 9600 baud (PuTTY and RealTerm work well on Windows). Type AT very quickly, but do not press return. If all is well, you will see an OK within a second or two. Otherwise, the connection isn't working.

Then you need to send AT+BAUD7 probably faster than you can type. To do that, type it in another window, and then copy and paste into the terminal (make sure you do not copy and paste any space or end-of-line character at the end of it). Or, if you're using RealTerm, you can just just go to the Send tab, type it in the blank, and press "Send ASCII."

You may want to rename the module to "Mindflex" if you like by sending AT+NAMEMindflex (again without any end of line characters), again faster than you can type.

The exact way you do the above depends on just what second serial device you have. Here are precise directions for the Brainlink device I used. First, upgrade the Brainlink device to my custom firmware which makes serial connections easier and better. The easiest way to do this is to use this Android app and connect to the Brainlink via Bluetooth. The app contains full instructions. Alternately, you can follow the instructions here and download my custom firmware from here (where you'll also find the source code for the Android app and the firmware). Then make the following connections (oddly the Brainlink ports seem to be numbered right-to-left) with the Brainlink turned off:

  • Brainlink 10-pin port, pin 3 (blue, +5V) to VCC on HC-06
  • Brainlink 8-pin port, pin 8 (black, ground) to GND on HC-06
  • Brainlink 8-pin port, pin 7 (yellow, serial TX) to RXD on HC-06
  • Brainlink 8-pin port, pin 6 (green, serial RX) to TXD on HC-06.

Ensure other exposed wires don't touch.

Connect the Brainlink to a terminal emulator on your computer via Bluetooth. You should see a sequence of "BL" characters. Type an asterisk (*). The BL's should stop going. Then quickly type u96Z to switch to 9600 baud serial bridge mode. (If you type the u96 part too slowly, you'll get an error.) Now, you can do the AT and AT+BAUD7 commands.

Step 3: Part IIa: Solder Wires to Mindflex Circuit Board

Picture of Part IIa: Solder Wires to Mindflex Circuit Board

Remove the batteries from the Mindflex.

Open the Mindflex circuit box. This is the white unit with the power switch, not the one with the batteries. There are four screws. Then remove the two screws from the circuitboard inside. Make sure you don't lose the white power switch cover.

There is a main circuitboard and two daughterboards inside. I believe the smaller one is the non-Bluetooth radio. I've read online that you can save some battery life by removing it, but of course then you can't use the toy anymore. The bigger daughterboard contains the ThinkGear EEG ASIC.

Find four jumper wires that aren't so thin they're fragile but are thin enough that you can solder them where space is tight. Ideally, all four should be different colors. Otherwise, you might mark patterns on them with a marker so you don't get them confused.

Solder two of to the marked R(eceive) and T(ransmit) pins on the ThinkGear daughterboard. See the photo of the daughterboard. In my project, the yellow wire goes to Transmit and the orange to Receive.

I am poor at soldering. When I was soldering the R pin, I shorted it to another and had to cut through the solder. You will see other artifacts of my poor technique in the photos. Do a better job, but what I did works.

The third wire (brownish-purple in my photo) will need to go to the ground connection on the underside of the main board, and the fourth (light gray) will need to go to a switched +4.5V pin under the switch (the middle of the three switch pins).

Write down which colors you used for Receive, Transmit, Ground and switched +4.5V.

Tuck the two underside wires into the hole near the ground wire so you can pull them up. Screw the circuitboard back in place.

Knot all four wires together for pressure relieve, and enlarge the hole that the ear clip wire went through (a hot soldering iron will do that really well). Then put all the five wires--ear clip and the four new ones--out the hole, keeping the knot inside (in the photo, the ear clip knot is outside), and screw on the cover.

Step 4: Part IIb: Connect Wires to Bluetooth Module

Picture of Part IIb: Connect Wires to Bluetooth Module

The cable my HC-06 module came with had a single four-pin female connector on one end and four separate one-pin female connectors on the other end. I cut off the four one-pin connectors with about an inch of wire, and soldered the wires to the four new wires sticking out of the Mindflex circuit box. I insulated the connections with electrical tape and heat shrink tubing.

The wires need to be connected as follows:

  • Mindflex T pin - Bluetooth RXD
  • Mindflex R pin - Bluetooth TXD
  • Mindflex ground - Bluetooth GND
  • Mindflex switched +4.5V - Bluetooth VCC.

I taped the T, R and ground female connectors together to form a single three pin connector, so I could more easily turn off the radio by just pulling the VCC connector for when I want to use the headset as part of the toy.

In my initial build, I taped the Bluetooth module to the outside of the case.

Step 5: Part IIIa: Software (Android)

Picture of Part IIIa: Software (Android)

I've found connecting Bluetooth devices to my phone (Galaxy S3) to be more straightforward than connecting them to my PC. My Bluetooth module took a couple of attempts to pair (PIN 1234), but once paired works great with my phone.

You can now install my free Mindflex to Mindwave Mobile app, turn on the Bluetooth on the phone, turn on the Mindflex headset together with its Bluetooth module, and press "Activate" in the app. This sends the magic hex sequence that puts the Mindflex in raw mode compatible with Mindwave Mobile software. If it fails the first time, try again. Once you've activated it, the mode should keep on running until the device is turned off.

You can search Google Play for Mindwave apps. These apps should see the Mindflex once it's in raw mode. I did a lot of my testing with the official Brainwave Visualizer app.

The headset's main electrode goes on the forehead, and the clips go on earlobes. Kind of like the horse is doing, except it doesn't have earlobes. My kids have earlobes, but I don't want to post their pictures. Avoid using it over cuts (the resistance will go down and any electrical danger level will go up).

It shouldn't be hard to make an iOS app equivalent to my Mindflex to Mindwave Mobile app.

Step 6: Part IIIb: Desktop Software

Picture of Part IIIb: Desktop Software

I am mainly a mobile developer, and this was my first time doing GUI stuff with Java, but I wrote Brainflex, a simple visualizer for both the power spectrum analysis and the raw data. It's rather rough around the edges, and you need to know which serial (COM on Windows) port number your Bluetooth module connects to. (On Windows 8, you can open Devices and Printers, right click on on the Bluetooth module after pairing, and look at Services. If more than one port is listed, you want the outgoing one).

Install java. Install the jar file from the above link. Launch the jar file. Choose "57600 baud Bluetooth-serial bridge + Mindflex" as the mode. Fill in the serial port and press Go. If it exits immediately, it failed to connect. Try again. Three windows (raw, processed and log) will open. You can pause and scroll and resume.

Once you start the raw mode display, you can exit Brainflex, and the headset will stay in raw mode, and you should be able to use it with any Mindwave Mobile compatible software until it's turned off.

You can troubleshoot by connecting to the port via RealTerm and putting RealTerm's display in hex mode. If all is well, you will see plenty of scrolling of (512 per second) records starting with AA AA 04 FF 80.

Step 7: Optional: Stuffing Bluetooth Module Inside

Picture of Optional: Stuffing Bluetooth Module Inside

In my initial Instructable, the Bluetooth module was on the outside. Then I saw this great Instructable where they stuff the module inside, so I did that, too. :-) The down side of this is that I can't unplug the power from the module when the headset is being used as a toy. This doesn't interfere with the toy, but it does use up more battery life.

When stuffing, make sure you cover all contacts with electrical tape to avoid shorts, though I did keep the antenna on the module exposed, and made sure to place it facing the outside, where there were no other electrical parts.

I am somewhat worried about heat issues with extended use. If it feels too warm, I guess I can move it back out.

Step 8: Alternative: Using Brainlink in Place of HC-06

Picture of Alternative: Using Brainlink in Place of HC-06

If you're one of the lucky few people to have a Brainlink device (hardware information here; SurplusShed sells them for $39, but has periodic 30-50% off on everything sales), you can use it entirely in place of the HC-06. Just connect the Brainlink's serial receive line to the Mindflex T pin, the serial transmit line to the Mindflex R pin, and ground to ground. The Brainlink has its own power supply. If you install my custom backwards compatible firmware (see the end of the Part I step above) on the Brainlink, then it will automatically switch to 57600 baud serial when the magic hex string is being sent through. You can also use the specialized Brainlink mode in Brainflex.

Using the Brainlink is probably slightly more dangerous as instead of just ~5V volts to play with, you now have two ~5V sources. I guess you could try to power the Mindflex from the Brainlink. I am not sure the Brainlink can handle the current, though.

Step 9: Sample Data

Picture of Sample Data

There has been some discussion on the Internet whether the Mindflex EEG unit is a fake. So here is some data to validate things.

Image 1: Raw data from the unit mounted correctly on the forehead, with me blinking my eyes and wiggling my ears.

Image 2: Raw data from the unit touching the chest around the heart. (Using aluminum foil attached to the ear clips as an electrode. I think I had both clips connected to the same piece of foil, which isn't ideal. You need to be particularly careful, especially being careful that the device not be connected to the mains, as the heart is very sensitive to small electrical currents.)

Image 3: Raw data from the unit connected to my knee. (This is in response to a comment responding to another Instructable and claiming that the unit is fake because it gets signal from the knee.) The big waves are due to my straightening the knee, and show a nice capture of the electrical potentials from muscle movement.

Image 4: Processed power spectrum data taken while I was writing a chapter of a technical philosophy book in LaTeX on my laptop.

Image 5: Processed power spectrum data taken while I was taking care of a toddler.

While I don't know exactly what to make of Images 4 and 5, there are clear differences between them. Unfortunately, Image 4 suffers from EM noise due to the fact that I was typing on my laptop.

Comments

MattS60 (author)2017-08-30

Hey There! I have a simple question, can i make my own app using app inventor 2,to read the Bluetooth data it receives from the module directly?then use it to make commands(spoilers ; ), because you said(under the horse picture) that the mindflex app(in general) changes the headset into raw mode, what does that mean for my simple ai2 Bluetooth readings? do i not get anythin if i dont put it in raw? or do i still get data (ex:4886à6_25_6, or watever, per single brain activitiy) that my app receives and can then change into a command? thanks you got me really wondering with that little statement and i appreciate help!

JohnM1313 made it! (author)2017-04-22

Hi Arpruss, Thanks a lot for compiling such a nice instructable. I started working on the project based on other instructables with Mindflex, but it turned out that not all the information was very clear, and there are still many more questions in their blogs for people struggling making it work. For everyone that is working in this project I want to share the main difficulties and lessons learned:

1- It's a must to set up the HC-06 to 57,600 Baud rate. I used the setup with Arduino Uno.

2- While doing the HC-06 setup, please change the name to "/Dev/tty.MindWaveMobile-SPPDev" or "/Dev/tty.MindSet-DevB". This is in case you want to use BrainWave visualizer software. I didn't try this, but those are the only options to select when pairing the MindFlex to MindWave.

3- Wire the receive signal to the Mindflex board. Other tutorials don't require wiring this port but it's the key to switch the Mindflex headset to mode 0x02.


  • Wire: TXD on HC-06 to MindFlex R pin.

4- Turn Mindflex into mode 0x02. This is done with the software, just make sure you did step 3.

5- Order the HC-06 with wires. It's very time consuming to work around those pins without the wires.

6- I run this project on Mac. Arpruss stated: "I wrote EEG software in Java that can be run on a PC (probably also Mac and Linux but I haven't tested it there)". It works perfect in Mac! I'm running it on MacOS Sierra.

Thanks a lot for this great Instructable.

John

CheamJ (author)2017-04-12

hi i would like some help in obtaining data of mindflex to my arduino mega through bluetooth. i have attach a BT mudule (HC-05) at my minflex and a BT module(HC-06) at my arduino with baudrate 9600. i have obatain the data in in bytes.

problem: i want to separate my data and obtain only the attention wave data in decimal.

arpruss (author)CheamJ2017-04-12

Have you looked at the protocol spec from Neurosky?

CheamJ (author)arpruss2017-04-15

i have solved it, i am able to communicate with the mindflex through bluetooth with arduino, i am also able to separate the data by using the mindflex library.

thanks for the reply.

noamananwaar (author)2017-03-31

HI,

i have hc05 bluetooth module and neurosky mindwave black headset i need help in connecting headset with hc05 and get data can you please help

arpruss (author)noamananwaar2017-03-31

You'll have to look up how to set the baud rate on the hc05 and otherwise just follow my instructions.

noamananwaar (author)arpruss2017-03-31

Thanks love you. Solved my problem

noamananwaar (author)arpruss2017-03-31

thnaks love you. you solved my problem

audio100 (author)2016-12-22

Hey, thank you for this great project. I made it and it works - kinda...

I have 2 questions...

1. It connects to Android and works. But my Windows 8.1 machine doesn't even see the Mindflex when it searches to Bluetooth devices, never mind connecting to it... My Mac connects to it, but the Mindwave Visualizer doesn't see the connected headset. Any ideas how to make it work either on Windows or Mac? I don't care which one, I'd just like to use Visualizer on the desktop (I only have an Android phone, too small - I don't have an Android tablet).

2. Since the Mindflex headset is large, heavy and uncomfortable, I was wondering if I could separate the sensors and the electronics. I would like to have the electronics sit next to me on the table and run wires to a comfy, lightweight fabric headband and ear clips.

Would this work? Would it affect the quality of the signal?

Thank you!

rlong192002 (author)audio1002017-03-08

With just the TGAM module desoldered from the headset, the HC06 module, USB lipo charger module, battery and switch, you can make a Zeo replacement what works wonderfully, and is small, light and comfortable to wear.

https://plus.google.com/u/0/collection/s6HbeB

arpruss (author)audio1002016-12-23

1. Sounds like a Windows issue with communicating to your HC-06. Maybe your Bluetooth driver doesn't support the serial profile?

2. I would be worried about signal degradation in longer cables from the electronics to the electrodes.

audio100 (author)arpruss2016-12-25

Thank you for your reply. Just one more question (since I use a Mac most of the time, I only have Windows computers for special projects like this): how do I fix the Windows Bluetooth driver issue you mention? I was not aware that Windows required separate Bluetooth drivers to support the serial profile, it never occurred to me that such a basic thing wouldn't be built in to the OS... So if I have to install something to make it work, what is it?

arpruss (author)audio1002016-12-25

The cheap Bluetooth dongle I bought on ebay for a couple bucks worked out of the box with Windows 8.1... You can google for more Bluetooth drivers, I guess.

AyushP2 (author)arpruss2016-12-24

I tested my device with a bluetooth, new module this time and it doesn't work with any device, why is this problem persisting, before modding, the headset worked with its board game.

arpruss (author)audio1002016-12-22

Maybe it's paired with your Android device, and that's why the Windows device doesn't see it?

Does your Windows device see the HC-06 unit when it's not hooked up to the Mindflex?

audio100 (author)arpruss2016-12-22

Thanks - Bluetooth was only turned on on one device at a time to exclude that possibility. Even if the Windows 8.1 machine is the only one with Bluetooth on (and in pairing mode), it doesn't see the unit.

I'm not sure if Windows would see the HC-06 when not hooked up to the Mindflex - I tucked it inside the case pretty tight and I don't want to take it apart since it works and everything in nicely packed inside the Mindflex case. It connects to Android and transfers measurement data without problems.

msaads (author)2017-01-12

Hi Arpruss, I am getting this raw packet

AA AA 04 80 02 06 5C 1B.

Can you please help me decode the information. AA AA( syncbyte) 04(packet length) 80(raw data in packet) 02???? 06(byte low) 5C(byte high) 1B(Checksum). What is 02 and correct me if i am reading highbyte and lowbyte in proper order.

arpruss (author)msaads2017-01-12

Have a look at the spec as well as at my brainflex source code. The source code says something about 0x02 being "POOR SIGNAL", but I don't know if that's in this position. https://github.com/arpruss/brainflex/blob/master/src/mobi/omegacentauri/brainflex/MindFlexReader.java

arpruss (author)2016-12-22

Do you have an oscilloscope to connect to the TX on the headset?

AyushP2 (author)arpruss2016-12-24

I decided to strip off the Bluetooth of off the headset and desoldered all the wires and I tested the headset with the board game, the board game received no signal. I don't know what happened to the headset, but I believe that is the problem, it doesn't send a signal at all.

AyushP2 (author)AyushP22016-12-24

I believe this was due to me placing helping soldering hands on a pretty bad place that has circuitry.

AyushP2 (author)arpruss2016-12-22

But the Mindflex works, I tried it with the board game

AyushP2 (author)arpruss2016-12-22

I have tried multiple applications, the Bluetooth connects, transmits NOTHING, then disconnects.

AyushP2 (author)AyushP22016-12-22

Brain Wave applications that is

AyushP2 (author)arpruss2016-12-22

I'm afraid not but why, is it to check even if it does send sounds?

AyushP2 (author)2016-12-21

My headset doesn't respond to graphs, is it because I have not connected R to TXD on the HC-06?

arpruss (author)AyushP22016-12-21

Without that connection, you can't switch modes.

arpruss (author)arpruss2016-12-22

Have you connected a terminal emulator to it to see if it's transmitting ANYTHING? (Maybe junk.)

AyushP2 (author)arpruss2016-12-22

Transmits nothing, connects, but nothing ever comes from the EEG, even as a raw bluetooth

AyushP2 (author)arpruss2016-12-22

I connected R to TXD, but it still refuses to connect to anything. I am very confused.

AyushP2 (author)arpruss2016-12-22

thanks so much for replying, my problem is I'm using Trent Brook's BrainWave and when I connect it to my Bluetooth using the mind flex, it connects but transfers no packets and after a minute or so it disconnects, and yes the lights are solid during connection so I was wondering if the mode was the problem or power. Thank you so much for your help.

borsaci06 (author)2016-11-23

Thanks for the wonderful instructable.. I am using TGAM modules and modified Mindflex headsets for a while with Arduino and Brain Library.. but the data packets arrive at very low speed ( 1 packet/sec).. I found your instructable very helpful and tried to display the brain data on my pc with your brainflex001.jar... It seems to be working but the data acquisition and display freezes at some point... It is random.. sometimes it works for few seconds and sometimes few minutes.. but freezes at some point... when brainflex001 is not responding, I checked the headset with a terminal software (without powercycling) and saw that 8 bit hex data is continuing to flow at 57600 baud... so I am thinking of a overflow problem with brainflex001.jar... help please....

arpruss (author)borsaci062016-11-23

Have you tried using a faster computer? Or adding lots of debug println statements?

tobajas (author)arpruss2016-11-28

Hi, i'm experiencing the same problem ... when i use putty in order to see the received bytes, what i see is that, after a perior of time receiving the correct patter for raw mode, i started receiving just bytes containing 0xE0 or 0x00 values ... any clue about where the problem is? thanks. please help!

000004c0h: 80 02 FF A3 DB AA AA 04 80 02 00 A6 D7 AA AA 04
000004d0h: 80 02 01 F3 89 AA AA 04 80 02 03 49 31 AA AA 04
000004e0h: 80 02 01 D0 AC AA AA 04 80 02 FE FE 81 AA AA 04
000004f0h: 80 02 FE BF C0 AA AA 04 80 02 00 6C 00 E0 E0 E0
00000500h: 00 E0 E0 E0 00 00 00 00 00 00 E0 00 00 00 E0 00
00000510h: 00 E0 E0 E0 00 00 E0 00 00 E0 E0 E0 E0 E0 E0 00
00000520h: 00 E0 00 00 E0 E0 E0 00 00 E0 00 00 E0 E0 00 E0

tobajas (author)2016-11-24

Hi again!... i just developed a code for a Photon device from Particle to register the raw values from mindflex @57600, by following your hacks, and after sending the command byte, i started receiving raw data packets correctly, but after 5 o 6 packets, it starts giving checksum errors, and eveything goes wrong ... as you can see on the following portion of the log messages:

latestByte: AA
latestByte: AA
PacketLength: 4
latestByte: 80
latestByte: 2
latestByte: 3
latestByte: 80
latestByte: AA
ERROR: Checksum: 170 250[128, 2, 3, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...

Do you know where the problrm can be? ... i've not using any optoacoplator between mindflex and the Photon device. Thanks a lot for your help.

tobajas (author)2016-10-25

Hi!, thanks a lot for your project! ... which alternative modules could i use in order to make it BLE compatible? thanks again.

arpruss (author)tobajas2016-10-25

You can look on aliexpress. I think I've seen some. But I am not sure that any of them function as a straight serial to bluetooth bridge without the need for another microcontroller.

tobajas (author)arpruss2016-10-26

Hi arpruss, thanks a lot for yor answer. I was thinking about using SunFounder Bluetooth 4.0 HM-10 module ... do you think it will be a valid option?. thanks again.

arpruss (author)tobajas2016-10-26

BLE doesn't have a serial profile, so it may not work as a drop-in replacement for the HC-06, and in any case the PC/Android end will need new software.

pr0cesor (author)2016-09-19

The bluetooth HC-06 needs to be a slave?

arpruss (author)pr0cesor2016-09-20

Yes.

StandardImagery (author)2016-07-17

Hi All, I develop this free Android app in order to show all data, directly on smartphone :

http://www.standardimagery.com/imageryone/2016/07/09/brainrawvisualizerdemo/

arpruss (author)StandardImagery2016-08-04

I haven't tried it yet, but it looks good. How do you detect blinks?

StandardImagery (author)arpruss2016-08-09

I wrote an API in order to detect it :)

arpruss (author)StandardImagery2016-08-31

Can I encourage you to share it?

StandardImagery (author)arpruss2016-08-09

Probably if I have time I' ll write an article on my blog www.standardimagery.com ...get in touch :) Bye

loarri (author)2016-08-31

Hello guys

could you help me please? since I'm trying to develop an application using attention and meditation levels could you me explain please which differences we have for these signals when TGAM chip works in 9600 baud mode (so 1 data packet every second if I'm not wrong) or in raw mode, 57600 baud?
Let's say...since my application will use only attention and meditation values and not the other brain waves is it necessary or better to switch to 57600 baud mode or I can "stay" with my default setting 9600 boud one?
what are the advantages of using these two values (att/med) in the second case (57600 baud mode)?

Thank you very much for your help !!!
thanks again and regards
Lo

arpruss (author)loarri2016-08-31

Staying in the default 9600 baud mode is simpler and communication at 9600 baud should be more reliable, so I think you should not change modes. See the NeuroSky docs for how to get the data.

loarri (author)arpruss2016-08-31

perfect thank you very much!

but could you tell me if these signals (att/med) are different in 57600 mode?

or are they the same?

Thanks again and bye

Lo

About This Instructable

35,035views

98favorites

License:

More by arpruss:$3 Alternative to Makey MakeyCertamen Quiz Practice Machine$3 Roomba 500 Bluetooth Adapter
Add instructable to: