charlesbeckwith / n64-bluetooth

0 stars 0 forks source link

Bluetooth #2

Open charlesbeckwith opened 8 years ago

charlesbeckwith commented 8 years ago

Applications of Bluetooth :

There are many applications of Bluetooth modules but major applications of Bluetooth is given below :

In mobiles , computers , laptops and all other smart computers. wireless Audio and video controllers wireless mouse and keyboards Wireless head phones and Microphones there are man other applications of Bluetooth, Just Google to know more about applications of Bluetooth. Bluetooth module is work as master or slave. There are many Bluetooth modules available in market which are either master/slave or both. Master Bluetooth module can send or receive data from other Bluetooth modules. But slave Bluetooth can only listen to master Bluetooth module. It depends on your application which Bluetooth module you need for your project.

How to select Bluetooth module ? Bluetooth module selection depends on following factors :

Maximum power output of Bluetooth module There are three classes of Bluetooth modules exist. Power output range of all three class are given below :

class 1 : 100 mW class 2 : 2.5 mW class 3 : 1 mW

  1. Distance between your two Bluetooth devices receiver and transmitter :

According to range of Bluetooth devices, there are also three classes of Bluetooth modules :

class 1 : 100 meter class 2 : 10 meter class 3 : 10 centimeter

  1. Mode of communication you want to use

Bluetooth modules need communication protocols to interface with other devices. For example in this article our main focus is Bluetooth module interfacing with microcontroller, microcontroller can communicate with Bluetooth device through following wired communications to send or receive data from other Bluetooth device :

UART SPI USB It depends on you which wired communication from above three you want to use for interfacing your microcontroller with Bluetooth module. There are many Bluetooth modules available in market which support above three communication. But the name of some famous serial Bluetooth modules are given below:

HC-04 HC-05 RN-41 RN-42 AUBTM BLUESMIRF All above Bluetooth modules have different range, power output and quality. Before selecting any above Bluetooth module you should make sure either you have a need of master or slave Bluetooth module.You can choose any above Bluetooth module according to your requirements. I recommend you to choose Bluetooth module which have UART communication and it is easy to write program using UART. While selecting any Bluetooth module you should check that it should have built in Bluetooth host controller. Otherwise you have to write your own software for this purpose and it need a lot of time and expertise in software programming.

In this article I have chosen RN-42 Bluetooth module to teach you how to interface it with pic microcontroller. RN-42 is a Bluetooth module product of microchip.

RN-42 Bluetooth module interfacing with pic microcontroller : RN-42 is class 2 Bluetooth module. It have UART and USB communication interface. It can both send and receive data i.e. it can work both as Master and slave. It can also be use for audio application.

To interface RN-42 module with PIC microcontroller or any microcontroller, you need of voltage level shifting circuit with RN-42. But Microchip also provide it solution by providing complete compatible board to interface it with microcontroller. RN-42 EK board can interface with PIC microcontroller directly by connecting UART_RX pin of RN-42 Bluetooth module to Tx pin of pic microcontroller and UART_TX pin of RN-42 Bluetooth module to Rx pin of pic microcontroller. RN-42-EK board can also be connected with computer through usb cable.

To download data sheet and to buy RN-42 EK board click on the link below :

RN-42 Bluetooth Evaluation Kit

Block diagram below shows interfacing diagram of pic microcontroller and RN-42 EK board :

block diagram of Bluetooth interfacing with pic microcontroller block diagram of Bluetooth interfacing with pic microcontroller How to send/receive commands or data from microcontroller to/from RN-42 EK kit : RN-42 have two modes commands mode and data mode. command mode is used to set configuration of Bluetooth module like its mode either master or slave, baud rate, serial port flow control. Bluetooth module should be configured before using data mode. Otherwise it will use default values of configuration bits and commands. Command mode is used to set device name , pin code and baud rate. One thing you should keep in mind there is a specific time for command mode, you should use command with in this time otherwise. Bluetooth module will reach into data mode after this time.