BCI part 4 – the Arduino hardware and software

Sep 9, 2014 | | Say something

My previous post described how to make a simple wire modification to the Mind Flex headset, here I describe setting it up for initials tests on the Arduino.

I have for testing an Arduino UNO, and it connects to my laptop using a standard USB A-B cable.

You will need an environment for the software, to allow the programs to be created and uploaded to the Arduino http://arduino.cc/en/main/software Confusingly this is called Arduino, download and unzip the latest version.

Remember to install the drivers from the Arduino folder. Plug the Arduino UNO in to your computer using an A-B USB cable and follow instructions – found new hardware.

You will also require the brain-master library, so download and unzip the Arduino brain-master https://github.com/kitschpatrol/Brain This is software that makes the UNO work with the headset, or specifically the TGAM1 module.

You need to make a library folder in the Ardurino library structure on your computer. Navigate to the Arduino folder that was just unzipped and open the folder called “libraries”, create a new folder named “Brain”. Now go to the brain-master and select “Brain.cpp” and “Brain.h” and copy them to the newly created folder in the ‘libraries’ folder.

Back to the brain-master folder and open the examples folder and then open the ‘BrainSerialTest’ folder, if there are copies of Brain.cpp and Brain.h there, then delete them.

Now locate and run Arduino.exe from the Arduino folder, this is the Programming Development Environment (PDE). I made a shortcut to my desktop to launch this easily.

Within the PDE, load (open) the BrainSerialTest sketch.

Ensure that the PDE is set for the specific Arduino board you have and that the com port is correct (use device manager to find this) and then upload the program to the Arduino.

Disconnect the Arduino (turn off any power sources including removing USB), connect the output of the Mindflex to the Rx pin and ground to GND. Turn on Mindflex and connect Arduino.

My Arduino when installed comes up on COM5, so the port was changed in the PDE.

With all this done, you can test that you get data output from the Headset though the Arduino by opening up within the PDE the serial monitor, after a few seconds you should see lines of data streaming in.

serial stream

All should be OK and now that the code has been loaded in to the UNO, this step does not have to be performed again, unless you re-program the UNO for some other application or if you make any changes to the brain-master code.

In the next instalment I will describe the radio link from the headset to the Arduino UNO.

Posted in: Brain Control Interface

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>