HC-05 Bluetooth module not receiving data through serial (Arduino Due)

Hey everyone,

I am using this tutorial:

I am simply trying to switch on an LED through bluetooth using the HC-05. I want to use the app that they use in the guide from howtomechatronics.

I can connect my phone with the HC-05 and i can also select the HC-05 in their app, but when I try to turn on the LED using the buttons in the app, nothing happens. The HC-05 is blinking 2 blinks every two seconds.

I tried changing the communication baud rate to 9600 but that didn't work.
I tried this with 4 different HC-05's but none of them received the signal.
I tried putting the rx/tx in different rx/tx pins (pins 14 through 19 and 0 - 1 are the serial pins on the due), no luck.
I tried using the computer program they used in the tutorial, but no luck there either (BT connection works fine though)

So the problem probably lies with the serial communication?

I hope someone can help me! I am stumped...
Thanks in advance.

Below I posted the code that I used, taken directly from the tutorial.

#define ledPin 7
int state = 0;

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
  Serial.begin(38400); // Default communication rate of the Bluetooth module
}

void loop() {
  if(Serial.available() > 0){ // Checks whether data is comming from the serial port
    state = Serial.read(); // Reads the data from the serial port
 }

 if (state == '0') {
  digitalWrite(ledPin, LOW); // Turn LED OFF
  Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
  state = 0;
 }
 else if (state == '1') {
  digitalWrite(ledPin, HIGH);
  Serial.println("LED: ON");;
  state = 0;
 } 
}

The code is probably rubbish. The default comms rate is 9600, and you should stick with that until all other options are exhausted. You are right to move the serial off pins 0,1. I assume you altered the code accordingly. Due is a 3.3v device. This means the resistor divider is redundant, and may even be the problem, as it means the Tx signal would be 2.2v, which may not be enough for HC-05. Your first bet is to get rid of the resistors - if you haven't already done so.

Thank you for your reply! I think the problem is either the wrong serial pins or the resistors. Like you mentioned. I will try it out when I get around to it!