Voice Controlled LEDs using Arduino and Bluetooth (Problem)

Submitted by blackbee on Tue, 03/19/2019 - 10:31

Hello any one here, can help me find out what is the problem with HC 06 bluetooth module. I am currently developing a voice controlled LED using Arduino and Bluetooth  for my project. I used this sample to develop my project https://circuitdigest.com/microcontroller-projects/arduino-based-voice-… but then the codes are not working. And I try another options to fix my problems, if the bluetooth module, the codes i used, and mobile application are having the error. I used to configure my bluetooth module using AT commands but nothing happens and no responses appear. I checked all the connections I made and it seems like ok and correct base on the sample. What i am struggling about is how to know if the bluetooth module is really working and communicating properly.

I used this code to configure my bluetooth and make some AT commands but it doesn't work.

#include <SoftwareSerial.h>
SoftwareSerial mySerial(0, 1); // RX, TX

String command = ""; // Stores response of the HC-06 Bluetooth device

void setup() {
  // Open serial communications:
  Serial.begin(9600);
  Serial.println("Type AT commands!");
  
  // The HC-06 defaults to 9600 according to the datasheet.
  mySerial.begin(9600);
}

void loop() {
  // Read device output if available.
  if (mySerial.available()) {
    while(mySerial.available()) { // While there is more to be read, keep reading.
      command += (char)mySerial.read();
    }
    
    Serial.println(command);
    command = ""; // No repeats
  }
  
  // Read user input if available.
  if (Serial.available()){
    delay(10); // The delay is necessary to get this working!
    mySerial.write(Serial.read());
  }
}

 

Do you think that my bluetooth module has the problem and defective? and there is any idea to test my module physically if it is communicating or not.

Thank you for the help in advance.

The only way to really check if your bluetoothmodule is actually working is by interfacig it with a microcontroller like arduino. Follow the steps below

1.Connect the HC-06 with Arduino as shown in below link and power it up. Once it is powered you should see the red light flashing fast on the HC-06 module

2. Now pair the module to your phone if the connection is successfull then the flashing LED should become stable. If this happens then your module is working for sure (Atlest so far)

Now follow this tutorial https://circuitdigest.com/microcontroller-projects/bluetooth-servo-motor-control-using-arduino 

Just ignore the Servo motor part if everything is good you should be able to see the result on the Serial monitor.

When you are tyring a new project break the projects into small segments and complete each segment,only the you will understand and complete the project without any errors. And even if you get errors you will be able to debug it by yourself 

  Joined August 16, 2016      998
Tuesday at 12:29 AM