HC-06 (ZS-040) can't receive data from Android, but...

Hi Community,

I have opened a thread already in the german forum (https://forum.arduino.cc/index.php?topic=360969.0). But no answer. I hope I can boost the range… :wink:

I use SoftwareSerial on Port 10,11 with this snippet:

#include <SoftwareSerial.h>

#define rxPin 10
#define txPin 11

SoftwareSerial mySerial(rxPin, txPin); // RX, TX
char myChar ; 

void setup() {
  Serial.begin(9600);   
  Serial.println("Serial-Monitor:");

  mySerial.begin(9600);
  mySerial.println("Arduino -> Android"); 
}

void loop(){

  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());


delay (100);    
}

In the attachments I added a small (and ugly) draft how I connect the HC-06 BT-Modul to the Arduino.

RX,TX needs 3.3V and this is guaranteed. VCC on 5V.

The problem: I send data from Arduino to Android: It works perfect! But the other way don’t work. I can’t receive any data from the Android to the Arduino. No led (TX) is flashing on the Arduino.
Yes, its crossed (RX,TX → TX,RX).

The sample from SoftwareSerial does not work and without SoftwareSerial it does not work too.

Any ideas to get the bug?

I have replaced the breadboard, cables and the HC-06 itself.

Please help although my english is not the best… :wink:

Best Regards,
MiNo

No led (TX) is flashing on the Arduino.

The TX and RX LEDs are controlled by the USB-to-serial converter. You are not using that when communicating with the phone, so of course the RX and TX LEDs don't flash.

Why is there a 10K resistor between the RX pin of the modem and ground? How is the Arduino ever supposed to pull that pin HIGH?

You need a proper level converter between the modem and the Arduino.

Hi PaulS,

mh, if I sending data from Arduino to my connected Android, the rx-led is flashing. So I assumed that the tx-led is flashing on receiving data too.

The resistor is to guaranteed 3.3V on rx and tx on the hc-06-module.

Why is sending data from the arduino possible, but receiving not?

Regards,
MiNo

mh, if I sending data from Arduino to my connected Android, the rx-led is flashing.

No, it is flashing because you are sending data to the Serial instance.

Why is sending data from the arduino possible, but receiving not?

It IS possible to send data from the Arduino to the Android. I do it. It is possible that the Android application is not designed to receive data or is not handling it correctly.

PaulS:
No, it is flashing because you are sending data to the Serial instance.
It IS possible to send data from the Arduino to the Android. I do it. It is possible that the Android application is not designed to receive data or is not handling it correctly.

Heyyy PaulS,

it was a rhetorical question... :wink: I think its possible too. :smiley:

I need help to test it correct if my connection is right (and it looks like correct (hopefully)...

Apps on my Android:

  • BlueTerm
  • S2 Terminal for Bluetooth
  • Bluetooth Terminal

Regards,
MiNo

PaulS:
You need a proper level converter between the modem and the Arduino.

Using a divider is fine and normal practice, but with 2k & 1k and the other way round. Google Techbitar's Arduino site to check this. All those apps should be fine once the devices are paired.

Hi Nick,

thanks for your reply, but imho it no matter whether I use 1K/2K or 10K/20K as divider (I don't have a 2K resistor at this time, hehe).

I will try the circuit from the article.

Regards,
MiNo

[quote ]mho it no matter whether I use 1K/2K or 10K/20K as divider (I don't have a 2K resistor at this time, hehe).o
[/quote]
Yes, the larger res may be OK but get them the right way round

Solved! :slight_smile:

Problem and solution from this post:

Regards,
MiNo

I have the Same problem with both hc-05 and hc-06.
first they worked fine but after 2 day this problem happened

Secret code, huh?