Interfacing Nodemcu v3 Lolin with HC05

Good afternoon!

I have read a lot of webpages and followed a lot of tutorials on how to interface my Nodemcu v3 Lolin with a module HC-05 but I can't get it to transmit and receive information at the same time.

What is happenning right now is that I can send information to Arduino Serial Monitor OK, but when I send info from the Serial Monitor to the mobile app "Bluetooth Terminal HC-05" I am receiving "ÿÿ"
I am using pins GPIO13 and GPIO 15 (UART2) to connect the HC-05.

  • HC05 TX --> Nodemcu v3 Lolin D7
  • HC05 RX --> Nodemcu v3 Lolin D8
  • Ground and VCC goes to external power source which can supply 5V.

Am I missing something?

This is my current code:

#include <SoftwareSerial.h>

// Define the data transmit/receive pins in Arduino
#define D7 (13)
#define D8 (15)

#define TxD D7
#define RxD D8

SoftwareSerial bluetooth(RxD, TxD); // RX, TX for Bluetooth

void setup() {

  Serial.begin(115200); // For Serial Monitor
  bluetooth.begin(38400); // For Bluetooth

}

void loop() {


  if(Serial.available()) {
    bluetooth.write(Serial.read());
  }

  if(bluetooth.available()) {
    Serial.write(bluetooth.read());
  }

}
HC05 TX --> Nodemcu v3 Lolin D7
HC05 RX --> Nodemcu v3 Lolin D8

#define TxD D7
#define RxD D8

SoftwareSerial bluetooth(RxD, TxD); // RX, TX for Bluetooth

The software serial constructor is from the point of view of the Node MCU.

The HC05 Tx should go to the the software serial Rx(D8) and the HC05 Rx should go to the software serial Tx(D7).

I'm not clear that you are properly cross connected.

I also recommend the Kai Morich Serial Bluetooth Terminal app.
https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en_US&gl=US

Hi @cattledog! Thanks for your answer.

It was connected as you said, I misspelled in my first post.
This is my current connection:

I used the app from Kai Morich to do my tests. I still have the same issue, any idea?:

Are your really using a 9v pp3 battery?

If so this is wrong . First the Vcc of the module is 5v.
Second, its not clear that it can supply the current for the Tx.

Can you run your tests with the Node MCU connected to USB for power and power the HC05 from the VU (VUSB) pin?

A separate 5v supply, like from a phone charger would be best.

Connect the grounds between the HC05 and the Node MCU.

I don't have some things in the Fritzing app. I am using a 5V converter to feed the HC 05 and am using a USB connector to feed the Nodemcu board.

Something you said made it work, I added the ground connection from the HC05 to the Nodemcu, and It worked! THANK YOU!

I leave a live photo to clarify the connection (there is an accelerometer because I am going to use it too, but that was already working with my main code):

I will upload the Fritzing when I have it finished.

Great news.

You might consider using an ESP32 for you project. It has integrated Bluetooth.

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