DF-BluetoothV3_Bluetooth_module__SKU_TEL0026_-DFRobot

Introduction

DF-Bluetooth module V3 adopts a unique double-board design to prevent electrostatic damage to the module as well as providing a beautiful appearance. The module has two DC input ports and can be powered at 3.5~8V wide voltage range or 3.3V, which allows it to be suitable for various scenarios. There are STATE and LINK indicators for displaying the working and connection status of the module (STATE: Search state(high 104ms; cycle 342ms; flashing 2.9Hz); Connection state(high 104ms; cycle 2ms; flashing 0.5Hz) LINK: keep ON when paried). In addition, the module comes with on-board antenna that offers quality singal and longer transmit distance. With transparent serial port, it can be paired with all sorts of Bluetooth adapters or phone's Bluetooth for convenient redevelopment.

The module status can be set by the DIP. Turn off the LINK light via LED off to enter power-saving mode. AT mode can set the module to AT command mode, and the baud rate and mater-slave mode can be revised by AT command. When two such modules are set as master and slave respectively, they can be paired freely for data transmission, which is very suitable for data communication of two MCUs.

Specification

PinOut

Pin Definition
GND GND
VCC 3.5-8V DC (When there is VCC input, 3V3 port can be used as 3.3V power output)
NC Empty Pin
RXD UART Input(TTL Level), connect to MCU TXD
TXD UART Output(TTL Level), connect to MCU RXD
3V3 DC3.3V (When there is 3.3V input, the VCC port cannot be connected to power source)

Set module in AT mode

How to enter into AT mode

The DF-Bluetooth V3 module has two switches on the module.

So if you turn the NO.2 switch on, you can use the AT mode to set the Bluetooth module, e.g. name, baud rate, master/slave mode etc.

Preparation

Steps

- Part 1: Ready to go


USB to TTL module

  1. Plug the Bluetooth module into the USB to TTL module;
  2. Turn on the AT mode switch of the Bluetooth module;
  3. Connect the USB to TTL module to your computer;
  4. Install the driver for the USB to Serial module if it can't be recognized.

- Part 2: Setting


After connecting the module to computer, we can use CoolTerm software to talk with Bluetooth module.

  1. Click Connection --> Choose Options to set several parameters in CoolTerm.
  2. Set Serial Port
    1. Port: the port number can be got from the Device Manager of the computer
    2. Baudrate: 38400
    3. Data Bits: 8
    4. Parity : none
    5. Stop Bits: 1
  3. Set Terminal
    1. Terminal Mode: Line Mode
    2. Key Emulation: CR+LF

Image:Coolterm Preferences 38400.png|Set Serial Port Image:Coolterm Preferences BT.png|Set Terminal

- Part 3: Setting


Send AT command & return value
Now use the CoolTerm to send AT commands to the Bluetooth Module and see what information the Bluetooth will answer to the computer.

- For example:

- Return: OK

- Return: OK

- Return:+name: DFRobot OK

- Return: OK

- Return: +role:0 OK

- +PSWD:1234 OK

- Return: OK

- Return: OK

More AT command can be obtained from the TEL0026_Datasheet.

- Part 4: Exit AT mode


Please turn the AT mode switch off and then repower the Bluetooth module.

Tutorial

Communication between PC and Bluetooth Module

The DF-Bluetooth module is based on the specification of Bluetooth V2.0, compatible with V1.1. A Bluetooth adaptor is required to communicate with the DF-Bluetooth module. When it is paired with other Bluetooth devices, the DF-Bluetooth is always set to slave mode.

The IVT BlueSoleil is recommended to manager all your Bluetooth devices.

STEPS


Step 1: Connect a Bluetooth adapter to the computer so that the computer can find the Bluetooth module.

Step 2: Put the Bluetooth module on the Arduino board

Step 3: Open BlueSoleil software (Figure 1) and right click the yellow ball in the centre screen, click “Search Devices” , an icon named EPBMX-COM will appear after few seconds. The EPBMX-COM is the DF-Bluetooth module.

Figure 1

Step 4: Right click EPBMX-COM icon, click “Pair”. A window will popup ask for PassKey which is “1234” by default (Figure 2).LINK-LED on the Bluetooth will blink if the Pair is successful and the LED is on.

Figure 2

Step 5: Right click EPBMX-COM, click “Search Service”. Then a serial port will appear and right click EPBMX-COM again and choose the choice “Connect Bluetooth Serial Port (C0MXX)” and you can see the LINK-LED on the Bluetooth will be lit if the LED switch is on.

Figure 3

Step 6: Upload test code to Arduino. Please unplug the Bluetooth module from the Arduino board while uploading test code.

void setup()
{
  Serial.begin(9600);             //Set serial baud rate to 9600
}

void loop()
{
  Serial.print("Hello!");           //print out hello string
  delay(1000);                  //1 second delay
}

Result


Plug the Bluetooth module on the Arduino board again after finishing uploading the codes. Then open the serial monitor to see what Arduino is sending to Bluetooth module. You can also use CoolTerm to check the communication.

- Figure 4

NOTE: Check the serial setting! Make sure the baud rate is set to 9600 on both master and slave. When the DF-Bluetooth is used on Arduino, please make sure you disconnect the DF-Bluetooth module before uploading any code to your Arduino. Or it will fail to upload any sketch as the DF-Bluetooth module occupying the TX/RX pins.

Communication between Two Bluetooth Modules

Step 1: Necessary Hardware

