I am currently working on my simple project, the purpose of my project is controlling led with my smartphone using bluetooth. I am using HC06 as my module.
I have problem with this project, the serial communication working fine with ide arduino serial monitor, but it get trouble when i plug the Hc06 module to arduino, the serial communication didn't work with ide serial monitor and even with my smartphone that has been connected to the module. The code that i made is simple, it should makes led turning on or off when i give a command from my phone. I did my research, but i didn't get the proper solution to this problem.
How are you connecting the hc06? Not to pins 0 and 1 I hope. You can't connect the hc06 and serial monitor at the same time. Which Arduino are you using? If an Uno, You could create a second serial port with a software serial library.
You cannot upload code with Bluetooth connected. I believe you already know that
You cannot use the Serial monitor to send commands, only to watch commands sent from phone, and it is not the object of your exercise anyway.
Your wiring is the wrong way round. It should be Rx>Tx and Tx>Rx
A successful connection between phone and bluetooth, i.e. LED goes solid, means just that. It does not mean a successful connection to Arduino. Check the wiring
There is probably nothing wrong with your code and there is definitely nothing wrong with using bluetooth on pins 0,1. Indeed quite the opposite. Have you tried the code using just the serial monitor and bluetooth disconnected? If the works, there is definitely nothing wrong with the code. Check the wiring.
You might find the following background notes useful
I can't say I have every used a HC-06 but I do use HC-05s.
The HC-05s cannot be wired directly to a Uno as the Uno's serial signals are based on 5 volts and the HC-05s are based on 3.3 volts. You have to use a resistor pair to drop the voltage from the Uno down to 3 volts from 5 volts. With respect to the signals going from the HC-05 to the Uno, I use a 74HCT125 to boost the voltage from 3 volts to 5 volts.