

- #ARDUINO BLUETOOTH DONGLE TUTORIAL SERIAL#
- #ARDUINO BLUETOOTH DONGLE TUTORIAL PRO#
- #ARDUINO BLUETOOTH DONGLE TUTORIAL CODE#
QuartzBT.begin(9600) //Default Baud for comm, it may be different for your Module. Along with that, I am also printing a small message just to ensure that the module is ready to be paired.
#ARDUINO BLUETOOTH DONGLE TUTORIAL SERIAL#
Just initialize the Serial communication through the monitor as well as the module.


Moving ahead to the setup part of the code. SoftwareSerial QuartzBT(10, 11) // RX | TX Remember, it was 10 and 11 in our schematics. In the first two lines of the code, we just have to import the library and define a variable name for our BT module (I have named it QuartzBT, you can change it to whatever you like) Now, we have to define the pins through which our module is connected.
#ARDUINO BLUETOOTH DONGLE TUTORIAL CODE#
What we may do is, write a code for exchanging strings from our phone and displaying them in the serial monitor. Writing the Arduino HC-05 bluetooth module code:įor checking that our module is working or not. You won’t have any difficulty in understanding the code on your own. I had promised that the code will be simple and neat. Now, if you have made the connections properly. But if you want to use your module for long durations then must connect the voltage divider. As RX pin of the module works on 3v3 logic.īut, I have also tried connecting the module directly to 5v and it works flawless. Note: The 1k and 2k resistors connected to the RX pins are to convert 5v to 3.3VDC. VCC and GND of module to 5v and GND of Arduino. Other than RX and TX pins you just need to connect the power pins i.e. Remember that RX of Arduino gets connected to TX of the module and vice versa. In this example I am using pin number 10 and 11 of Arduino as the RX and TX pins respectively.
#ARDUINO BLUETOOTH DONGLE TUTORIAL PRO#
HC-05 can be used with a number of microcontrollers like Arduino boards ( Arduino UNO, Arduino Nano, Arduino Pro Mini etc.), ESP8266 Boards, STM32 Boards and any other development boards available out there. Note: The two pins STATE and EN are of no use in this project. HC-05 Bluetooth module consists of 6 pins which are STATE, RXD, TXD, GND, VCC and EN as mentioned on the back of the module. Can switch between master mode and slave mode: Yes.Automatic connection to the last device: Yes.Communication Method: Serial Communication.Master mode: Several devices can connect to it and it can share data with all of them. Slave mode: It will connect to master device and will share data from him only. It can work either as a slave or a master. It is mostly used in electronic projects. HC05 module is a Bluetooth module which uses serial communication. Getting started with HC-05 Bluetooth Module: It provides a maximum data rate of 1Mb/S, working in a nominal range of 100 meters using 2.4 GHz frequency.ĭue to these several factors, Bluetooth is popularly used all the way from hobby grade projects to industrial ones.ĭevices which commonly harnesses Bluetooth communication: Bluetooth is a communication protocol which provides an affordable communication in PAN (Personal Are Network).
