Hi everyone,
I'm trying to set up two bluetooth modules (HC-06 as slave and MLT-BT05 as master) using Arduino IDE. I've connected them as was suggested in many tutorials and in datasheets:
EN->5V (on MLT-BT05)
VCC->5V
GND->GND
TX->RX
RX-> through 2.2k Ohm to GND and 1k Ohm to TX
The modules are powered correctly (checked voltages an the indicator LED's are on).
I'm using Arduino Nano legit clones (Cytron maker Nano and Seeduino Nano) and tried connecting via both new and old versions of Arduino IDE (2.3.2 and 1.8.18). Both boards have empty scetches uploaded and nothing else is connected to them.
When I open the Serial Monitor (baud rate set to 9600, both NL & CR) and type AT, I get no response. I tried switching the modules and reseting power but nothing works.
Can anyone please advice on this problem?
Thank you!
See the link under the video that you presented in #7:
RX pin of the Arduino needs to be connected to the RX pin of the Bluetooth module, through the voltage divider, and the TX pin of the Arduino to the TX pin of the Bluetooth module.
In this case the only device used in the arduino board is USB-to-UART converter. The atmega mcu itself is not in use, so the code that running in the controller is not matter.
Another way instead of loading an empty sketch is to connect the reset pin to ground.
If you read the tutorial it says that the first thing to do is reading the address of the bluetooth module.
To do it follow the steps there provided ( load an empty sketch on the arduino, enter the at mode in the module, send a few at commands as explained )
It is written in my verified Experiment Sheets (Practicing AT Command for Bluetooth Module, HC-05) that:
Select Bd = 38400 for the data excnage with BT in AT Mode. In normal mode of operation set it to 9600.
If taking AT commands form Serial Monitor, select NL & CR option in the Lline ending box.
Sample Sketch: Task – 12.2 Practicing AT Commands for Bluetooth Module
AT Commands (AT = American Telecommunication) communicate with the internal control registers of the Bluetooth Module and allows to read, modify, write back various operating features of the Bluetooth Module.
(1) Make connection among BT, UNO using Software UART Port, SUART(10, 11) as per Fig-1.
#include <SoftwareSerial.h>
SoftwareSerial SUART(10, 11); // SRX = 10, STX = 11
void setup()
{
Serial.begin(38400);
SUART.begin(38400);
}
void loop()
{
if (SUART.available())
{
char x = SUART.read();
Serial.print(x);
}
if (Serial.available())
{
char c = Serial.read();
SUART.print(c);
}
}
(3) Do not pair the BT with any device. (4) Disconnect power +5V line of BT from UNO. (5) Connect EN-pin of BT with 3.3V point of UNO. (6) Open SM at Bd = 38400. Select NL & CR option in the Line ending box. (7) Hold down the micro switch of BT. (8) Connect +5V line of BT. (9) 2/3 Second later, release the micro switch of BT. (10) Check that Red LED of BT blink once in about 2-sec. (11) Focus the cursor in the InputBox of Serial Monitor. (12) In the InputBox of the Serial Monitor, type AT and then click Send Button. The HC-05 should response with the message OK.
(13) Enter the command: AT+PSWD (to know the PIN/Password of the HC-05). The answer from my HC-05 is: 2987.
(14) [PIN/Password] To set new PIN/Password (say, 1234), enter the command: AT+PSWD=1234. Check the setting by giving the command: AT+PSWD; the return value should be 1234. Set the Password back to 2987.
1. Op has copied the code/Bd from my sketch of post #14. So, far I remember that I performed those AT Commands a year ago on HC-05 BT using Soft UART Port (10, 11) port at Bd = 38400. the Bd = 38400 is only for data exchange with BT in AT Mode. In normal mode, the Bd should be 9600.
2. I am going to perform those steps of post #14 again and will report the result.
3. The problem is this that it is very hard to find a BT out of many which really responds to AT Commands among all those Chinese low cost clones!
4. The data x and c are of types char. So, write() and print() should work equally.
char c = 0x41; // or char c = 'A';
Serial.println(c);//shows: A
Serial.write(c); //shows: A
5. This is an example where the write() method is essentially needed to show the desired charcater on the Serial Monitor.
byte y = 0x41; //0x41 is te ASCI code of 'A'
Serial.write(y); //shows: A
I tried the steps one more time, but I cannot do one with the button, because my module doeasn't have one. The LED on the module blinks as it should. Now, when I type AT in the serial monitor, I get this:
The code remains unchanged except for changing "print" to "write".