HC-05 Bluetooth RX Not working

I am trying to get an HC-05 bluetooth module to work with an Arduino Micro.

Basically, I can send information from my desktop, and it is received/displayed on my phone. Sending from my phone to the arduino bluetooth doesn't work.

Below is the details. I will post some code and photos of the configuration shortly. Thank you for your time!

--

The Arduino is connected to my linux desktop.

Configuration:
Linux desktop, using Arduino IDE

Arduino Micro connected by USB to Desktop

Bluetooth module connected to Arduino
Arduino 5V -> Bluetooth VCC
Arduino Ground -> Bluetooth Gnd
Arduino Pin 2 (set as RX) -> Bluetooth TX
Arduino Pin 3 (set as TX) -> Bluetooth RX

Arduino Software Serial to use pins 2 and 3

What Works:

  • I can pair with the HC-05 bluetooth with my phone or other bluetooth capable devices
  • I can use the serial monitor, or another com program on my desktop to SEND information that is received by the bluetooth device and displayed (Arduino TX -> Bluetooth RX)

What doesn't work:

  • Sending information from bluetooth device to Arduino, either trying to turn a light on or off on the arduino, or seeing the input in a com program on the desktop.

What I tried:

  • Connecting bluetooth to 3.3v on arduino
  • Using resistors to pull down the TX and RX lines to 3.3v
  • Connecting the bluetooth module to an FTDI adapter directly to my desktop, with same results.

Here is the code I copied from somewhere:

#include <SoftwareSerial.h>

#define rxPin 2
#define txPin 3

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

void setup() {
  Serial.begin(9600);   
  Serial.println("Goodnight moon!");

  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop(){
  while(mySerial.available()){
    myChar = mySerial.read();
    Serial.print(myChar);
  }

  while(Serial.available()){
   myChar = Serial.read();
   mySerial.print(myChar);
  }
}

ninsei7:
What I tried:

  • Connecting bluetooth to 3.3v on arduino
  • Using resistors to pull down the TX and RX lines to 3.3v
  • Connecting the bluetooth module to an FTDI adapter directly to my desktop, with same results.

You should not need to do any of that.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

which keeps the desktop out of play.

Thank you! Going to the bare bones, I still could not get the arduino micro to work.

Then I tried it on the uno. Bingo!

So I'm not sure what I am doing wrong with the micro - I'll have to read up more. Thank you for the precise information, it helped a lot.

Is this solved? I guess not, as the micro is haywire (or I'm doing something haywire) but in the context of this post the solution was to use an uno.

Thanks again.

And for anyone else looking - I just found that the arduino micro uses Serial1 for the RX/TX lines, instead of serial.

http://forums.adafruit.com/viewtopic.php?f=25&t=35649

Changing the demo code from Nick to use Serial1 made it work on the micro.

This is completely resolved.

Thanks again.

ninsei7:
the arduino micro uses Serial1 for the RX/TX lines, instead of serial.

I'll take that is input. Thank you

I didn't realise you were not using a plain vanilla Arduino

I was probably too verbose in my description and it was easy to miss =)

It was good to go simple, because it made it easier to find where the "problem" was occurring.

Thanks again.