I have problem with serial communication from Bluetooth module to Arduino. I am giving the input from Android device to Bluetooth module and it sends to Arduino to operate two motors.
Before couple of weeks the same code worked well. Now I'm using new Arduino board. I don't know how to fix this. Struggling from last two weeks. What might be the problem?
Connection is perfect. When I enter the value in Serial monitor textbox motors are running. Not running via bluetooth. My code always taking the else part of if condition.
I'm using Arduino UNO and Bluetooth HC-05. The code worked with the old Arduino UNO(clone) board. It damaged and I get a new same Arduino UNO and a Bluetooth from shop and tried it was not working.
The connection is,
RX to TX
TX to RX
Then Power
I'm sure about the connection of motor IN and OUT pins.
Even this code is also not connecting with serial monitor via Bluetooth. I unable to find what is the issue in my project. In the new Bluetooth module it has a button in red color named sw1. What does it mean?
I attached the both old Bluetooth and new Bluetooth module(HC-05) below.
abish_r01:
I'm using Arduino UNO and Bluetooth HC-05. The code worked with the old Arduino UNO(clone) board.
Even this code is also not connecting with serial monitor via Bluetooth. I unable to find what is the issue in my project.
If the old one worked, it would appear that you are just getting forgetful. You can't share the serial monitor with bluetooth. You can prove the code with bluetooth disconnected, then use a proper terminal like RealTerm via bluetooth.
You might find the following background notes useful
Thanks for your response. We can see the serial monitor in android app itself. That app has been removed from play store. Arduino Buetooth Terminal is the app, from which we can see the serial monitor.
I found the solution for the serial communication problem. Me upload the code via cable and unplugged the cable for Arduino's power. So the serial communication refuses to connect via bluetooth. Then I powered the Arduino with external power source the bluetooth serial communication started working.
Now I have some other issue. The android app is not responding after few inputs passed. It refusing to send command. After 5 or 6 commands transferred successfully the Arduino not receiving any inputs. What might be the problem?
What do you mean by external power? I hope it is not a 9v battery.
Does LED on bluetooth start blinking again? If so, you have lost connection and it is more likely to be an Android problem. It might not be serious, just user error.
If LED is still solid, it is probably an Arduino problem. It could be wiring.
Nick_Pyner:
What do you mean by external power? I hope it is not a 9v battery.
Does LED on bluetooth start blinking again? If so, you have lost connection and it is more likely to be an Android problem. It might not be serious, just user error.
If LED is still solid, it is probably an Arduino problem. It could be wiring.
If no LED, you have lost power.
12V battery is the external power.
Yes Bluetooth LED is always glowing. Not blinking type in that board. I don't think it is an Android problem. I'm using log whether it is passing the data. It successfully sends data to the Bluetooth. Again if I run the same Arduino code with some other Android app, it is running perfectly. So it states no circuit error also.