AT Mode Configuration of JDY-31 Bluetooth Module
by Mr.What in Circuits > Arduino
5969 Views, 2 Favorites, 0 Comments
AT Mode Configuration of JDY-31 Bluetooth Module
The JDY-31 is a (mostly) pin-compatible replacement for the HC-06 bluetooth module. It is a bit simpler, hence easier to use, and often available at a slightly lower cost.
There are several resources explaining commands available in the AT mode, but I had trouble entering the AT mode. This instructable focuses on establishing communications with the JDY-31 in AT mode.
Supplies
JDY-31 module.
USB to Serial converter or Arduino with script to emulate a USB to Serial converter.
Wiring
- Jumper Vcc and ground from your USB-serial converter, or Arduino running a script equivalent to a USB-serial converter.
- Jumper Rx on JDY-31 to Tx on serial converter.
- Jumper Tx on JDY-31 to Rx on serial converter.
Connect
It appears that the JDY-31 is in AT mode by default until a bluetooth connection is established.
Connect to your serial converter with a terminal program. I like the Arduino IDE for this purpose. It sends commands a line at a time, as needed, and it is straightforward to set BAUD and line endings.
The JDY-31 default rate is 9600 BAUD, 0-stop bits, 0-parity, using both carriage return and new line ending (\r\n).
The JDY-31 has NO RESPONSE to an empty AT command. You should, however, get a response to "AT+VERSION"
Try other BAUD rates if 9600 does not work. 38400 might be the next most common. Try with or without \r\n in case your unit was mislabeled.
It appears that the JDY-31 BAUD rate is the same for both data and AT mode.
AT Commands
The AT commands of most interest to me are:
- AT+LADDR shows MAC address
- AT+NAMEtoyrobot2 to set the name shown when scanning to "toyrobot2"
- AT+PIN3141 to set PIN to 3141 instead of default 1234
- AT+BAUD8 to set speed to level 8==115200. Rates are:
- 4 == 9600
- 5 == 19200
- 6 == 38400
- 7 == 57600
- 8 == 115200
- 9 == 128000