HC05 - not working, any help? (arduino UNO)

Hi! I've read a lot of threads and I have seen a lot of information but none seems to work.

I have two hc05 modules because I want to do a master/slave code, where I will be sending sensors data from one to another, with 2 arduino unos.

The problem is, I'm trying to program them to be master/slave but it's not working.

It is at the AT mode already, with the blinking every two seconds, but when I insert the commands to program it for the master/slave nothing shows up on the serial. I don't know what I'm doing wrong.

I'm connecting the hc05 RX to the 3.3V directly on the arduino. Is that the problem? Shouldn't it be the same as doing a divisor with the 5V?

I don't have a code because I've seen a lot of videos where they do this in empty code.

Thanks in advance

Not directly, I mean, I use a breadboard to connect to the 3.3V.

I also tried the Rx -> Rx , Tx -> Tx and the other way around, Rx -> Tx , Tx -> Rx and nothing.

I don't understand how you can have no code.

Like he did on that video.
A lot of people made videos like that.

Anyways, I've tried this one.

//Caution: Tx of the module is to connec twithpin 10 of the arduino and RX with pin 11
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(1, 0); // TX | RX
void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(115200);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
//Take the string returned by the module and print it
Serial.println(BTSerial.readString());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.println(Serial.readString());
}

The TX signal on the arduino is ON and if I switch the pin 0 and 1 the RX goes on instead.
I have the RX connected to the pin, the 3.3V and GND so I think it's fine.

Anyone can help? I'm also receiving a lot of "???????" when I use this code. I've tried all baud rates.

immpg:
I'm connecting the hc05 RX to the 3.3V directly on the arduino. Is that the problem?

Yes it is, and the code you posted is utter junk. ( You aren't the first person to use it. Never trust a person who can't write properly)

You might find the following background notes useful.

I don't know if you have destroyed the HC-05. I have never heard of anybody doing that before, but it may have survived.

It appears to be ok since it is blinking like it is supposed to and the RX/TX signals on arduino turn ON

I read a lot of things about the pin34, maybe it is the problem, not sure..

Well, it certainly isn't a problem at the moment. The real problem is that you don't know what you are doing. Check the Martyn Currey website about HC05 <> HC0x auto-connect. You may not need pin34.

Mine is the ZS-040 Bluetooth, that's why I refer the pin34 and not the pin27 because that's for FC-114, for what I read.

Anyways, what I want is to connect both modules, the point is I'm not able to make the AT commands work, that's it.

Thanks for your responses

The no code and use of the hardware serial pins to the module pins without cross over ( rx>rx and tx>tx) like in the video worked for this poster. Arduino 2560 with hc05 no AT commands - Project Guidance - Arduino Forum

I think that the use of 3.3v on Vcc in the video is wrong. Vcc should be 5v.

Still isn't working.

I don't know how.

I'm sure the hc05 is in AT mode.
The RX/TX leds on the arduino go on when I connect to the RX/TX from the module.

I'm not sure what I'm doing wrong :confused:

@immpg

OTHER POST DELETED
PLEASE DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn and Use The Forum

It will help you get the best out of the forum in the future.

  • Your OS and version can be valuable information, please include it along with extra security you are using.

  • Always list the version of the IDE you are using and the board version if applicable.

  • Use quote or add error messages as an attachment NOT a picture.

  • How to insert an image into your post. ( Thanks @sterretje )

  • Add your sketch where applicable but please use CODE TAGS ( </> )

  • Add a SCHEMATIC were needed even if it is hand drawn

  • Add working links to any specific hardware as needed (NOT links to similar items)

  • Remember that the people trying to help cannot see your problem so give as much information as you can

COMMON ISSUES

  • Ensure you have FULLY inserted the USB cables.

  • Check you have a COMMON GROUND where required. ( Thanks @Perry)

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102 or FT232 VCP Drivers - FTDI

  • There may be a problem with the board check or remove your wiring first.

  • Remove any items connected to pins 0 and 1.

COMPUTER RELATED

  • Close any other serial programs before opening the IDE.

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE’s as ADMINISTRATOR or your OS equivalent

ARDUINO SPECIFIC BOARDS

  • CH340/341 based clones do not report useful information to the “get board info” button.

  • NANO (Old Types) some require you to use the OLD BOOTLOADER option.

  • NANO (ALL Types) See the specific sections lower in the forum.

  • NANO (NEW Types) Install your board CORE’s.

  • Unless using EXTERNAL PROGRAMMERS please leave the IDE selection at default “AVRISP mkII”.

  • Boards using a MICRO usb connector need a cable that is both DATA and CHARGE. Many are CHARGE ONLY.

CREATE editor install locations.

  • On macOs ~/Applications/ArduinoCreateAgent-1.1/ArduinoCreateAgent.app/Contents/MacOS/config.ini

  • On Linux ~/ArduinoCreateAgent-1.1/config.ini

  • On Windows C:\Users[your user]\AppData\Roaming\ArduinoCreateAgent-1.1

Performing the above actions may help resolve your problem without further help.

Language problem ?

Try a language closer to your native language:

Thanks to all those who helped and added to this list.

immpg:
I don't know how.

Have you checked in the Martyn Currey website? He has the best guidance on HC-05<>HC-0x connection.

I'm sure the hc05 is in AT mode.

If its LED flashes more slowly than it usually does, it is in AT mode. If it doesn't, it isn't.

It's solved.

Finally the AT commands worked out.

I used a simple code which used the 11, 10 and 9 pins and I finally received the OK.

Why it worked? I don't know. I tried it before and nothing

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