Introduction: AT Mode Configuration of JDY-31 Bluetooth Module

About: Degrees in EE, specializing in Digital Signal Processing. Working as a software engineer for 30+ years.

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.

Step 1: Wiring

  1. Jumper Vcc and ground from your USB-serial converter, or Arduino running a script equivalent to a USB-serial converter.
  2. Jumper Rx on JDY-31 to Tx on serial converter.
  3. Jumper Tx on JDY-31 to Rx on serial converter.

Step 2: 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.

Step 3: 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