akaruikage
akaruikage

Reputation: 141

ZS-040 (HC-05) Bluetooth module doesn't respond to AT

Hello,

so I have bought a ZS-040 HC-05 Arduino Bluetooth module and I want to change its name. I've learned, that you have to do that in AT Mode. I followed all instructions at

http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-at-mode/

I succesfully entered the AT Mode (Red LED is Blinking every 2 Seconds), but when I enter AT into the Serial Monitor, i get nothing.

This is my Arduino Code (preaty much exactly the same as described in that article)

#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX

char c = ' ';

void setup() 
{
   Serial.begin(9600);
   Serial.println("Arduino is ready");
   Serial.println("Remember to select Both NL & CR in the serial monitor");

   BTserial.begin(38400);  
}

void loop()
{

   if (BTserial.available())
   {  
      c = BTserial.read();
      Serial.write(c);
   }

   if (Serial.available())
   {
      c =  Serial.read();
      BTserial.write(c);  
   }

}

Everything is connected as described in Method 1 (Other Methods doesn't work for me). I've set the Serial Monitors Baud to 9600 and to Both NL and CR.

If someone has experiense with this problem and solved it, please help :)

Thank you all very much!

Upvotes: 3

Views: 5027

Answers (1)

AwesomeJ0sh
AwesomeJ0sh

Reputation: 66

I struggled with this for a while.

  1. Upload a blank sketch (void setup(){} void loop(){})
  2. Attach bluetooth module RX to RX on the Arduino (pin0) and TX to TX (pin1)
  3. Insert ground wire from Bluetooth to G on the Arduino and EN to 3.3v
  4. Power the Arduino
  5. Insert the VCC from Bluetooth into 5v while holding down the small button on the bluetooth.
  6. Bluetooth should have a very slow blink now, indicating it is in command mode.
  7. Open the serial monitor on your computer. Set the baud rate to 38400. You will be able to test the connection by typing 'at'. It should respond 'OK' - try typing 'at' a second time if the first time receives an error.

the reason why this connection works is because 0 and 1 pins are used by the serial monitor when communicating with the Arduino. No program is need because it is the default connection when the monitor is opened.

I hope this helps.

Upvotes: 1

Related Questions