Go Down

Topic: How to enter AT mode in HC-05 bluetooth module (Read 13490 times) previous topic - next topic

Hi guys,
I'm new to arduino and electronics so please bare with me.
I've been trying to enter AT mode with a HC-05 bluetooth module (http://www.ebay.ca/itm/180957186752?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649). This is what I did;

1. I used a USB to Serial adaptor (http://www.ebay.ca/itm/170910289160?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649).
2. Connected TX bluetooth to RX adaptor, RX bluetooth to TX adaptor (Via a voltage regulator http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/step3/Wiring-the-Arduino-Bluetooth-transceiver/).
3. Connected power (3.3v) and ground (I used a voltage regulator to bring the 5v from the adaptor down to 3.3v).
4. Then I connected pin 34 bluetooth (PIO11) to 3.3v (To make the pin go high).
5. Opened PuTTY and set it to Serial mode. Used COM8 (the USB to Serial adaptor COM port) and 9600 baud rate. (When this didn't work I also tried 38400 baud rate).
6. In the terminal section of PuTTY set Local echo to Force on.
7. Entered "AT\r\n" in PuTTY.

I didn't get an OK as the result. Did I do something wrong? Any help please?

Instructions on how to enter AT command mode (http://elecfreaks.com/store/download/datasheet/Bluetooth/HC-0305%20serail%20module%20AT%20commamd%20set%20201104%20revised.pdf)


Riva

Found a manual that's a bit easier to read here http://iteadstudio.com/Downloadfile/BluetoothHC05.pdf and as you say it states you pull pin 34 (PIO11) to VCC (3.3V) and then power on.
Quote
How to set the mode to server (master):   
1. Connect PIO11 to high level.
2. Power on, module into command state.
3.  Using  baud  rate  38400,  sent  the  "AT+ROLE=1\r\n"  to  module,  with  "OK\r\n"
means setting successes.
4. Connect the PIO11 to low level, repower the module, the module work as server
(master).

Is your FTDI serial cable set for 3.3V or 5V

Thanks for replying!
My FTDI is set for 5V but I'm powering the bluetooth through a voltage divider. When I send AT\r\n I don't get anything back (no OK, the cursor in PuTTY just goes back to the beginning). Help?  :smiley-sad-blue:

Riva


Thanks for replying!
My FTDI is set for 5V but I'm powering the bluetooth through a voltage divider. When I send AT\r\n I don't get anything back (no OK, the cursor in PuTTY just goes back to the beginning). Help?  :smiley-sad-blue:

Maybe the FTDI should also be set to 3.3V as the device is 3.3V else your pumping 5V into the RX pin.
A better manual here http://www.hobbytronics.co.uk/datasheets/EGBT-bluetooth-module.pdf says at the bottom of page 7
Quote
EGBT-045MS RX input is not 5V tolerant. A schottky diode connected as shown will keep 5V volt-
ages out of the Bluetooth module when operated with a 5V host microcontroller.

formus

i'm sorry but i didnt get the idea
i have bought this bluetooth module http://ram-e-shop.com/oscmax/catalog/product_info.php?products_id=2244
i would like to pair it with another Bluetooth module
i think i just need to use AT modes for this
but i really don't know how to use this modes
i have succeed in pairing this module with pc
but this is not what i need
any help please

Riva

The link you supplied for your BT module makes me think it is a slave only device that you can only link to from another device. It is not capable of creating a link to other devices, just receiving them.
If it is a slave module (HC-06) then normally the AT commands must not have line termination (carriage return/line feed) as it uses a 1 second timeout to assume end of command.

Hi there, here is the code I use to get the HC05 in AT mode. it works on my arduino UNO, I hope it'll help you.

//Caution: Tx of the module is to connec twithpin 10 of the arduino and RX with pin 11
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // TX | RX
void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(115200);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
//Take the string returned by the module and print it
Serial.println(BTSerial.readString());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.println(Serial.readString());
}

npag

i used the exact same code and my hc-05 goes in AT mode but repies nothing when i type in any command

zapping

#9
Dec 23, 2014, 06:13 pm Last Edit: Dec 23, 2014, 06:26 pm by zapping
BASIC CONFIG
1º Connect TX with 10,RX with 11,VCC(3.3v) and GND
2º Load the program in Arduino

Model ZS-040
1º Push button in bluetooth module and hold
2º Disconnect VCC of bluetooth module
3º Connect VCC
4º Release button - Led must flash very slow. Now you are in AT MODE
5º Reset Arduino with reset button
6º Start the Monitor Serial, select "Both NL & CR"
7º Enter command "AT" and Enter. You must receive OK.

Other -->
1º supply 3.3v to 34 pin and hold
2º Disconnect VCC of bluetooth module
3º Connect VCC
4º Release 3.3v from 34pin - Led must flash very slow. Now you are in AT MODE
5º Reset Arduino with reset button
6º Start the Monitor Serial, select "Both NL & CR"
7º Enter command "AT" and Enter. You must receive OK.


That's all.

Regards

P.D.: Excuse for my english. The program is in spanish:
Code: [Select]
#include <SoftwareSerial.h>

#define RxD 10
#define TxD 11

SoftwareSerial BTSerial(RxD, TxD);

void setup(){
  BTSerial.begin(38400);
  Serial.begin(9600);
  BTSerial.print("AT\r\n");
  Serial.println("Si a continuacion pone OK ->> El dispositivo esta listo.");
  Serial.println("En caso contrario ->> El dispositivo no esta en modo AT.");
  Serial.println("Realice el siguiente procedimiento:");
  Serial.println("- Pulse el boton y mantengalo.");
  Serial.println("- Quite VCC del modulo.");
  Serial.println("- Vuelva a alimentar el modulo.");
  Serial.println("- Suelte el boton.");
  Serial.println("- El modulo parapadeara lentamente, indicando que esta en modo AT.");
  Serial.println("- Resetee Arduino.");
  Serial.println("-------------------------------------------------------------------");
}

void loop(){

  if (BTSerial.available())
    Serial.write(BTSerial.read());

  if (Serial.available())
    BTSerial.write(Serial.read());

}

#10
Jan 25, 2015, 05:44 pm Last Edit: Jan 25, 2015, 05:47 pm by biblicalbread
thibaultlieux, Thank you for that code. I have tried every way I've found online and couldn't get my HC-05 to respond. Was going into AT Mode, but would never get any type of response. That code/setup worked perfect. Using UNO and MEGA 2560. I get a response from that setup. Thank you so much

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy