Creative creator
Published © CC BY

Control Room Lights with Android Phone Project

Today right now will Discuss the Relay module. Here I will make a 12 Channel Board. This hand-off board interfaces through Bluetooth.

IntermediateFull instructions provided3 hours3,420
Control Room Lights with Android Phone Project

Things used in this project

Hardware components

Arduino Nano UTSOURCE:
×1
HC-05 Bluetooth UTSOURCE:
×1
Relay UTSOURCE:
×1
12V Adapte UTSOURCE:
×1
Resistors UTSOURCE:
×1
Capacitor UTSOURCE:
×1
Screw Terminal Block UTSOURCE:
×1
Female Header UTSOURCE:
×1
5MM Green LED UTSOURCE:
×1
5MM Red LED UTSOURCE:
×1
Push Button UTSOURCE:
×1
LED Bulbs UTSOURCE:
×1
Wires UTSOURCE:
×1
BC547 Transistor UTSOURCE:
×1
1N4007 Diode UTSOURCE:
×1
Soldering Iron UTSOURCE:
×1
Arduino Uno R3 Board UTSOURCE:
×1

Hand tools and fabrication machines

Soldering Iron UTSOURCE:
Iron Stand UTSOURCE:
Nose Pliers UTSOURCE:
Flux UTSOURCE:

Story

Read more

Schematics

Step 1

The venture has high intricacy on the off chance that I make the circuit on Breadboard or zero PCB. Due to this multifaceted nature, I have gone with Custom Designed PCB from JLCPCB. They are likewise supporting for this Project. Following multi week later, I got my PCB bundle from JLCPCB.

Step 2

At next I have checked Solder cushions associations. Furthermore, the one thing I need to state is that the PCB quality is uncommon. In the event that you have Big ventures in your psyche, at that point checkout JLCPCB, in any event, one time.

Step 3

At that point, I assembled all the parts and put all the segments on the PCB. At that point, I patched all the parts into the PCB.

Step 4

We should program the Arduino Nano. I have associated the USB with Arduino Nano and my Mac. At that point, I ordered it first. Next, I transferred the code to Arduino. One thing you should deal with. In the event that you interface the Bluetooth Module while transferring the code. At that point, the code won't be transferred. It will give you a few sorts of Error. In this way, It is constantly prescribed to evacuate the Bluetooth network before transferring the Code.

Step 5

At that point, I appended Bluetooth Module HC-05 and the Arduino Nano to the PCB. Presently we should interface power with the circuit. I have planned the circuit to work with 12v. along these lines, first I associated 12v +ve and GND wires with the PCB. At that point, I associated the opposite finish of the wires with 12v Power supply. Here I am utilizing a 12V Computer Power Supply.

Step 6

Next, download the application from the depiction. What's more, introduce it to your Android Phone. You may need to give consent from Unknown Sources. Simply permit the settings and Install the application.
Presently open the application and snap on the Connect Button. Presently from the given menus select the HC05 Bluetooth.

Just because when you have not associated with the Bluetooth then the Bar shading will be Red. After you associate the Bar will be Green.

Right now, we can distinguish if the HC05 Bluetooth module is associated or not.

Beneath the "Interface with Bluetooth" Button, you will discover 12 Toggle catches. These flip catches are utilized for turning On/Off the Relays.
Finally yet not least I have likewise included at the same time switch. On the off chance that you press the switch, at that point all transfers will be turned on all at once.

There are largely the details of the application. Obviously, you can include more switches by including not many more Functions. In any case, I need to make the task as straightforward as could reasonably be expected.

Step 7

Burden Connection: Now how about we append loads with the circuit. As you folks realize the PCB contains 12 Relays in this way, we can without much of a stretch associate 12 Loads with the circuit.

First I took 12 Holders for 12 lights. At that point, I have associated the Holders with arrangement with the hand-off. Furthermore, the association terminal will go to the mains voltage.

Right now, I have associated all the Light Holders with the transfers. Presently for the AC power Input, I have utilized one 2 pin plug and associated each of the 12 sets of wires in equal.

Step 8

Presently I turned on the 12V force Supply then I turned on the 230v AC Power Supply for the ensuing burdens. At that point associate the application with Bluetooth. At that point Turned on a portion of the flip switches as should be obvious the Loads are working perfectly.

Code

Control Room Lights With Android Phone Project Arduino Code

Arduino
/*
Code Name: 12 Channel Bluetooth App Controlled Home Automation
Code URI: https://circuitbest.com/category/arduino-projects/
Author: Creative Creator
Author URI: https://www.youtube.com/channel/UCJoXoKcfAo4j9XWDlxCWMyg 
Description: 12 Channel Bluetooth Home Automation with Arduino Nano and Android App
PCB Gerber URI: http://bit.ly/2UnIFFb
App URI: http://bit.ly/2OvxeaG
Version: 1.0
License: Remixing or Changing this Thing is allowed. Commercial use is not allowed.
*/

String readString;
#define relay_1 2      //Connect relay_1  to pin 2
#define relay_2 3      //Connect relay_2  to pin 3
#define relay_3 4      //Connect relay_3  to pin 4
#define relay_4 5      //Connect relay_4  to pin 5
#define relay_5 6      //Connect relay_5  to pin 6
#define relay_6 7      //Connect relay_6  to pin 7
#define relay_7 8      //Connect relay_7  to pin 8
#define relay_8 9      //Connect relay_8  to pin 9
#define relay_9 10     //Connect relay_9  to pin 10
#define relay_10 11    //Connect relay_10 to pin 10
#define relay_11 12    //Connect relay_11 to pin 10
#define relay_12 13    //Connect relay_12 to pin 13

