Provides easy interfacing with 3.3V MCU
This module enables you to wireless transmit & receive serial data. It is a drop in replacement for wired serial connections allowing transparent two way data communication. You can simply use it for serial port replacement to establish connection between MCU or embedded project and PC for data transfer.
These modules have two modes: master and slave. You can set the module mode (master or slave) of the device by AT commands.
The main function of Bluetooth serial module is replacing the serial port line, such as:
MCU to MCU communication
There are two MCUs want to communicate with each other. One connects to Bluetooth master device while the other one connects to slave device. Their connection can be built once the pair is established. This Bluetooth connection is equivalently liked to a serial port line connection including RXD, TXD signals. And they can use the Bluetooth serial module to communicate with each other. Communication between two of these Bluetooth modules requires at least two conditions: (1) One module must be master and another module should be slave. (2) The password must be same.
MCU to PC/Smart Phone Communication
When MCU has Bluetooth salve module, it can communicate with Bluetooth adapter of computers and smart phones. Then there is a virtual communicable serial port line between MCU and computer or smart phone. Driver is not required when using the module with PC or Smart phone.
MCU to Other Slave device interfacing
The other bluetooth devices in the market mostly are salve devices, such as Bluetooth printer, Bluetooth GPS. So, we can use master module to make pair and communicate with them.
Status LED flashes at different rates to indicate different status like searching, config, connected.
Pair LED lights on continuously when matching and data connection is established successfully.
Config Jumper is put to make pin#34 high, then module enters AT command mode for configuration. Leave pin#34 floating and module is in normal working mode. Power off the module when making this change.
Status LED has three types of blinking status
1) Config Mode (LED blinks once a second): When the module is supplied power and PIN34(CONFIG MODE) is input high level, Status LED output 1Hz square wave to make the LED flicker slowly once a second. It indicates that the module is at the AT mode, and the baud rate is 38400; This is Configuration Mode.
2) Unpaired Mode (LED blinks two times a second): When the module is supplied power and PIN34(CONFIG MODE) is input low level or floating, Status LED output 2Hz square wave to make the LED flicker quickly. It indicates the module is at the pairable mode.
3) Paired Mode (LED double flicker per second): Pairing is finished and module can communicate.
LED comes on once the module has paired with another bluetooth module or PC or Smart Phone. The pair LED pin goes high when module is in pairing else the pin is at low level when unpaired.
The Bluetooth module works on 3.3V level only. High voltage like 5V will permanently damage the module, so please take care in using it.
If your application requires to be operated at 5V then use a LM1117-3.3 regulator to convert the 5V level to 3V3 level as required by module. Also protect the RXD pin against 5V TXD signal by inserting 1K resistor in series to module RXD pin.
If you wish to connect this module to PC’s Serial port which is at RS232 level, then you need to add MAX232 circuit as shown.
When jumper is put on config pin making it high during power on state the module enters AT command mode for module configuration at baud rate of 38400bps.
Then you can use a software like Terminal to configure the module. You can download Terminal from this product page download box.
Here you can see we are entering various AT commands and getting response from module.
Here you can see we are setting different configuration and module is responding with OK.
AT Command structure: all command should end up with “\r\n” (Hex: 0x0D 0x0A) as the terminator. For full AT command download PDF AT-Commands.pdf from this page download box.
Reset the master-slave role command:
AT+ROLE=0 ----Set the module to be slave mode. The default mode is slave.
AT+ROLE=1 ----Set the module to be master mode.
Set memory command:
AT+CMODE=1 Set the module to make pair with the other random Bluetooth module (Not specified address). The default is this mode.
AT+CMODE=0 Set the module to make pair with the other Bluetooth module (specified address). If set the module to make pair with random one first, then set the module to make pair with the Bluetooth module has specified address. Then the module will search the last paired module until the module is found.
Reset the password command
Set the module pair password. The password must be 4-bits.
Reset the baud rate
AT+UART=9600,0,0 ----set the baud rate to be 9600N81
Reset the Bluetooth name
Steps to set module to MASTER
Power on module in config mode, module comes into AT Command Response Status.
Open Hyperterminal or other communications tool, set the baud rate to 38400, 8 data bits, 1 stop bit, no parity bit, no flow control
Via TTL serial port, send characters "AT + ROLE = 1 r n",if successful, return "OK r n", where r n is carriage return.
Remove Config jumper, re-power, then in Master state, automatically search for slave module and connect.
AT responds OK.
AT+RESET responds OK.
AT+VERSION? responds with the firmware version.
AT+ORGL responds OK and restores default state.
AT+ADDR? responds with module address.
AT+NAME? responds with module name.
AT+NAMEname where name 20 or fewer characters. Responds OKname. Retained across power offs.
AT+RNAME? responds with remote paired module's name.
AT+ROLE? responds with 0=slave, 1=master, 2=slave-loop (loopback: receives master device data and sends back to master).
AT+CLASS? responds with device type (32 bit indicating device type and what is supported).
AT+PSWD? responds with password.
AT+PSWD=password sets module pairing password to password.
AT+UART=x,y,z where x is 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1382400 for baud rate, where y is 0=1 bit, 1=2 bits stop bit, where z is 0=none, 1=odd, 2=even parity). Deafult is 9600,0,0.
AT+UART? responds with +UART:baud,stop bits,parity.
AT+STATUS? responds with the module status (+STATE:initialised, ready, pairable, paired, inquiring, connecting, connected, disconnected).
AT+PAIR=x,y sets the remote Bluetooth device address with which to pair where x is the address (eg 12:34:56:ab:cd:ef) and y is the limited time of the connection in seconds.
BlueTerm (this is a free app for android and you can found it in the Google Play market)
Terminal emulator for communicating with any serial device using a bluetooth serial adapter. The RFCOMM/SPP protocol emulates serial communications over bluetooth.
First you must enable Bluetooth on your telephone. Search the bluetooth device and pair with it (the password is 1234). Then open BlueTerm and select the device.
The Bluetooth module runs the SPP (Serial Protocol over Bluetooth) protocol. So any device supporting SPP can connect to it. On a PC this looks like a virtual COM port. I show here the steps for Windows (running Windows 7).
It seems that Apple (iPhone, iPAD, etc) does *not* support SPP, so connecting with an iPhone is not possible. Android works, or any PC machine with Bluetooth Dongle.
From the Device Manager, select ‘Add a Device’:
Then the new device should show up:
The name of the device shows here for me ‘blue1′, as I have named it as such with AT config. You might get default name.
Select the device and press ‘Next’. In the next dialog select ‘Enter the device’s pairing code’:
The default pairing code is 1234:
Pressing next, and device drivers will be installed:
Then the device is ready to use:
And the confirmation dialog shows up:
COM Port used by Device
Checking the properties on the newly added device shows that it supports SPP. And it shows the virtual COM port used:
Using that COM port shown for the SPP service, You can connect with any terminal program on the host PC to my remote bluetooth board.
Any Data transmitted to this COM port appears at TX out pin of bluetooth module and same for received data.
Unbinding and Trouble Shooting
In case there are issues with connecting to the module, it is necessary to unbind and re-bind (connect) to the module. It happened to me sometimes I’m able to connect once, but then not any more. In that case the following steps help:
If your PC does not have bluetooth capability then you can easily add by using a commonly available "Bluetooth USB Dongle" like below