Having troubles using the Bluetooth module

Hi,

I was trying to do my CS graduation project. Basically, I need to control various home appliances' power from my phone. Nothing extreme. I'll also need to create an Android app, but that is the next step.

I used an Arduino Uno, 4x 5V Relay Module and a HM-10 Bluetooth Module. I can do whatever I want from the PC's serial port. Control the relays and stuff. But Bluetooth doesn't read any input. I can't access the AT commands.
I connected HM-10's VCC to 3.3V. I've read about using a voltage divider. I didn't do that though.
Also HM-10's TX and RX pins are connected to 0 and 1.

How can I get Bluetooth working? Any ideas?

The code is like this:

// Home Appliances Project

int LightPin = 8;
int ACPin = 9;
int MotorPin = 10;
int OperationInput = 0;

void setup() {
  
  pinMode(LightPin, OUTPUT);
  pinMode(ACPin, OUTPUT);
  pinMode(MotorPin, OUTPUT);

  digitalWrite(LightPin, HIGH);
  digitalWrite(ACPin, HIGH);
  digitalWrite(MotorPin, HIGH);

  Serial.begin(9600);
  
}

void loop() {
    Serial.write("\n\nWhat do you want to do? \n 1) Lights on \n 2) AC On \n 3) Motor on \n 4) Lights off \n 4) AC off \n 4) Motor off");
    while (Serial.available() == 0 ) { }
    OperationInput = Serial.read();
    
    if (OperationInput == '1') {digitalWrite(LightPin, LOW); Serial.write("\n\nLights On!");}
    if (OperationInput == '2') {digitalWrite(ACPin, LOW); Serial.write("\n\nAC On!");}
    if (OperationInput == '3') {digitalWrite(MotorPin, LOW); Serial.write("\n\nMotor On!");}
    
    if (OperationInput == '4') {digitalWrite(LightPin, HIGH); Serial.write("\n\nLights Off!");}
    if (OperationInput == '5') {digitalWrite(ACPin, HIGH); Serial.write("\n\nAC Off!");}
    if (OperationInput == '6') {digitalWrite(MotorPin, HIGH); Serial.write("\n\nMotor Off!");}

}

Note: Relay requires low signal to be activated.

I used an Arduino Uno, 4x 5V Relay Module and a HM-10 Bluetooth Module.

Why are you using BLE for this project instead of original bluetooth 2 with an HC-05. It is much more simple. The Android app for BLE adds another layer of complication.

cattledog:
Why are you using BLE for this project instead of original bluetooth 2 with an HC-05. It is much more simple. The Android app for BLE adds another layer of complication.

Hmm… Bluetooth 4 seemed better than 2. So it’s more complicated. I’ll get a HC-05 then. Thank you.

Other than that, should I add anything to the code? Should I do something that I didn’t currently? Any other tips or recommendations? It’s my first time with Arduino.

For example can’t I just connect the VCC of the HC-05 to the 3.3V? Everyone I’ve seen used a voltage divider circuit with 5V.

For example can't I just connect the VCC of the HC-05 to the 3.3V? Everyone I've seen used a voltage divider circuit with 5V.

Most HC05 modules should be powered by 5v, as they have a voltage regulator, but they are 3.3v devices. The voltage divider is used for the module's Serial RX line which is best not connected to the 5v Arduino TX. That said, many find the module's RX is 5v tolerant.

Here's two good references for review.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf

http://www.martyncurrey.com/hc-05-zg-b23090w-bluetooth-2-0-edr-modules/