My HC-05 isn't working

Hello I have a little problem here. I have bought HC 05 bluetooth module from Here I have everything connected correctly: RX to TX on board TX to RX on board 5V+ to 5V and GND to GND I'm using arduino UNO board and this code:

define ledPin 7

int state = 0; void setup() { pinMode(ledPin, OUTPUT); digitalWrite(ledPin, LOW); Serial.begin(38400); // Default communication rate of the Bluetooth module } void loop() { if(Serial.available() > 0){ // Checks whether data is comming from the serial port state = Serial.read(); // Reads the data from the serial port } if (state == '0') { digitalWrite(ledPin, LOW); // Turn LED OFF Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON" state = 0; } else if (state == '1') { digitalWrite(ledPin, HIGH); Serial.println("LED: ON");; state = 0; } }

I was following steps on this tutorial: https://howtomechatronics.com/tutorials/arduino/arduino-and-hc-05-bluetooth-module-tutorial/

A problem is that my hc 05 can't switch to AT mode and i can't detect it by any device with bluetooth.

Led on hc 05 blinks little faster than every half second. Maybe every 0.4 sec.

Please help i have tried everything and nothing works :(

Many things are not in the right order in your setup/program. You may carry out the following steps to make your HC05 Module functional.

  1. Check that you have connected the HC05 Module with UNO as per following diagram. The voltage divider circuit is needed as the RX-pin of HC05 is not 5V tolerant. (It is no good that you connect the HC05 Module with Hardware Serial Port which is already engaged with Serial Monitor.)

  2. Is the Red-LED of the BT Module continuously blinking?

  3. Have you installed a Bluetooth Terminal (BTT) in your android based smart phone?

  4. Check that the smart phone has detected your BT Module. If SN is asked, enter 0000 or 1234; they usually work.

  5. Connect your BTT with the BT module. Check that the RED-LED is now blinking once a while.

  6. Upload the following sketch in the flash of your UNO.

#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // SRX | STX
// Connect the HC-05 TX to Arduino pin 2(as SRX).
// Connect the HC-05 RX to Arduino pin 3 (as STX) through a voltage divider.

void setup()
{
 Serial.begin(9600);
 BTserial.begin(9600);
}

void loop()
{
 if (BTserial.available())
 {
   byte x = BTserial.read();
   Serial.write(x);
 }

 if (Serial.available())
 {
   byte y = Serial.read();
   BTserial.write(y);
 }
}
  1. Check the functionality of the communication link:
    BTT <----> BT <----> UNO <----> Serial Monitor

Hi actually that tutorial didn't work for me too :o :o

But I got my HC-05 working using this tutorial

Tutorial on Bluetooth sensor HC-05 with Arduino | Connections & Coding

Hope it helps!

As for the AT command mode, try follow this youtube tutorial

How to set AT Command mode for HC-05 Bluetooth module arduino 2017

https://www.youtube.com/watch?v=NMclHmpvOLEI have tried this but i'm afraid that my hc-05 is damaged because i couldn't detect it at all. I tried BT terminal too but with same result. The led is blinking continuously but when i hold small button on restart to enter AT mode LED blinks every 4 seconds but when i release the button it came back to half second interval. Same when I power pin 34 with 3.3V.

Daniel_K18 don’t be afraid if your module led is blinking then your module work properly.

as you told

  1. if hold small button then led blink 4 sec.

means your BT module enter in AT mode. then you can configure your module like you can change baud rate or password so all.

  1. module led blink 0.5 sec

means module not in AT mode. module in normal mode so you can communicate with other bluetooth device. for normal operation please remove out BT in AT mode. you can do it by repower module. It will automatically come out from AT mode.

please follow step:

  1. I am giving you my github link for programmer.

https://github.com/Ashwinigunjal/smart_light

  1. make connection :

be carefule while connecting RX|TX
SoftwareSerial BTSerial(8, 9); // RX | TX
8-TX BT module , 9 - RX BT module

  1. upload code. download some app

while (BTSerial.available()){

digitalWrite(statusled,HIGH);
data=BTSerial.read(); // read data . so get data according to your app
Serial.print("data: ");
Serial.println(data);
}

hope this will help you.
Thank you.

What app is according to you the best?

I just noticed that TX led on arduino board lights very barely, and RX led on it doesn't light at all.

led for only user indication.

you can try any app from playstore.

It just isn’t working. My HC-05 is undetectable. I will buy new one :frowning:

Daniel_K18: It just isn't working. My HC-05 is undetectable. I will buy new one :(

If you have not done so, Google for Martyn Currey's excellent tutorial about HC-05.

If indeed you have a broken module, buy two the next time.

.

Daniel_K18: It just isn't working. My HC-05 is undetectable. I will buy new one :(

If you buy a new one you will probably get the same result. If the LEDs light, there is a good chance it is OK, nothing you have said suggests the device is faulty, but quite a lot of what you have said suggests you don't know what you are doing. You haven't even said why you need the device in AT mode at all, and it is a fair bet that you don't, so try using it without any AT commands, just like most other people use it. You may even find that the problem is at the Android end, and both Arduino and Bluetooth are entirely innocent.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

or at least confirm your module really is a dud.

After Interfacing BT module with arduino, if it comes in your mobile bluetooth scan list then it work properly.

In mobile bluetooth list you get device name as HC-05.