BCI part 5 – RF Link between Headset and Arduino

Sep 9, 2014 | | Say something

In the previous part, I described a simple wire connection to the Arduino as an initial test configuration. Here I describe a radio link between the Mind Flex headset and Arduino.

The modifications on the Internet all make use of a wired connection between the headset, Arduino and host computer for visualisation, the one exception is http://www.instructables.com/id/Mindflex-Duel-Bluetooth-Arduino-FIO-Hack/

That uses a Bluetooth module and FTDI module with a small Arduino in the headset. Whilst, as demonstrated a working solution, the kit is over complicated and one of the board also needs modifying thus adding to the complexity of going wireless. It is not clear how well it all fits in to the space of the headset.

My solution is cheap (~£25) and elegant, it adds the minimum hardware to the Headset, inside the electronics pod. The proposed solution enables the outward appearance to be retained without any hacking of the case. Provides a totally wire-free link to the Arduino, thus avoiding all issues with connection of other apparatus compromising safety. It is powered from the 3.3V rail of the headset.

In searching for a suitable device I came across this http://shop.ciseco.co.uk/xrf-wireless-rf-radio-uart-serial-data-module-xbee-shaped/ The XRF is an RF data transceiver module, that appeared to be of the right size and according to claims works straight out of the box at 9600bps.

DSCF4350s

It seemed easy to interface to the TGAM1 module; only 4 wires (3 actually) are needed. In the headset only the transmit data line will be used, so only three connections needed. On the Arduino, again only three connections required, this time the receive line, power and ground. If I want to later, the speed can be changed, again matching that coming out of the TGAM1 module. I bought two, one to go in the headset, the other to attach to the Arduino.

Out of the box it works in the 868MHz region but can be changed to 915 or 432 bands. It works on 3.3V so will work directly in the Mindflex headset, will it work on the Arduino as it has a 3.3V power rail present on one of the pins (UNO), later versions of the XRF (v1.6 up) are 5V tolerant on the data lines.

Although there is lots of information on the XRF module available here http://openmicros.org/index.php/articles/247-xrf-document-index, finding the functions of the pins is difficult, below shows the basic pins needed, the XBEE is the same thing apparently.

rfbeepinout

I soldered some ribbon cable on to the appropriate pins of the XRF and temporarily joined them up to the wires on the Mindfelx headset. On the second XRF I connected power to 3v3 and ground of the Arduino Uno and the Rx pins together. Switching it all on it did not work, so I investigated the reason. Another data sheet http://www.hobbytronics.co.uk/datasheets/XRF-v1-6.pdf shows that Tx is Data out and Rx is Data in, so I connected them round the wrong way. Swapping the lines around resulted in a functional radio data link. Fortunately this ambiguity didn’t damage anything. So the Tx and Rx pins of the XRF module refer to the data port, not the RF side, that is XRF pin Tx is data out and pin Rx is data in. The photo below shows in close-up the XRF and soldered connections.

DSCF4358s

There is a little bit of space in the headset to accommodate the XRF module, however the enclosure can not be secured together, so I cut off the pins of the XRF module to give it a lower profile, then put some heat shrink sleeve over it to ensure no extraneous electrical contact could be made to the electronics within the headset. The photos below show the encapsulation and wiring in the headset.

Now for more permanent connections to the Arduino. The XRF has a pin spacing of 2mm so it won’t plug in to a standard breadboard that has 2.54mm (0.1”) spacing. Ciesco produce an Arduino shield for this module, it contains other stuff as well, they also provide kits for passive and active interfacing – break out boards http://shop.ciseco.co.uk/xbbo-break-out-board-for-xbee-shaped-modules/ It appears that Rapid Electronics supply a ‘bare bones’ shield for the XRF at a reduced price http://www.rapidonline.com/electronic-components/xbee-shield-v0-6-for-arduino-xino-xrf-xv-xbt-and-more-73-4602

I cut off one end of three jumper-wire pins, soldered the wire ends to the appropriate terminals on the XRF (3v3 = orange to pin 1, gnd = black to pin 10, Tx (Dout) = blue to pin 2) and then plugged these in to the appropriate sockets on my UNO (orange to 3v3, black to gnd and blue to Rx).

DSCF4361s

Next, the Uno was connected to my laptop via USB and Arduino PDE was launched followed by opening up the serial monitor (no sketch was loaded, it had previously been uploaded to the UNO). Turning on the Mindflex headset, after a second or so data started streaming via the RF link and Arduino to my laptop, see screenshot below.

It is possible to use Arduino DIO pins other than the one shared with the USB, if left connected to the Rx pin there might be a conflict when programming the Arduino necessitating the removal of the connection to the XRF, during tests I did experience trouble and had to disconnect also the USB from the UNO and re-launch the Arduino PDE. In another post I will explain how to move the XRF output to what is called a ‘soft serial’ connection.

That is it for this post, next post I will explain how to get the output from the Arduino working so that the brainwaves can be visualised.

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>