0
0
Arduinoprogramming~20 mins

Bluetooth with HC-05/HC-06 module in Arduino - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bluetooth Mastery with HC-05/HC-06
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output on Serial Monitor?
Consider this Arduino code using HC-05 Bluetooth module. What will be printed on the Serial Monitor when the module receives the character 'A' from a paired device?
Arduino
void setup() {
  Serial.begin(9600); // Serial Monitor
  Serial1.begin(9600); // HC-05 module
}

void loop() {
  if (Serial1.available()) {
    char c = Serial1.read();
    if (c == 'A') {
      Serial.println("Received A");
    } else {
      Serial.println("Other char");
    }
  }
}
AReceived A
BOther char
CNo output
DCompilation error
Attempts:
2 left
💡 Hint
Check what happens when Serial1 reads 'A'.
Predict Output
intermediate
2:00remaining
What will be the output of this code snippet?
This Arduino sketch reads data from HC-06 module and echoes it back. What will be printed on Serial Monitor if the paired device sends 'Hello'?
Arduino
void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  while (Serial1.available()) {
    char c = Serial1.read();
    Serial.print(c);
    Serial1.print(c);
  }
}
ANo output
BolleH
CHello
DCompilation error
Attempts:
2 left
💡 Hint
Look at how characters are read and printed.
Predict Output
advanced
2:00remaining
What error does this code produce?
This code tries to initialize HC-05 module but has a mistake. What error will occur when compiling?
Arduino
void setup() {
  Serial.begin(9600);
  Serial1.begin(38400); // Missing semicolon fixed
}

void loop() {}
ASyntaxError: missing semicolon
BTypeError: wrong baud rate
CNo error, runs fine
DRuntime error: Serial1 not found
Attempts:
2 left
💡 Hint
Check punctuation at the end of lines.
🧠 Conceptual
advanced
1:30remaining
Which statement about HC-05 and HC-06 modules is correct?
Choose the correct statement about HC-05 and HC-06 Bluetooth modules.
AHC-06 can act as master or slave; HC-05 only as slave
BBoth HC-05 and HC-06 can only act as master
CBoth HC-05 and HC-06 can only act as slave
DHC-05 can act as master or slave; HC-06 only as slave
Attempts:
2 left
💡 Hint
Think about flexibility of module roles.
🚀 Application
expert
2:30remaining
How many bytes will be stored in buffer after this code runs?
Given this Arduino code snippet reading from HC-05, how many bytes will be stored in the buffer array after receiving the string 'BT123'?
Arduino
char buffer[10];
int index = 0;

void loop() {
  while (Serial1.available()) {
    char c = Serial1.read();
    if (c == '\n') break;
    buffer[index++] = c;
  }
}
A6
B5
C4
D0
Attempts:
2 left
💡 Hint
Count characters before newline.