Step 2: Bluetooth Module Configuration

  1. Set the two modules to Master and Slave respectively.
  2. Serial Parameter: set the both modules to 115200 for the convenience of debugging later.
  3. Connection Mode: if the module cannnot be searched/connected by/with adapter or PC, this parameter needs to be configured:AT+CMODE=1.

Other parameters can directly adopt the default setting. Refer to the setting part above for more details. Master-slave pairing does not need a driver, and the two modules can transmit data when powered on. When the indicator lights LINK on the two Bluetooth modules keep ON, the pairing is successful. At this time, the serial port function has been started. When the master and slave pair are used normally, the lights will not go out. If the distance between the master and the slave is too far and the connection is lost, the lights will keep flashing. Put the two modules closer then they will find each other and connect automatically. The master will remember the slave it has configured, and it will find the slave address it has remembered as soon as it is powered on.

Step 3: Hardware Connection

  1. Plug the two Bluetooth Modules onto I/O shields respectively, and plug them into UNO boards.
  2. Connect the two UNO boards to computer via USB cables.

Connection Diagram 1

Step 4: Code Burning

  1. If you are using the new I/O shield, please dial to prog before downloading codes, and then dial back to run when finished.
  2. If you are using the old I/O shield, then please unplug the Bluetooth module when downloading codes. Replug it after the codes burning is done.

When downloading codes, you don't need to consider the order of master-slave above. Any module can be transmitting end or receiving end.

Codes for transmitting end:

void setup() {
  Serial.begin(115200);    //init serial and set baud rate to 115200
}

void loop() {
  Serial.print("Hello!");
  Serial.println("DFRobot");
  delay(1000);
}

Codes for receiving end:

void setup() {
  Serial.begin(115200);   //Init serial port and set baud rate to 115200
}

void loop() {
  char val;
  val = Serial.read();     //Read serial port 
  if (val != -1) {
    Serial.print(val);  //Send out the received data again via serial port 
  }
}

Result

Open two serial ports and set their bard rate to 115200, check the result.

Transmitting End:

Transmitting

Receiving End:

Receiving

Communication between Bluetooth module and Android Phone

Step 1: Necessary Hardware

Step 2: Bluetooth Module Configuration

Same as above.

Step 3: Hardware Connection

  1. Plug the Bluetooth Module onto I/O shields, and plug it into UNO board.
  2. Connect the UNO board to computer via USB cable.

Connection Diagram 2

Step 4: Download and Install APP

Open Bluetooth Termial to download and install the APP.

If you cannot install, please click to check if your phone is on the list. If not, then sorry you cannot use this APP.

You can directly install Google Play Store on your phone, then search this APP in it.

Bluetooth Terminal Interface

Step 5: Pair your phone with the Bluetooth module and connect

  1. Open the Bluetooth settings of the mobile phone, and make pairing. The password is 1234.

Pairing

  1. Select "Connect a device-Secure", then the following box will pop up. Click Bluetooth_V3 to start connecting.

Connecting

  1. The indicator LINK will keep ON when connected sucessfully.

Connection Done

Step 6: Burn test code into UNO

warning_yellow.pngNote:

  1. When burning the program to UNO, please select the serial port number of UNO instead of Bluetooth. The baud rate setting in the program should be consistent with that of your Bluetooth module.
  2. If you are using the new I/O shield, please dial to prog before downloading codes, and then dial back to run when finished.
  3. If you are using the old I/O shield, then please unplug the Bluetooth module when downloading codes. Replug it after the codes burning is done.

If the connection is lost during code downloading, please reconnect and try.

  1. UNO-->Transmitting END, Phone-->Receiving End, burn the codes.
void setup()
  {
    Serial.begin(115200);             //Init serial port and set baud rate to 115200
  }
  void loop()
  {
    Serial.print("Hello!");           //Serial port send out string 
     Serial.println(" DFRobot");      //Serial port send out string with carriage return
    delay(1000);                  //delay
  }

We can see the data sent by UNO when the burning is done.

  1. UNO--->Receiving end, Phone--->Transmitting end, burn the codes.
void setup(){
  Serial.begin(115200);   //Init serial port and set baud rate to 115200
}

void loop(){
  char val;
  val = Serial.read();     //Read serial port 
  if(val!=-1){
  Serial.print(val);  //Send out the received data again via serial port
  }
}

Result

When the burning is done, input a string on the phone, then we can see the data UNO received on the serial monitor. As shown below:

Result

Arduino serial monitor

FAQ

Q1. I want to use it as a wireless module on Arduino, and use my phone as a controller, can it be possible? |

A1. Welcome! For sure it is possible.

Q2. In the AT command list manual, some AT commands (e.g. AT+DISC etc.) seem to be useless cause I sent them to the device, but got "Error: (16)", is the AT commands given wrong or I missed anything? |

A2. Please check the Appendix 1: AT command error in that manual, 16 means "SPP is not initialized", so please send "AT+INIT" to initialize the SPP before sending other AT commands like you mentioned.

Q3. How can I find or pair with this BT V3 module through my pc or phone when it was run in AT mode? i.e. the AT selection switch was put at AT side. |

A3. Please enter AT mode, send "AT+INIT" first, after a while, send "AT+DISC", wait a second, you could find the BT module in your PC/ phone Bluetooth panel. Default pairing code is: "1234".

For any question/ advice/ cool idea to share with us, please visit DFRobot Forum

More

DFshopping_car1.png Get it from Bluetooth 2.0 Module V3 For Arduino or DFRobot Distributor.

category:Product Manual category:TEL Series category: Wireless category: Modules category: source