void setup()
{
  Serial.begin(9600);             //Set rate for communicating with phone
  pinMode(relay_1, OUTPUT);       //Set relay_1  as an output
  pinMode(relay_2, OUTPUT);       //Set relay_2  as an output
  pinMode(relay_3, OUTPUT);       //Set relay_3  as an output
  pinMode(relay_4, OUTPUT);       //Set relay_4  as an output
  pinMode(relay_5, OUTPUT);       //Set relay_5  as an output
  pinMode(relay_6, OUTPUT);       //Set relay_6  as an output
  pinMode(relay_7, OUTPUT);       //Set relay_7  as an output
  pinMode(relay_8, OUTPUT);       //Set relay_8  as an output
  pinMode(relay_9, OUTPUT);       //Set relay_9  as an output
  pinMode(relay_10, OUTPUT);      //Set relay_10 as an output
  pinMode(relay_11, OUTPUT);      //Set relay_11 as an output
  pinMode(relay_12, OUTPUT);      //Set relay_12 as an output

  
  digitalWrite(relay_1, LOW);     //Switch relay_1  off
  digitalWrite(relay_2, LOW);     //Swtich relay_2  off
  digitalWrite(relay_3, LOW);     //Switch relay_3  off
  digitalWrite(relay_4, LOW);     //Swtich relay_4  off
  digitalWrite(relay_5, LOW);     //Swtich relay_5  off
  digitalWrite(relay_6, LOW);     //Swtich relay_6  off
  digitalWrite(relay_7, LOW);     //Swtich relay_7  off
  digitalWrite(relay_8, LOW);     //Swtich relay_8  off
  digitalWrite(relay_9, LOW);     //Swtich relay_9  off
  digitalWrite(relay_10, LOW);    //Swtich relay_10 off
  digitalWrite(relay_11, LOW);    //Switch relay_11 off
  digitalWrite(relay_12, LOW);    //Swtich relay_12 off
  
}
void loop()
{
  while(Serial.available())             //Check if there are available bytes to read
  {
    delay(10);                          //Delay to make it stable
    char c = Serial.read();             //Conduct a serial read
    if (c == '#'){
      break;                            //Stop the loop once # is detected after a word
    }
    readString += c;                    //Means readString = readString + c
  }
    if (readString.length() >0)
    {
      Serial.println(readString);
      if(readString == "switch all on"){
        allSwitchesOn();
      }               
      else if(readString == "switch all off"){
        allSwitchesOff();
      }             
      else if(readString == "relay_1 on"){   
        digitalWrite(relay_1, HIGH);
      }
      else if(readString == "relay_1 off"){
        digitalWrite(relay_1, LOW);
      }
       else if(readString == "relay_2 on"){   
        digitalWrite(relay_2, HIGH);
      }
      else if(readString == "relay_2 off"){
        digitalWrite(relay_2, LOW);
      }
       else if(readString == "relay_3 on"){   
        digitalWrite(relay_3, HIGH);
      }
      else if(readString == "relay_3 off"){
        digitalWrite(relay_3, LOW);
      }
      else if(readString == "relay_4 on"){
        digitalWrite(relay_4, HIGH);
      }
      else if(readString == "relay_4 off"){
        digitalWrite(relay_4, LOW);
      }
      else if(readString == "relay_5 on"){
        digitalWrite(relay_5, HIGH);
      }
      else if(readString == "relay_5 off"){
        digitalWrite(relay_5, LOW);
      }
      else if(readString == "relay_6 on"){
        digitalWrite(relay_6, HIGH);
      }
      else if(readString == "relay_6 off"){
        digitalWrite(relay_6, LOW);
      }
      else if(readString == "relay_7 on"){
        digitalWrite(relay_7, HIGH);
      }
      else if(readString == "relay_7 off"){
        digitalWrite(relay_7, LOW);
      }
      else if(readString == "relay_8 on"){
        digitalWrite(relay_8, HIGH);
      }
      else if(readString == "relay_8 off"){
        digitalWrite(relay_8, LOW);
      }
      else if(readString == "relay_9 on"){
        digitalWrite(relay_9, HIGH);
      }
      else if(readString == "relay_9 off"){
        digitalWrite(relay_9, LOW);
      }
      else if(readString == "relay_10 on"){
        digitalWrite(relay_10, HIGH);
      }
      else if(readString == "relay_10 off"){
        digitalWrite(relay_10, LOW);
      } 
      else if(readString == "relay_11 on"){
        digitalWrite(relay_11, HIGH);
      }
      else if(readString == "relay_11 off"){
        digitalWrite(relay_11, LOW);
      }
            else if(readString == "relay_12 on"){
        digitalWrite(relay_12, HIGH);
      }
      else if(readString == "relay_12 off"){
        digitalWrite(relay_12, LOW);
      }
      readString="";
    }
}
void allSwitchesOff()               //Function for turning OFF all relays
{
  digitalWrite(relay_1, LOW);       //Switch relay_1  off
  digitalWrite(relay_2, LOW);       //Swtich relay_2  off
  digitalWrite(relay_3, LOW);       //Switch relay_3  off
  digitalWrite(relay_4, LOW);       //Swtich relay_4  off
  digitalWrite(relay_5, LOW);       //Swtich relay_5  off
  digitalWrite(relay_6, LOW);       //Swtich relay_6  off
  digitalWrite(relay_7, LOW);       //Swtich relay_7  off
  digitalWrite(relay_8, LOW);       //Swtich relay_8  off
  digitalWrite(relay_9, LOW);       //Swtich relay_9  off
  digitalWrite(relay_10, LOW);      //Swtich relay_10 off
  digitalWrite(relay_11, LOW);      //Swtich relay_11 off
  digitalWrite(relay_12, LOW);      //Swtich relay_12 off
}
void allSwitchesOn()                //Function for turning ON all relays
{
  digitalWrite(relay_1, HIGH);      //Swtich relay_1  off
  digitalWrite(relay_2, HIGH);      //Swtich relay_2  off
  digitalWrite(relay_3, HIGH);      //Swtich relay_3  off
  digitalWrite(relay_4, HIGH);      //Swtich relay_4  off
  digitalWrite(relay_5, HIGH);      //Swtich relay_5  off
  digitalWrite(relay_6, HIGH);      //Swtich relay_6  off
  digitalWrite(relay_7, HIGH);      //Swtich relay_7  off
  digitalWrite(relay_8, HIGH);      //Swtich relay_8  off
  digitalWrite(relay_9, HIGH);      //Swtich relay_9  off
  digitalWrite(relay_10, HIGH);     //Swtich relay_10 off
  digitalWrite(relay_11, HIGH);     //Swtich relay_11 off
  digitalWrite(relay_12, HIGH);     //Swtich relay_12 off
}

Credits

Creative creator

Creative creator

22 projects • 8 followers

Comments