Skip to content
brice-morin edited this page Apr 17, 2013 · 10 revisions

Using JArduino over Bluetooth

The JArduino API requires to be able to communicate with the Arduino board but this does not mean that the USB cable is the only option. The serial cable can be replaced by any kind of wireless serial link in order to remove the wire between the computer and the Arduino board. As an example, we have tried using a BlueSMiRF Bluetooth adapter (such as http://www.sparkfun.com/products/582).

(On the picture, the USB cable is used only for power)

Hardware setup

Arduino side

The Bluetooth module is connected to the Arduino board with 4 wires:

  • Arduino GND <-> BlueSMiRF GND
  • Arduino 5V <-> BlueSMiRF VCC
  • Arduino TX <-> BlueSMiRF RX
  • Arduino RX <-> BlueSMiRF TX

If you are using a different module, check its operating voltage. If it requires 3.3V instead of 5V you can use the Arduino 3.3V to power it.

For the communication between the Arduino and the Blutooth adaptater to work, they need to use the same baud rate. By default the Jarduino firmware uses 9600bps while the BlueSMiRF adapter uses 115200bps. You can either change one or the other to make them match. Refer to the documentation of the Bluetooth module in order to change its baud rate.

PC side

On the PC which will be running the JArduino library you need to have a Bluetooth adapter. Our days most laptops are equiped with a Bluetooth adapter. If you do not have a built-in Bluetooth adapter, any kind of USB Bluetooth dongle should do the trick.

Software setup

From a software point of view the Bluetooth link is transparent:

  • The standard JArduino firmware can be used on the Arduino board,
  • All the JArduino programs running with the serial cable can run without any modifications.

On the Arduino side, the serial cable is replaces by the serial link with the Bluetooth module.

On the PC side, you need to pair the PC with the Bluetooth module using regular Bluetooth tools. Once the device is paired, it is recognized as a serial port. Just set this serial port in your JArduino program and you're all set.

-- The JArduino team

Clone this wiki locally