Issue: Unable to Connect HC-05 Bluetooth Module to Windows 10 Computer

Hardware:

  • Arduino: Arduino Uno
  • Bluetooth Module: HC-05 (ZC-040)

Problem: I'm having trouble connecting my HC-05 Bluetooth module to my Windows 10 computer. The computer can find the device, but it fails to establish a connection. I've double-checked the wiring and the code, but I'm still facing issues.

Current Setup:

  • Connections:
    • HC-05 TX -> Arduino pin 2 (RX)
    • HC-05 RX -> Arduino pin 3 (TX)
    • HC-05 VCC -> 5V
    • HC-05 GND -> GND
#include <SoftwareSerial.h>

#define RX_PIN 2  // RX pin of BlueTooth Module connected to pin number 2 on the Arduino
#define TX_PIN 3  // TX pin of BlueTooth Module connected to pin number 3 on the Arduino

SoftwareSerial Slave(TX_PIN, RX_PIN);
char BluetoothData;  // Initialize BluetoothData variable

void setup() {
  Serial.begin(19200);  // Serial communication at 19200 baud
  Slave.begin(9600);    // SoftwareSerial communication at 9600 baud
}

void loop() {
  // Check if data is available from Bluetooth module
  if (Slave.available()) {
    BluetoothData = Slave.read();   // Read the incoming data
    Serial.println(BluetoothData);  // Print the incoming data to serial monitor
  }
}

Try the BT sample first, what does it do.

1 Like
SoftwareSerial Slave(TX_PIN, RX_PIN);

You have the parameters the wrong way round. The first once should be the Rx pin and the second the Tx pin

2 Likes

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