Bluetooth HC-05 connected to HC-06. Standalone. Turn on/off LED. Experiment

Hello friends,

in this tutorial Martyn Currey manages to use a Bluetooth HM-10 (BLE) in stand-alone mode, that is, without Arduino or any other device, to turn on/off an LED.
HM-10 stand-alone: Remote control an LED using MODE2:

I have tried it with a Bluetooth HC-05, but I have not succeeded.
For it to work for me I had to accompany the HC-05 with an HC06. Here is my experience.

1 Like

1.- Bluetooth HC-05. AT commands.

HC-05 Bluetooth modules contain an MCU.
It has PIO terminals.
Image from (Datasheet):

  • I wanted to make the following montage. I soldered a wire to the PIO5.
    I wanted to turn on the LED from the app using AT commands.
    But it didn't work for me.

I tried other methods.

2.- HC-05. Arduino. AT commands. Turn on/off LED PIO5.

Turn on/off LED PIO5 from Serial Monitor.

#include <SoftwareSerial.h>
SoftwareSerial BT(10,11);
void setup()
void loop(){ 
  if(BT.available()) {Serial.write(;}

We must put the module in Mode 2:

To program in Mode 2, we remove the red wire (5 V) from the module's power supply. We press the small button on the module. We connect the red wire to 5 V by holding down the button. When the red wire is connected, we release the button.

The module's LED will blink slowly.

[In Mode 2 the module always receives the AT information at 38400]

  • Serial Monitor. Both NL & CR. 38400 bauds.

  • We write the following codes, the LED (PIO5) will turn off and on.


3A.- App to HC-06 to HC-05. AT commands. Turn on/off LED in HC-05. (I)

  • HC-05 in Mode 2. [38400 bauds]
  • We must set the HC-06 to 38400 so that it can communicate with the HC-05.

- Baud rate change on the HC-06:

#include <SoftwareSerial.h>
SoftwareSerial BT(10,11); // TX to pin_10. RX to pin_11 of Arduino.

void setup() {

void loop() {
    if(Serial.available()) {   
    String command = Serial.readStringUntil('\n');
   if (BT.available()){
   String retorno = BT.readStringUntil('\n');
  • Serial Monitor with New line.


Now HC-06 in 38400 baud.

1 .. 1200
2 .. 2400
3 .. 4800
4 .. 9600
5 .. 19200
6 .. 38400
7 .. 57600
8 .. 115200

All ready, we continue...

3B.- App to HC-06 to HC-05. AT commands. Turn on/off LED in HC-05. (II)

p9_Bluetooth_HC_05_AT.aia (2.5 KB)

App connects via Bluetooth with the HC-06.
App sends AT commands to the HC-06.
The HC-06 sends those AT commands to the HC-05.
Turns on/off the LED (PIO5).


5.- Comments.

  • In the HC-05 data sheet you can see other AT commands.
  • We can also use two HC-05.
  • Watch out! Remember, if you have done all of this setup, the HC-06 has been set to 38400 baud. If you are going to use it for other settings, change it back to 9600 baud.