HC-05 not receiving any serial messages through serial bluetooth terminal in my phone

Hi, I'm having a problem with my HC-05 bought recently , I want to control and old RC car with my arduino and HC-05, but when the motors and the hc-05 is connected and try to control de car motors through a bluetooth app in my phone nothing happens!

So I tested my HC-05 to see if is receiving any signal of my phone, I made this connection from UNO to HC-05

5V uno - VIN HC-05
GND uno - GND HC-05
pin 10 uno - tx hc-05
pin 11 uno - rx hc-05

I uploaded this code to UNO to send messages via serial

#include <SoftwareSerial.h>
SoftwareSerial SUART(10, 11); // SRX = 2, STX = 3
#define ledpin 13  //built-in L of UNO

void setup()
{
  pinMode(ledpin, OUTPUT);
  digitalWrite(ledpin, LOW);  //L is OFF
  Serial.begin(9600);
  SUART.begin(9600);
}

void loop()
{
  if (SUART.available())
  {
    char x = SUART.read();
    if (x == 'Y')
    {
      digitalWrite(ledpin, HIGH);  //L is ON
    }
    if (x == 'N')
    {
      digitalWrite(ledpin, LOW);    //L is OFF
    }
  }
  if(Serial.available())
  {
    char c = Serial.read();
    SUART.write(c);
  }
}

The baud rate is 9600 and no line ending, i connect my hc-05 through the serial bluetooth app in my phone, Open the serial monitor in my PC, when I write any word in the SM in my PC I receive the message in the app in my phone, but when i send a message from my phone to serial monitor in my PC, I don't receive anything, I think cause of that I can't control my RC car, my HC-05 is not receiving any signal, I don't know why is happening that, could anybody help me, what I'm doing wrong?, Do you think my HC-05 is broken? Please let me know about it.

Thanks.

How do you know? It may be that you are not receiving 'Y' or 'N'. Put in a serial print to see if anything is coming in and if so, what.

#include <SoftwareSerial.h>
SoftwareSerial SUART(10, 11); // SRX = 2, STX = 3
#define ledpin 13  //built-in L of UNO

void setup()
{
   pinMode(ledpin, OUTPUT);
   digitalWrite(ledpin, LOW);  //L is OFF
   Serial.begin(9600);
   SUART.begin(9600);
}

void loop()
{
   if (SUART.available())
   {
      char x = SUART.read();
      Serial.print("recieved  ");  // ********** is anything incoming?
      Serial.print(x);             // ******** what is it?
      if (x == 'Y')
      {
         digitalWrite(ledpin, HIGH);  //L is ON
      }
      if (x == 'N')
      {
         digitalWrite(ledpin, LOW);    //L is OFF
      }
   }
   if (Serial.available())
   {
      char c = Serial.read();
      SUART.write(c);
   }
}

Please post a schematic or wiring diagram. Written descriptions are always more ambiguous than a drawing. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.

Are you sure that you have HC05? Please post photos front and back and show your wiring.
Is the HC05 paired with your phone?
Is the HC05 connected with the Bluetooth app?
What is the Bluetooth app?

I really like the Bluetooth serial terminal for testing.

Code works fine for me with the Bluetooth serial terminal.


This is the connections i have, The yellow wire is connect in the Vin hc-05 to 5v in arduino, the black wire is ground either both, the blue cable is connect the tx of the hc-05 to pin 10, and the white cable is connect the rx of the hc-05 to pin 11 in arduino.

I'm using the same app you say, my phone is paired with the hc-05, and also connects with the bluetooth app, but like i said, only i can receive messages from SM in my PC to my phone, but when I try to send messages from my phone to SM in my PC, nothing received

I recommend that the HC05 RX pin have the level shifter from 5V (Uno TX) to 3.3V (HC05 RX).
The HC05 input pins are not 5V tolerant.

So if you type something into the serial monitor send window and send, that is what will show up in the Bluetooth serial terminal?

Are you sure of the HC05 baud rate of 9600?
Are you sure that you are sending capital Y an capital N?
Try the 5V beside the ground connections.

I do not see anything wrong and like I said, using, apparently, the same setup, mine is working fine.

Yes, only when I write something in the serial monitor, it show up in the bluetooth terminal app, but in the other way around it doesn't work.

As you can see, I have both NL & CR and 9600 baud, I tried de 5V beside the ground connections, still doesn't work.

Android or apple ?
(HC-05 is not compatible with apple)

Logic level shifters are required when connecting I/O pins on 5V and 3.3V modules. For example

You may already have damaged the Arduino or the HC-05.

Android phone

So how it be the connections? Could you make a diagram?

Follow the link I posted to here.

I posted a schematic in post #4 that is known to work. The resistor voltage divider is much simpler and parts easier to source.

If you run the code in reply#2, that prints incoming data, what do you see in serial monitor?

As I understand it, you are getting one way traffic only.
This suggests a poor connection in Arduino Tx, possibly something to do with the voltage divider. I imagine the device is fine and the code is kosher, even if it is confusing.

nothing occurs, only i can send messages from SM to phone.

But in the other way, nothing appear

exactly only is one way traffic, how can I make the HC-05 in bidireccional mode?

The only way is making a voltage divider?

  1. The Arduino Uno RX is not guaranteed to recognize the HIGH output by a 3.3V device TX.

  2. Connecting TX on the Uno to RX on the 3.3V device can damage one or both devices.

Thus, there are two outstanding reasons for following the rules and using a logic level shifter to connect 5V devices with 3.3V devices.

As I mentioned, you may have already damaged one or both devices, so there is no guarantee that adding the level shifter will help.

Unusually, the PCB designer was trying to help you out here. See the LEVEL:3.3V? That was not meant to be taken as a joke.

Capture

Isn't the Vin(high) 0.6 * Vcc on the mega328 processor? So 3.0V for Vcc = 5V. The resistor voltage divider on the HC05 RX has been used by many people with no issues.

No, certainly not. But it is simple and cheap and it does work.

Marginal, not guaranteed considering that a "3.3V" processor might be running on 3V, with correspondingly reduced high level outputs.

It is a bad idea to count on this working, although it often does. I don't see any point in encouraging beginners to be sloppy, particularly when there is such a cheap solution to the interface problem. Better: use a 3.3V Arduino with 3.3V devices!

I was, and still am, implying that your wiring is slack, but I'm afraid I got it the wrong way round. Using the divider is the standard way of doing this, and it is OK, but check Arduino Rx.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.