It’s is one of the more fundamental Bluetooth profiles. SPP is great for sending bursts of data between two devices.
If you’re replacing a serial communication with Bluetooth, SPP is the profile for you. While Bluetooth specifications define how the technology works, profiles define how it’s used. Start SPP profile library (needed to do any Bluetooth transmitting/receiving): You can change the name to user friendly one by typing AT+NAME=usergivennameĪT+RMAAD will release the module from any previous PAIR.ĪT+ROLE=1 changes the ROLE of the module to MASTERĭefault is CMODE = 0 which allows connection to only bound address.
Reset the module by issuing AT+ORGL which restores the module to original state. If you type in AT you should get an OK response. Under SETUP –> SERIAL PORT select the Baud Rate as 38400, 8N1 Under SETUP –> Terminal select CR+LF for TRANSMITĪlso check mark “Local Echo “ so that you see what you type. Open the TERATERM terminal & select SERIAL & the port number where the USB-TTL module is connected. – Sends command with zero Transmit delay, as the HC05 module interprets commands immediately. – It supports CR+LF Carriage Return and Line FEED after each command, which is a must for HC05
We make use of a Terminal Software TERATERM to configure the MASTER.The advantages of this Terminal software are To configure another module as MASTER a simple USB to TTL converter is used.įollowing are the connections between HC05 & USB-TTL module. Now remove the KEY connection from the HC05 module & disconnect the power.Īgain provide the power to see STATUS LED on the module blinking fast indicating that it is looking for a PAIR. While using this address in AT commands you should replace the colon with a comma, like You should know the Address of this module to make it PAIR with another.Type in Leave it as 0 as we want this module to be SLAVE. You can change it by AT+ROLE=0 0 for SLAVE & 1 for Master. The ROLE of the module can be known by typing AT+ROLE? Type in AT+NAME? to get the name of the module.You can change the name as you like with If you get ERROR(0) try again to enter the Command mode.If there is no response then check whether correct COM port has been assigned in Arduino IDE & confirm Baud Rate is 38400, “Both NL & CR” selected. If you type in AT & click on SEND button you should get an OK confirmation from the HC05 module. The HC05 module enters the Command mode with Baud Rate 38400.Įnsure to select “BOTH NL & CR” & Baud Rate as 38400 at the bottom of the serial monitor.This is very important as the Bluetooth module HC05 expects both Carriage Return and Line Feed after every AT command. Now provide the USB cable power to Arduino. Rx(pin0 ) -> Rx Remember it is one to one connection here & not cross connection This bypasses the Boot loader of UNO & the Arduino is used as USB-UART converter.Īfter uploading this empty sketch,remove USB power from Arduino & do the following connections with HC05 Slave : To configure the SLAVE we make use of an Arduino UNO board.Not much of configuration needed for slave.We can leave it to defaults.But to know the ADDRESS of the slave you’ve to follow this procedure.īefore connecting the HC05 module, upload an empty sketch to Arduino.
Then you just have to implement all the rest of your code.It is quite simple to pair a Bluetooth module from your Android phone.But bit tricky to pair it with another HC-05 module.In this post I’ll describe the method of pairing 2 BT modules.One of the module is assigned ROLE as MASTER & the other left as SLAVE.īy default all HC05 modules are SLAVEs.Using AT commands the module can be configured as we like.
The script just prints the inputs from the controller to the serial monitor. Now plug in the dongle again and pair the controller (pressing the playstation button). The controller will be paired with the dongle. Then unplug the dongle from the arduino, plug in the PS3 controller via USB and reset the arduino. Additionally you have to enter your MAC address in the line 20.
If you have the address then you have to comment the line 19 in the code and uncomment line 20. Or you have to run the script and the MAC should be displayed over SerialMonitor.Most simple: It is written on the dongle itself.You have to know the MAC adress of your BT-dongle. On your Arduino you will have to run the PS3BT A arduino with an USB-Host (Mega will not work) or an shield which provides the USB-Host.If you want to do this on your own, you need additional hardware: