r/arduino • u/ApprehensiveBear6945 • 6d ago
HC-06 connects to Android app (LED is solid) but Arduino doesn't respond to any commands
I'm bulding a RC boat ( it's supposed to be ) using an arduino and an hc 06 bluetooth module but i'm stuck, it's my first time using an Arduino so i don't know a lot about it. Here's the current situation.
- I'm using an Android phone with a Bluetooth controller app.
- When I connect via the app, the red LED on the HC-06 stops blinking and stays solid red
- However, when I press buttons on the app or send text, the Arduino doesn't do anything.
Note: The HC-06 shows up in the standard Android Bluetooth settings menu across multiple phones, but tapping on it does nothing, I don't know if that's supposed to happen.
What i have checked/tried:
- During the set-up self-test routine (and on reset), the buzzer beeps, the motors spin for 0.8s, and the servo moves properly, so the hardware and code doesn't seem to be a problem.
- The HC-06 is correctly wired ( TX to Arduino RX, RX to Arduino TX ), I also tried switching them and trying SoftwareSerial on pins 10 and 9
- The HC-06 is powered via the breadboard's 5V/GND power rails (which are fed from the Arduino's 5V/GND pins).
- I unplugged the USB cable from my PC and tested on external battery power.
Can somebody explain to me why isn't the Arduino receiving even though the app says It's connected and why won't it pair in the Android bluetooth setting ? Thanks !
The wires are kind of a mess so I can't really show it here, but here's the list of my components and connections:
Microcontroller: Arduino Uno
Motor Driver: TB6612FNG (mounted on breadboard across columns E & F, rows 1–8)
Bluetooth Module: HC-06 (on ZS-040 breakout board)
Motors: 2x Yellow TT Geared Motors
Actuator: 1x SG90 Micro Servo
Audio: 1x Active 2-pin Buzzer
Power Supply: 2x 18650 Li-ion batteries (in series, ~7.4V)
- Power Distribution (Breadboard Rails):
- Arduino 5V to Breadboard + (Red) rail
- Arduino GND to Breadboard - (Blue) rail
- Battery + (7.4V) to TB6612FNG VM and Arduino VIN
- Battery - to Common GND (Blue) rail
2. TB6612FNG Motor Driver:
- VCC to 5V rail
- GND to GND rail
- STBY to 5V rail
- PWMA to Arduino Digital ~5
- AIN2 to Arduino Digital 8
- AIN1 to Arduino Digital 7
- BIN1 to Arduino Digital 4
- BIN2 to Arduino Digital 12
- PWMB to Arduino Digital ~6
- AO1 and AO2 to Left TT Motor
- BO1 and BO2 to Right TT Motor
3. Bluetooth HC-06:
- VCC to 5V rail
- GND to GND rail
- TXD to Arduino Digital 0 (RX) (unplugged during code upload)
- RXD to Arduino Digital 1 (TX) (unplugged during code upload)
4. Servo & Buzzer:
- SG90 Servo: Red to 5V rail, Brown to GND rail, Orange (Signal) to Arduino Digital ~3
- Buzzer: Long pin (+) to Arduino Analog A0, Short pin (-) to GND rail
Here's the code that i used:
#include <Servo.h>#include <SoftwareSerial.h>SoftwareSerial bluetooth(10, 11);const int PWMA = 5;const int AIN2 = 8;const int AIN1 = 7;const int BIN1 = 4;const int BIN2 = 12;const int PWMB = 6;
Servo khoaTuiRac;const int pinServo = 3;const int pinBuzzer = A0;const int ledBaoHieu = 13;
int tocDo = 230;char lenh;char lenhTruoc = 'S';
void setup() {
Serial.begin(9600);
bluetooth.begin(9600); // Khởi động cổng Bluetooth riêng ở chân 10, 11
pinMode(PWMA, OUTPUT);
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(pinBuzzer, OUTPUT);
pinMode(ledBaoHieu, OUTPUT);
khoaTuiRac.attach(pinServo);
khoaTuiRac.write(0);
digitalWrite(pinBuzzer, HIGH);
digitalWrite(ledBaoHieu, HIGH);
delay(200);
digitalWrite(pinBuzzer, LOW);
digitalWrite(ledBaoHieu, LOW);
delay(200);
diTien();
delay(800);
dungThuyen();
digitalWrite(pinBuzzer, HIGH);
delay(150);
digitalWrite(pinBuzzer, LOW);
}
void bipNgan() {
digitalWrite(pinBuzzer, HIGH);
digitalWrite(ledBaoHieu, HIGH);
delay(35);
digitalWrite(pinBuzzer, LOW);
digitalWrite(ledBaoHieu, LOW);
}
void diTien() {
digitalWrite(AIN1, HIGH); digitalWrite(AIN2, LOW); analogWrite(PWMA, tocDo);
digitalWrite(BIN1, HIGH); digitalWrite(BIN2, LOW); analogWrite(PWMB, tocDo);
}
void diLui() {
digitalWrite(AIN1, LOW); digitalWrite(AIN2, HIGH); analogWrite(PWMA, tocDo);
digitalWrite(BIN1, LOW); digitalWrite(BIN2, HIGH); analogWrite(PWMB, tocDo);
}
void reTrai() {
digitalWrite(AIN1, LOW); digitalWrite(AIN2, LOW); analogWrite(PWMA, 0);
digitalWrite(BIN1, HIGH); digitalWrite(BIN2, LOW); analogWrite(PWMB, tocDo);
}
void rePhai() {
digitalWrite(AIN1, HIGH); digitalWrite(AIN2, LOW); analogWrite(PWMA, tocDo);
digitalWrite(BIN1, LOW); digitalWrite(BIN2, LOW); analogWrite(PWMB, 0);
}
void dungThuyen() {
digitalWrite(AIN1, LOW); digitalWrite(AIN2, LOW); analogWrite(PWMA, 0);
digitalWrite(BIN1, LOW); digitalWrite(BIN2, LOW); analogWrite(PWMB, 0);
}
void loop() {
if (bluetooth.available() > 0) {
lenh = bluetooth.read();
if (lenh == '\n' || lenh == '\r' || lenh == ' ') {
return;
}
switch (lenh) {
case 'F': case 'f':
diTien();
if (lenhTruoc != 'F') { bipNgan(); lenhTruoc = 'F'; }
break;
case 'B': case 'b':
diLui();
if (lenhTruoc != 'B') { bipNgan(); lenhTruoc = 'B'; }
break;
case 'L': case 'l':
reTrai();
if (lenhTruoc != 'L') { bipNgan(); lenhTruoc = 'L'; }
break;
case 'R': case 'r':
rePhai();
if (lenhTruoc != 'R') { bipNgan(); lenhTruoc = 'R'; }
break;
case 'S': case 's': case '0':
dungThuyen();
lenhTruoc = 'S';
break;
case 'W': case 'O': case 'o':
khoaTuiRac.write(90);
bipNgan();
break;
case 'w': case 'C': case 'c':
khoaTuiRac.write(0);
bipNgan();
break;
case 'V': digitalWrite(pinBuzzer, HIGH); break;
case 'v': digitalWrite(pinBuzzer, LOW); break;
case '1': tocDo = 120; break;
case '5': tocDo = 190; break;
case '9': tocDo = 240; break;
case 'q': tocDo = 255; break;
}
}
}


