This Bluetooth <-> RS232 adapter allows connection from any device that supports RS232 to PC or mobile device that supports Bluetooth. This walkthrough demonstrates how to configure some parameters such as name and Baud rate.
By default, this adapter has the following settings:
- 9600 Baud 8N1
- Device Name “linvor” (a name that occurs as the BT device).
- Device pin or pass: 1234
Once paired with your PC or another device via BT, It creates a virtual port COMxx
Default settings for COMxx are 9600 Baud, 8N1, but this can be changed BT device configuration (I have renamed it as Quadx650):
But this only changes the virtual RS232 settings but we still need to setup RS232 in the other side.
The RS232 port configuration
At this point is necessary a cable or direct RS232 connection on your computer. There are a lot of alternatives on the market, in my case I use FTDI Basic (Buy)
But there are many local alternatives, some directly available on a PC home depot.
Connecting the module for configuring through AT commands
The module is configurable through AT commands sent from RX, TX PINs when it is not paired (connected through BT with the PC).
From now on everytime I say MBT (module bluetooth) and FTDI (adapter rs232 – usb)
- Unpair BT device.
- Feed the module with 5v, in my case the USB adapter is 5V.
- 5V (FTDI) – > 5v (MBT)
- GND – > GND
- Connect the RS232 pin
- (MBT) TX – > RX (FTDI)
- RX (of the MBT) – > TX (FTDI)
- Download PuTTY.exe
Well now we can connect through FTDI to the MBT using PuTTY:
COM17 is the FTDI port, in your case it could be another. Remember default setting is 9600 8N1 .
In PuTTY type AT (do not press enter) and if the response is OK means that we did everything correctly.
It is now time to set up the MBT using a series of AT commands. My recommendation is to open a Notepad and write the commands that we are going to use, then copy and paste in the terminal (use right click on the terminal, do not use Ctrl + V). Why? couse MBT process the command to fast, if you manually type the command it fails but when you paste the whole sentence it works fine.
To change the device name BT must send AT+NAMExxxxx, in my case, use the following command to baptize it Quadx650
To change the Baud rate, and upload it to 115200 use BAUD8 that in the table is equivalent to 115200.
For testing it is possible to mate the device and open two consoles one pointing the FTDI COM and another to the COM on the MBT. Anything typed on a console should echo in the other.
You can then change the parity, PIN etc. For them I leave the rest of the AT commands
This is the HCxx manual, wich is the small board attached to JY-MCU: https://apirola.files.wordpress.com/2012/11/hc-serial-bluetooth-products-201104.pdf
AT command set
The way to the AT command mode: supply power to the module, it will enter to the AT mode if it
needn’t pair. The interval of command is about 1 second.
Default parameter: Baud rate:9600N81, ID: linvor, Password:1234
1 Test communication
Send: AT (please send it every second)
2 Reset the Bluetooth serial baud rate
4– 9600 (Default)
PC can’t support the baud rate 115200 than lager. The solution is: make the MCUS have higher baud
rate (lager than 115200) through programming, and reset the baud rate to low level through the AT
The baud rate reset by the AT command can be kept for the next time even though the power is cut
3. Reset the Bluetooth name
Parameter name: Name needed to be set (20 characters limited)
Send: AT + NAMEbill_gates
Now, the Bluetooth name is reset to be “bill_gates”
The parameter can be kept even though the power is cut off. User can see the new Bluetooth name
PDA in refresh service. (Note: The name is limited in 20 characters.)
4 change the Bluetooth password pair
Parameter xxxx: The pair password needed to be set, is a 4-bit number. This command can be used
in the master and slave module. At some occasions, the master module may be asked to enter the
when the master password module tries to connect the slave module (adapter or cell-phone). Only if the
password is entered, the successful connection can be built. At the other occasions, the pair can be finish
automatically if the master module can search the proper slave module and the password is correct.
Besides the paired slave module, the master can connect the other devices who have slave module, such
as digital camera Bluetooth, Bluetooth GPS, Bluetooth serial printer etc.
Then the password is changed to be 8888, while the default is 1234.
This parameter can be kept even though the power is cut off.
5. Do not check parity (The version, higher than V1.5, can use this command)
Send: AT+PN (This is the default value)
Back: OK NONE
6. Set odd parity check (The version, higher than V1.5, can use this command)
Back: OK ODD
7 Set even parity check (The version, higher than V1.5, can use this command)
Back: OK EVEN
8 Get the AT version