HC05 Reliability

Hi all,

I've got a very simple set up with an Arduino Uno connected to an HC05 Bluetooth module. The pin outs are:

VCC of HC05 to 5V on the Arduino
Gnd of HC05 to Gnd on the Arduino
Tx to Rx (pin 10)
Rx to Tx (pin 11)

I have tried with and without a voltage divider on the Rx line and behaviour is the same

What I see is really poor reliability of comms. With a really simple app I get large amounts of bad packets (incomplete or just missing)

An example of code to reproduce this is below

//----------------------------------------------------------------------------------------------------------------------------------
#include <SoftwareSerial.h>             //Bluetooth sensor
//----------------------------------------------------------------------------------------------------------------------------------
#define RX_PIN 10
#define TX_PIN 11
//----------------------------------------------------------------------------------------------------------------------------------
SoftwareSerial  BTserial(RX_PIN, TX_PIN);                       //RX, TX
//----------------------------------------------------------------------------------------------------------------------------------
void setup()
{
    pinMode(RX_PIN, INPUT);
    pinMode(TX_PIN, OUTPUT);
 
  BTserial.begin(9600);
  BTserial.print("Bluetooth starting");
}
//----------------------------------------------------------------------------------------------------------------------------------
void loop()
{
    BTserial.println("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    delay(1000);
}
 

What I receive is sometimes the full alphabet, and more often than not, partial strings from within it. I've tried with 5 second delays between sending and it's the same. I've tried small packets, and big packets, all have lost characters.

I have no issue pairing the Bluetooth module to a phone or a PC, I have tried with off the shelf terminal programs, my own terminal program, and android apps, the behaviour is identical in all of them.

I have tried a couple of different modules and they behave the same, I've even tried it on a Mega and that is the same too.

So am I missing something or any thoughts on how I could improve this?

Provide Clear Documentation: Since we can’t see your project, share an annotated schematic (best) or a clear drawing of your setup. Pictures are welcome, but avoid using Fritzing diagrams as they are wiring diagrams, not schematics, and are not ideal for troubleshooting.

Include Technical Details: If there is specific hardware involved, include links to technical information. There are often many versions of similar components, so precise details are essential.

I described literally all of the 4 pins. If you can't understand that then you're probably not able to help.

You have probably damaged the HC05, and possibly also the Arduino TX output pin.

HC-05 I/O is 3.3V only and a logic level shifter from 5V TX to 3.3V RX is required. It may also be required in the other direction. The best approach is to use one of these bidirectional level shifters on both serial connections.

Even better: switch to a 3.3V MCU.

1 Like

The Arduino is perfectly happy with a 3.3 volt signal on the receiver line, I'm not sure why you reached the conclusion it was damaged

As stated, I tried with the voltage divider and it did the same thing

I did not conclude that, however, damage is very likely.

Have fun, and may you benefit from the learning curve.

Well, thanks for chipping in I guess

But the HC-05 is not happy with 5V on its receiver line. What @jremington is suggesting is that you may have damaged the HC-05 when you tried it without the voltage divider.

I started with the voltage divider, behaviour is the same

Okay, like you infer it's so simple a cave man could do it so I can't fathom what your problem is. Good luck.

1 Like

Yeah thanks

While it is obviously good practice to use a voltage divider, I have never heard of anybody frying their HC-05 by omitting it, and I bet jremington hasn't either. Further, Arduino is just fine with 3.3v signals from Bluetooth, and any suggestions that you need to boost the signal is absurd.
If you get anything at all, your code is clearly kosher. But maybe your wiring isn't, thereby causing intermittent transmission.

A cheapo breadboard, perhaps?

Thank you for my first useful response. I started with just dupont cables from the uno to the bluetooth module and then moved to soldered connections directly

Not that well described.
This is a technical request, not a literal one.

VCC of HC05 to 5V on the Arduino - Putting 5V into a 3V device
Gnd of HC05 to Gnd on the Arduino
Tx to Rx (pin 10) - where to where on what
Rx to Tx (pin 11) - where to where on what

Which one, there is more then one. Post the links to the technical information. Resistor divider from what to what and how?
I will wait for the schematic, good luck.

No it isn't a 3V device, it's VCC is rated at 3.6 to 6 volts, 5V is fine

Tx is on pin 10 to Rx on the HC05, this isn't hard to understand?

I can't actually understand the rest of your post

I understand that having the necessary parts is crucial, but many of us don’t have access to them right now. By not responding to the people who are trying to assist you, you’re only wasting valuable time. I hope you get the answers you need soon. Good luck!

Happy to repond to anyone trying to help

The response tends to be commensurate with the input

From your brief description it sounds like you are transmitting between an Arduino/HC-05 and a terminal program running on a PC or an Android device. Have you tried communicating between two Arduino/HC-05?

I can not confirm your findings. I use Kai Morich's Serial Bluetooth Terminal app on Android. The receive setting is for Newline Cr+Lf.

I always receive the complete alphabet on a line. There are sometimes short delays before the complete line is received, but with a receiving routine looking for an end marker, all is indeed received.

I think on the BT sending side, there are interactions with the Timer0 interrupts used by the Arduino for millis(). The sending is not continuous, but rather asynchronous from a buffer.

No, this is not what I need to achieve