Howdy -

 

For the Great Global Hackerspace Challenge, our Pumping Station: One team is building a biosensor array. The array consists of sensors placed around one's body connected to an Arduino also attached to the body.  Software running on a computing device like a laptop or smartphone will visualize and log the biosignal data.  We decided the best way to connect the on-body Arduino to the computing device is via Bluetooth.

 

I'd like to give a brief overview of interfacing an Arduino with a Bluetooth module to help you avoid the few bumps I encountered:

 

 

 

The following module from SparkFun was selected for our project:

 

BlueSMiRF Gold

http://www.sparkfun.com/products/582

 

I found this helpful tutorial from the Arduino Playground on how to wire the BlueSMiRF and Arduino together:

 

Wireless communication with PC and Arduino board using bluetooth

http://www.arduino.cc/playground/Learning/Tutorial01

 

Note: it is written for Wiring which is the language used for the Arduino platform, so it does not show the exact pins to use on the Arduino.

 

Here is how I wired up the BlueSMiRF after soldering standard 0.1" male headers onto it so that it could connected to a breadboard:

 

Arduino DuemilanoveBlueSMiRF Gold
5VVCC
GNDGND
Digital Pin 0 (TX) RX-1
Digital Pin 1 (RX)TX-0

 

Note: the serial TX/RX need to be reversed between the Arduino and BlueSMiRF as shown above.  This is because the Arduino trasmits to the BlueSMiRFs receive pin, and vice versa.

 

And finally, connect RTS-0 and CTS-1 on the BlueSMiRF together with a jumper wire as hardware flow control is not needed for this usage in my experience thus far.

 

The next step is to power up the Arduino (with BlueSMiRF connected) and then attempt to pair to the BlueSMiRF via Bluetooth.

 

Tip for Ubuntu Linux & GNOME:

I did this with my laptop which runs Ubuntu Linux (version 10.10).  If you are using the same, then I suggest installing blueman as the default bluetooth manager would not pair.  A simple "apt-get install blueman" should do the trick.

 

Whatever OS you use, you'll need enter the PIN when pairing and the default for the BlueSMiRF is "1234".  Once the red LED on the BlueSMiRF stops flashy quickly and changes to a slow flash, you will no longer be able to pair.   You must power cycle the BlueSMiRF and try again.  After successfull pairing, the green LED on the BlueSMiRF should lit up.

 

One more detail to keep in mind is that the default settings for the BlueSMiRF are:

 

  • Baud: 115,2000
  • Data Bits: 8
  • Parity: N
  • Stop Bits: 1

 

The baud rate is all you really need to know for Arduino & Processing from my expierence.

 

In the video at top, I show a demo of connecting via Bluetooth and running a demo sketch to toggle an LED on and off.  First via the Arduino IDE serial monitor and then via Processing sketch:

 

Arduino source code

Processing source code

 

 

 

Cheers,

Drew

http://twitter.com/pdp7