I am trying to send data from an android device by bluetooth to my arduino nano. I followed a few tutorial and seem to be stuck and lost.
What i have done so far :
I bought this module :
I liked it because it has a 5v input.
Have a basic app on the arduino that reads the Serial port and prints whatever it reads to the Serial monitor. Tested and working.
Wrote an android app that connects and sends a string/character over the serial port. Seems to be working.
I connected the TX pin from the BT to the nano's RX pin and expect to see whatever is coming from the android app. But nothing.
What I have tried to do so far :
I connected an oscilloscope to a nano's RX pin. It shows 5V and when I send a char from the Serial monitor I can clearly see the 5V dropping to 0V and raising.
Sending a "0" looks like this ------.---..---.-------.
Then connected the oscilloscope to the TX pin of the BT. Its exactly the same, except that it is at 3.3v. Sending a "0" from the android app gives me the exact same pattern as the Serial monitor.
Plugging the TX pin of the BT into the RX pin of the nano and again sending "0" from the android app I see the same pattern, except that it does not drop all the way to 0v. It looks like it drops to 2v.
Can this be why i am not getting this to work. Does the RX pin need to drop all the way to 0 to register as LOW. I see other people just plugging in the TX into RX and having no problems.
I am not particularly familiar with nano but aren't you using TX and RX pins on nano for both bluetooth and serial connectivity with the computer ??
Try to connect the module to some other pins on arduino - you'll need to use software serial (don't forget you need to have TWO serials in your code - hardware one for sending data to the computer and software serial for communication with the BT module)
From what I understand you can connected "some thing else" to the rx pin of the arduino boards and as long as the baud rate is correct you can send data to it.
So if it is coming from the PC by the serial port or from the Bluetooth's TX pin, it should look the same.
I will try the second Serial as you point out and pretty sure it will work as I did put the TX of the BT on a interrupt and found it does change.
I was just hoping i could get away by using the two pins of the arduino, rx and tx directly.
Will post my results tomorrow
As Kerimi pointed out it works on other pins.
You most likely fried your HC05 like I did if you connected your nano directly to the RxD pin of the HC05. Although the board has a 3.3v regulator, the RxD and TxD requires a level shifter or a voltage divider to drop the nano's 5v to 3.3v. Mine worked for a few minutes and stopped working. It will pair successfully but won't communicate with another host or terminal. I purchased another one and it has been working fine with 10k and 15k resistors connected in series. One end of the 10k should be connected to the nano and the other end of the 22k to ground. The junction of the 2 resistors should connect to the RxD of the HC05. You may get away without this voltage divider for the TxD but I would also add it if I were you.