HC-05 Module Returning Garbage Values With Arduino Uno LED Test Android App

Hey, thanks for the reply.

So I did what you said. I made a voltage divider to lower the TX signal from the Uno down to 3.3V. And used your program. However I am still getting the junk characters. Is it a problem with the bluetooth module itself? I've attached what I'm getting on the monitor.

Also, when I transmit something over bluetooth to the module, the transmit TX LED flashes for a second on the Arduino Uno board, so it's definitely receiving something..

EDIT: I THINK I MAY HAVE FIXED IT. I edited your code and set the baud rate to 115200 and the serial monitor to the same. I then get the data. Thank you. I'll let you know if anything goes wrong now.

groundFungus:
You cannot use the serial monitor when you have the HC05 connected to hardware serial (pins 0 and 1). Only one device can be connected to a port at a time. Set up a software serial port to talk to the HC05 and then you can use the hardware serial and serial monitor to see what the HC05 sends. There is a software serial library that comes with the IDE. Easy to use but not as good as NeoSoftSerial or AltSoftSerial.

Connecting the HC05 RX directly to the Uno TX is risking damaging the HC05 RX input. Better to use a voltage divider to bring the Uno 5V TX signal down to 3.3V for the HC05.

Here is a quick test code showing how to use software serial. Mind that pin 4 on the Uno goes to the HC05 TX and pin 7 on the Uno goes to HC05 RX through a voltage divider (1K TX to HC05 RX, 2.2K HC05 RX to ground).

#include <SoftwareSerial.h>

SoftwareSerial mySerial(4, 7); // RX, TX

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);

mySerial.begin(9600);
  mySerial.println("Hello, world?");  // send to BT
}

void loop()
{ // run over and over
  if (mySerial.available())
{
    Serial.print(char(mySerial.read()));
  }
  if (Serial.available())
{
    mySerial.write(Serial.read());
  }
}

1 Like