I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring.So So there are 2 mode of working with this HC-05 module
i) Simple serial communication ii) working in AT command mode so as to change the parameters of HC-05 module
- Simple serial communication
- Working in AT command mode so as to change the parameters of HC-05 module
As long as iI work in simple serial communication mode, everything workworks fine but when iI tried to change the parameters of module, it didn't workedwork out.FOr For working in At command mode, PIN NO 34 of HC-05 module needneeds to be high and iwhich I had taken care of.Lately i find Lately I found that in mu module they had knowingly not connected the Berg strip to PIN 34 , so iI connected the PIN directly, even thought ithough I am not able to change the parameters of moduelmodule and when iI write any command on COM port of arduino IDE, iI get this response
Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
I think that garbage is due to my code
and hereHere is my code:
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup()
{
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400);
}
void loop()
{
uint8_t x;
char CommandFromSerial[50]=" ";
char ResponseFromBluetooth[50]= " ";
if ((Serial.available())){
if(Serial.available()>0){
for(x=0;x<50;x++){
CommandFromSerial[x]=Serial.read();}
BTSerial.println(CommandFromSerial);}
}
}
}
if ((BTSerial.available())){
if(BTSerial.available()>0){
for(x=0;x<50;x++){
ResponseFromBluetooth[x]=BTSerial.read();}}
Serial.println(ResponseFromBluetooth);}
}
}
I am not able to figure out what iI am doing wrong. iI used this command on COM port
AT\r\nAT\r\n
and many other commands but everytime ievery time I get the same response.
Did i had messedI mess up with my bluetooth module unknowingly?