Hi there,
Am working on a project to pick sound with a microphone sensor and and then send it over the hc-05 bluetooth module to my phone. am still in the begining stages but i have surely failed to configure my module. I can switch the module to AT mode and the light will blink as it has to for both "AT" and "pair" but when i go to the serial monitor i receive nothing as the response.
am open to any help but am on deadline please help.
thanks in advance
Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.
Topic has been moved.
Which Arduino are you using?
Have you tried swapping the Rx and the Tx?
Sorry am new here, am using arduino UNO R3
After reading alot, I have found a temporary solution. I wll get time to verify if it actually works permanently i used this code ...
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
// Connect the HC-05 TX to Arduino pin 2 RX.
// Connect the HC-05 RX to Arduino pin 3 TX through a voltage divider.
char c = ' ';
byte ATmodePin = 5;
void setup()
{
// set up the pin used to turn on AT mode
pinMode(ATmodePin, OUTPUT);
digitalWrite(ATmodePin, LOW);
// Start the serial monitor
Serial.begin(9600);
Serial.println("Arduino is ready");
// HC-05 default serial speed for communication mode is 9600
BTserial.begin(9600);
Serial.println("BTserial started at 9600");
Serial.println("Type # to enter AT mode");
}
void loop()
{
// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTserial.available())
{
c = BTserial.read();
Serial.write(c);
}
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
{
c = Serial.read();
if (c == '#') // enter AT mode
{
digitalWrite(ATmodePin, HIGH);
Serial.print("Entered AT mode. Type $ to exit");
}
else if (c == '$') // exit AT mode by reseting the HC-05
{
digitalWrite(ATmodePin, LOW);
BTserial.print("AT+RESET\n\r");
Serial.print("AT+RESET\n\r");
}
else
{
Serial.write(c);
BTserial.write(c);
}
}
}
and now when i open serial monitor, and hold the reset button on the module I get responses.
Probably not true. The baud rate for communication in AT mode is 38400. Further, your code is clunky, overly-complicated, and misleading. Check the Martyn Currey website for proper procedures and sensible code.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.