UNO and Bluetooth HC06 AT commands

Hello,

I'm using a Arduino Uno + HC06 (Bluetooth module)

My project is now fishished and I'm able to communicate with my Arduino through an application developed on Android. Everything is working well :)

My only issue is... since the begegning of my project, I'm not able to send AT command to the HC06 to configure it :(

  • My serial is working because tested with BT communication
  • My HC06 is not connected (its led is blinking)

I've tried;

  • all speeds 1200 to 115200. For BT communication, I discovered my HC06 is using 38400 Bauds by default.
  • with and without CR LF
  • Lower and Upper cases

The HC06 never answer to any AT commands and more... I read the HC06 led bliking duration can change when AT commands received but on my side, the blinking is regular and never change. Does it mean it never receives anything?

I'm lost but I don't want to keep the HC06 default name and PIN... :confused:

Hi,

Lots of INFO HERE

And here is a utility sketch to use for setup:

Thanks for your help Terry but this page is dedicated for HC05.
On my HC06 I haven’t any KEY pin.

I have:

  • STATE: Not solded
  • RX: Solded
  • TX: Solded
  • GND: Solded
  • +5V: Solded
  • EN: Not solded

blob13: On my HC06 I haven't any KEY pin.

And you don't need one either. The HC-06 is in AT mode by default until something connects to it - hence only four pins. Use 9600 only, irrepective of the speed used for comms.

Hello,

Yes, it was my understanding but even at 9600 without using any specific pin, my HC06 never answer. My previous post was for Terry who gave me a link to details about HC05 module.

I'm stuck...

Terry should know better. Check the Martyn Currey website. He is the guru that really knows what configuring is all about.

I am surprised your HC-06 is communicating at 38400 by default but, be that as it may, it is configured at 9600. The fact that you have it working means that your wiring is kosher, and the four pins confirms it is indeed an HC-06. I believe the LED flash changes to slow (0.5Hz) on confirmation of AT command, but I'm afraid I can't remember.

Terry should know better. Check the Martyn Currey website.

Hi, Please give a link to that site??

I found this one... http://www.martyncurrey.com/hc-06-hc01-comv2-0/#more-3424

terryking228:
Hi, Please give a link to that site??

Yes, see above. Martyn has a swag of bluetooth stuff, and presents it well. You may be aware that I have some notes on basic Bluetooth<>Android at
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino
but, for configuration, I just use a one-shot off a Mega, and I really refer all that stuff to Martyn rather than write about it myself.

I have already read this pdf but without any solution to my issue.

I recommend posting a picture of your physical wiring and BT module. You should also try using the following code from Martyn’s website:

// Basic Bluetooth sketch HC-06_01
// Connect the Hc-06 module and communicate using the serial monitor
//
// The HC-06 defaults to AT mode when first powered on.
// The default baud rate is 9600
// The Hc-06 requires all AT commands to be in uppercase. NL+CR should not be added to the command string
//
 
 
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
// Connect the HC-06 TX to the Arduino RX on pin 2. 
// Connect the HC-06 RX to the Arduino TX on pin 3 through a voltage divider.
// 
 
 
void setup() 
{
    Serial.begin(9600);
    Serial.println("Enter AT commands:");
 
    // HC-06 default serial speed is 9600
    BTserial.begin(9600);  
}
 
void loop()
{
 
    // Keep reading from HC-06 and send to Arduino Serial Monitor
    if (BTserial.available())
    {  
        Serial.write(BTserial.read());
    }
 
    // Keep reading from Arduino Serial Monitor and send to HC-06
    if (Serial.available())
    {
        BTserial.write(Serial.read());
    }
}

blob13: I have already read this pdf but without any solution to my issue.

Perhaps because you did not read the appendix that said go see Martyn Currey........

Hello, find attached a picture of my wiring. I tried it with the sketch you've posted with the same result.

@Nick: What do you mean by "perhaps because..."?

Sorry , my picture was too big

2017-06-18 09.27.12_resized.jpg

Is somebody has checked my wiring?

Yes, your wiring is bad. The resistor divider connections are all in the wrong place. One resistor doesn't even seem to be connected to any part of the circuit at all! In short, the Arduino TX isn't connected to the Bluetooth's RX.

Yes, your wiring is bad. The resistor divider connections are all in the wrong place. One resistor doesn’t even seem to be connected to any part of the circuit at all! In short, the Arduino TX isn’t connected to the Bluetooth’s RX.

Are you sure?
Find attached my picture but with details because not so readable…

Arduino D2 (RxD) ->(Grey wire)-> HC06 TxD
Arduino D3 (TxD) ->(Blue wire)-> R1 (1k) ->(Brown wire)-> HC06 RxD
→ R2 (2k) ->(White wire) → Arduino GND
HC06 Vcc ->(Red wire)-> Arduino +5v
HC06 GND ->(Black wire)->(White wire)-> Arduino GND

Is there a mistake?

2017-06-18 09.27.12_resized_clear.jpg

In add, my real application is working. I can use the HC06 through Bluetooth communication. So, RxD and TxD are correctly connected. It's my assumption

Only the HC06 setting through AT commands is not working :(

So, I see nobody can help me... :-(

The problem is your HC-06 cheap module, I have that variant and AT commands is not working.