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());
}
}
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):