Set the CMODE to 1 as we are configuring the master HC05 RESPONSE (reply from HC05, displayed in the serial monitor) Now, enter the following commands in the table below to configure the master HC05 module:ĬOMMAND (enter this in the serial monitor and press enter) Congratulations! You are have successfully logged into the HC05 module’s AT command mode. Now, type in AT in the serial monitor, if all goes well, you’ll get an “OK” from the HC05 displayed in the serial monitor window. At the bottom right corner of the Serial monitor window, if you haven’t already done so, make sure that you set the line ending setting to “Both NL and CL” and baud rate to 38400. Next, open the serial monitor (the serial monitor button is at the top right of the Arduino IDE). Normally before the HC05 is connected to any Bluetooth device, it’s red light blinks at a very high frequency (fast blinking!). To check if you have done this right, make sure the red light on the HC05 is blinking approximately every one second (slow blinking!). This is how you go into the AT mode of the HC05. Alright, now you can release the button on the HC05. Now plug in the Arduino power cable while still holding the button on the HC05. After uploading the code, plug out the Arduino power cable. Upload this code into the Arduino connected to the master HC05 module first. If( Serial.available()) // if serial monitor is outputting something…ĬonfigBt.write( Serial.read()) // write to Arduino’s Tx pin Serial.print(configBt.readString()) // print in serial monitor If(configBt.available()) // if the HC05 is sending something… The code to configure the HC05 module can be found at the bottom of this page, the explanation of the code is as followsĪdd the SoftwareSerial library to this code. To do this, we need to write an Arduino code to send commands through the serial monitor to the HC05. We need to change some settings inside the HC05 Bluetooth Module, to do this, we have to go into the HC05 module’s AT Command Mode and send commands to it through the Arduino IDE’s serial monitor. This is the additional step required to connect two HC05 modules together. Initial Configuration of the HC05 modules Similarly, repeat the circuit for both master and slave, the Arduino Master Bluetooth Circuit and Arduino Slave Bluetooth Circuit are shown below. I’m using 1kΩ for R1 and 2.2KΩ for R2 but you can use any resistor value as long as the R2 is approximately double the value of R1 (R2 ≈ 2R1). So, we will use resistors (R1 and R2) to create a voltage divider to reduce the 5V output of the Arduino to 3.3V, so as to not damage the HC05 module. The Receiver (Rx) pin of the HC05 operates at the 0V to 3.3V range and the Arduino operates at the 0V to 5V range. For the connections, all we are doing here is connecting the HC05 to the Arduino. Wire up 2 of these circuits, one for master and one for the slave. 2x Arduino (Any model will do I’m using an Arduino Uno R3 and an Arduino Nano).This tutorial will guide you through this process. However, have you ever needed to connect two HC-05s together? It’s not as straightforward connecting an HC05 to a smartphone, there are some additional steps involved. This is fairly simple and we have built many interesting projects with it like Bluetooth Controlled Robot, Bluetooth Voice Control, Bluetooth Home Automation, etc. In most projects, we usually connect to HC05 to an Arduino and use it to wirelessly communicate with another smart device like a mobile phone. HC-05 Bluetooth Modules are the go-to Bluetooth modules for any Arduino project! It’s easy to hook up and code in the Arduino IDE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |