Bluetooth HC-05(ZS-040) not found by Android phone

Hello, guys!

I managed to set the HC-05 name to “Smartplant” and for a few minutes, the phone found it. (I am using a 4.4.2 version Android.) But now it can’t be discovered.

How do I have to connect the module to an Arduino Mega 2560? Do I have to upload some code on the board in order to get access from the phone?

Edit: How should I set my bluetooth in AT mode if I want it to send a *.txt file from Arduino to an Android app?

Edit2: Also tested with an 7.1.1 version Android phone and 4.2.2.

Martyn Currey has an excellent tutorial.
I suggest you Google for it.

.

ieee488:
Martyn Currey has an excellent tutorial.
I suggest you Google for it.

I have already tried that. It seems to work now (AT mode) with Flash Magic. I get response from some commands like AT, AT+RESET, AT+VERSION?, AT+NAME... but I can't run AT+ORGL

This is how I did it:

Connections:

Bluetooth EN --> 3.3V
Bluetooth RX --> Arduino RX (pin0)
Bluetooth TX --> Arduino TX (pin1)
Bluetooth VCC --> 5V
Bluetooth GND --> GND

After this I powered Arduino board.

These are my responses:

link to image

I managed to set the HC-05 name to “Smartplant” and for a few minutes, the phone found it. (I am using a 4.4.2 version Android.) But now it can’t be discovered.

How do I have to connect the module to an Arduino Mega 2560? Do I have to upload some code on the board in order to get access from the phone?

The way I see it there is a two step process for the smart phone and the HC-05. No arduino required for these two steps.

First there is some sort of basic bluetooth protocol level where the phone finds the HC05 and pairs with it. This through the bluetooth settings on the phone, not an app. If unpaired, you should see it as an available device, tap, enter the pin code (1234?) and the HC05 should move from an available device to a paired device. If already paired it will show as a paired device

Once the phone and the module are paired, there is the process of connection to a phone app, like a bluetooth terminal program. I use Kai Morich’s Bluetooth Serial Terminal https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en_US
The app should prompt for the connection, show connected, and the light on the module should flash twice every two seconds.

The module should be in normal communications mode not AT mode.

If you want the app to communicate with the Arduino, then software needs to be written for the Arduino to communicate with the bluetooth module over either hardware of software serial.

Can you get the phone paired with the module? Can can you get a terminal program connected to the module?

grrigore:
How do I have to connect the module to an Arduino Mega 2560? Do I have to upload some code on the board in order to get access from the phone?

No

Edit: How should I set my bluetooth in AT mode if I want it to send a *.txt file from Arduino to an Android app?

You don’t need any AT commands to do that. Indeed to use bluetooth, you may never need any AT commands, ever.

Bluetooth RX → Arduino RX (pin0)
Bluetooth TX → Arduino TX (pin1)

Wrong. Transmitters transmit to receivers, and receivers receive from transmitters
Tx>Rx Rx<Tx

Note also that it is a good idea to use a 1k/2k divider in Arduino Tx line. Also, since you are using a Mega, you will be better off using Serial1 pins 18,19.

grrigore:
How do I have to connect the module to an Arduino Mega 2560?

grrigore:
Connections:
Bluetooth EN → 3.3V
Bluetooth RX → Arduino RX (pin0)
Bluetooth TX → Arduino TX (pin1)
Bluetooth VCC → 5V
Bluetooth GND → GND

Why do you parallel-connect the BT module to the USB<>Serial pins, while you have three unused serial pins available.
Use serial1 (pin 18,19), or any of the other hardware serial pins.

EN can be left unconnected.

The RX pin needs to be level-shifted with a voltage divider (1k:2k2).
Leo…

@grrigore
I am really trying to understand why you started your bluetooth experience with an AT adventure and have an ongoing focus on AT mode?

These modules should work out of the package. Did someone previously use the module, and you are trying to get it back to defaults. Are you trying to change some operational parameters?

Thanks for the recommendations. Unfortunately, I couldn’t get to you until now.

cattledog:
@grrigore
I am really trying to understand why you started your bluetooth experience with an AT adventure and have an ongoing focus on AT mode?

http://forum.arduino.cc/index.php?topic=546523.msg3725616#msg3725616

These modules should work out of the package. Did someone previously use the module, and you are trying to get it back to defaults. Are you trying to change some operational parameters?

When I first connected the Bluetooth my mobile phone couldn’t find the module, so I read on the internet that with AT mode I can set up my HC-05. Hoping this will solve my problems I tried to bring it in AT mode and run AT+ORGL to restore default configurations.

I don’t know if I affected the module while trying to connect it for the first time or “playing” with it… but it didn’t work out of the package. (it was a brand new one)

Yes, I’m trying to bring it to the defaults or set it up so I can connect with my phone.

Nick_Pyner:
NoYou don’t need any AT commands to do that. Indeed to use bluetooth, you may never need any AT commands, ever.Wrong. Transmitters transmit to receivers, and receivers receive from transmitters
Tx>Rx Rx<Tx

Note also that it is a good idea to use a 1k/2k divider in Arduino Tx line. Also, since you are using a Mega, you will be better off using Serial1 pins 18,19.

Thanks for the pieces of advice. I’ll give it a shot later this day and come back with the result.

Wawa:
Why do you parallel-connect the BT module to the USB<>Serial pins, while you have three unused serial pins available.
Use serial1 (pin 18,19), or any of the other hardware serial pins.

EN can be left unconnected.

The RX pin needs to be level-shifted with a voltage divider (1k:2k2).
Leo…

Thank you, Leo! As I mentioned I’ll try this later this day.

This is the tutorial I followed and he is using an Arduino Uno, so I hope pins 18,19 will solve my problem.

IMPORTANT EDIT: it seems to be an hm-10 according to this post (I want to mention that it was named HC-05 on the shop & it has zs-040 on it’s back)

The easiest distinction between the two is that HC-0x have two large chips and HM-10 one. The same comments about AT mode, serial ports, and wiring apply.