Wednesday, February 26, 2014

Checking the configuration of your RN-42 bluetooth Module

This post will give beginners a brief idea of how to check the configuration of RN-42 and change the configuration.



Basic steps to check the configuration of your Bluetooth Module  :-

1. Fist of all load a blank code to your Arduino device


1:  void setup(){  
2:  }  
3:  void loop(){  
4:  }  

** note - while dumping the code don't connect your device with Bluetooth.

2. After dumping the code connect the Bluetooth module with Arduino as shown below -




Connect Rx pin from Arduino to Rx of your Bluetooth and Tx pin of your Arduino to Tx pin of the Bluetooth. (Rx-Rx and Tx-Tx)




**Apply +3v to your Bluetooth Module (RN-42).

3. After connection go to serial monitor change to no line ending which is present in right bottom of the serial monitor beside Baudrate.

so BY DEFAULT the bluetooth module will be in DATA MODE.
So to check the setting we have to change it to Command mode
 So TYPE

(i) $$$  and press send.
(ii) It will respond as CMD\r

Then  change from No line Ending to carriage return

 (iii)Then Press "D" (Only D) and press send 

It will show the Basic configuration of your Bluetooth-

Example:-

1:  ***Settings***  
2:  BTA=000666445536  
3:  BTName=FireFly-7256  
4:  Baudrt(SW4)=115K  
5:  Parity=None  
6:  Mode =Slav  
7:  Authen=0  
8:  Encryp=0  
9:  PinCod=1234  
10:  Bonded=0  
11:  Rem=NONE SET  


(iv) Then send (SM,0) to change to slave mode or (SM,1) to change to Master mode

(v) To change the Baudrate send (su,96)** for 9600 or (su,115)** for 115200


** note don't use bracket

(vi)  To exit from command mod send "---"

 ***  for more commands refer to the data sheet of RN-42 -- https://www.sparkfun.com/datasheets/Wireless/Bluetooth/rn-bluetooth-um.pdf
 
 In Next post I will show how you can interface two Arduino Boards using RN-42 Bluetooth wirelessly.

No comments:

Post a Comment