The Bluetooth Shield allows your Arduino to create a wireless serial connection to your computer, to send and receive data and commands.

The shield can be reconfigured using AT commands, and the firmware can be reflashed to change its features. By default, the shield acts as a slave device and provides a serial link.

1. Fit the shield to your Arduino

Mount the Bluetooth Shield on the headers of your Arduino.

2. Place serial port jumpers

The Bluetooth shield can use any of the digital pins D0 to D7 for its TX and RX connections. The positions of the jumpers correspond to the digital pins above them, with the top jumper setting the Bluetooth module's TX pin and the bottom jumper setting the Bluetooth RX pin.

 

Here's a diagram of the jumper block pins:

And a photo of the default setup:

 These connections are made by the jumpers on the default config:

This jumper setup and diagram shows two pin connections:

  • The Bluetooth module Transmit (TX) pin (top row) is connected via the jumper to Arduino pin D2 on the shield. The Arduino can receive data via the Bluetooth shield using pin D2.
  • The Bluetooth module Receive (RX) pin (bottom row) is connected via the jumper to Arduino pin D3 on the shield. The Arduino can transmit data via the Bluetooth shield using pin D3.

Remember that TX (transmit) and RX (receive) are from the Bluetooth Shield's point of view, opposite from the Arduino's point of view. So Bluetooth TX connects to Arduino RX, and Bluetooth RX connects to Arduino TX.

There's one other thing to keep in mind. Pins D2 and D3 do not have hardware serial port features like pins D0 & D1. D0 & D1 are the special pins which are connected to the USB/Serial interface on the Arduino. This means you can't use commands like Serial.print(). You have to use a "Software Serial" feature on the Arduino. See below for an example.

 

Find all this confusing? It can be! Don't worry too much for now. If you keep the jumpers in the positions shown in the photo above, and run the sketch example below, then everything will work. Then you can modify the example to get the behaviour you want.

 

3. Apply power and pair the device

Connect your Arduino to your computer by USB to provide power. The yellow "Status" LED on the Bluetooth shield should begin flashing rapidly, to show that it doesn't currently have a valid link.

You can now pair the Shield to your computer using PIN code 1234. Check our Bluetooth Pairing Guide for detailed instructions on OS X, Linux and Windows.

 

4. Load example sketch

Open the Arduino IDE, and create a new sketch. Copy and paste in the following sketch:

 

#include <SoftwareSerial.h>

SoftwareSerial bt(2,3); // RX, TX

int thisByte = 33;

void setup() {
  bt.begin(9600);
  bt.println("ASCII Table ~ Character Map");
}

void loop() {
  bt.write(thisByte);

  bt.print(", dec: ");
  bt.print(thisByte);
  bt.print(", hex: ");
  bt.print(thisByte, HEX);
  bt.print(", oct: ");
  bt.print(thisByte, OCT);
  bt.print(", bin: ");
  bt.println(thisByte, BIN);

  if(thisByte == 126) {
    thisByte = 32;
  }
  thisByte++;
}

 

Select the usual serial port and board type for your Arduino, and upload the sketch via the Arduino's usual USB connection.

This sketch is based on the "ASCIITable" example included in the Arduino IDE, but modified to use Software Serial on pins 2 and 3 and to repeat the table continuously.

5. Open serial console using Bluetooth

After uploading the sketch to your Arduino using its regular USB port, you need to switch the Arduino IDE's serial connection over to using the Bluetooth connection to receive the data sent by the sketch.

 

For OS X and Linux

In the Arduino IDE, open Tools -> Serial Port. On OS X, there will be a new serial port listed called "HC-05". On Linux, it will be called "rfcomm0". On Windows, it will be the COM port name that was assigned when you paired the device. Select the serial port for the Bluetooth device, and then select Tools -> Serial Monitor to see the serial console.

Set the baud rate to 9600bps.

You should then see messages from your Arduino, continuously repeating all the characters in the ASCII table.

 

For Windows

For Windows, the Arduino serial monitor usually doesn't work for Bluetooth serial ports. As part of the pairing instructions we recommend you install the program Tera Term.

Launch Tera Term, click "Serial" and then choose your Bluetooth COM port from the dropdown:

The Bluetooth Serial Port should open. The default baud rate is 9600bps which matches the Arduino, so you should see the Arduino's output, continuously repeating all the characters in the ASCII table:

Check the Windows Troubleshooting section in the pairing guide if the serial port isn't listed, or you can get an error when opening it.

 

LEDs on the Bluetooth Shield

The Bluetooth Shield has the following indicator LED combinations.

  • Power LED (Blue)
    • On when power is applied to th shield.
  • Status LED (Yellow)
    • Blinking Fast - Disconnected
    • Blinking Slow - Connected via Bluetooth, but Serial Port "closed"
  • Link LED (Green)
    • On - Connected and Serial Port "open" (data flowing)