user18794: I want to connect a Bluetooth module to arduino and check if my module is connected or not.. Through serial monitor. Is there and particular code to connect with that?

user10214: If your board is actually a HC-05, you can

Pull the KEY pin to Vcc (see note)
Write the serial command AT on the serial interface
Look at the output: if you receive AT or OK then the module is connected, otherwise it is not

Note: The key pin is the number 34 on the SMT module (with the antenna pointing upwards, its the pin in the top-right corner). If you have a THT module (so the one with about 6 pins) MAYBE this pin is connected to one of the pins you don't usually use (they are named EN, STATE, ...). Check with a multimeter if it is connected to one of these. If it is not, then you'll have to solder a wire from it to an arduino pin.
If, on the other hand, your board is a HC-06 (almost identical to HC-05, but with a different firmware - it is a slave-only bt device), then keep it disconnected from the master and perform steps 2 and 3: when not connected, in fact, the HC-06 is already in AT mode.
More information on this webpage

18794: <p>I want to connect a Bluetooth module to arduino and check if my module is connected or not.. Through serial monitor. Is there and particular code to connect with that?</p>
 10214: <p>If your board is actually a HC-05, you can</p>

<ol>
<li>Pull the KEY pin to Vcc (see note)</li>
<li>Write the serial command <code>AT</code> on the serial interface</li>
<li>Look at the output: if you receive <code>AT</code> or <code>OK</code> then the module is connected, otherwise it is not</li>
</ol>

<p>Note: The key pin is the number 34 on the SMT module (with the antenna pointing upwards, its the pin in the top-right corner). If you have a THT module (so the one with about 6 pins) MAYBE this pin is connected to one of the pins you don't usually use (they are named EN, STATE, ...). Check with a multimeter if it is connected to one of these. If it is not, then you'll have to solder a wire from it to an arduino pin.</p>

<p>If, on the other hand, your board is a HC-06 (almost identical to HC-05, but with a different firmware - it is a slave-only bt device), then keep it disconnected from the master and perform steps 2 and 3: when not connected, in fact, the HC-06 is already in AT mode.</p>

<p>More information on <a href="http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/?ALLSTEPS" rel="nofollow">this webpage</a></p>
