Introduction: BLUETOOTH CONTROLLED EXTENSION CORD
At present people like to control electric equipment remotely. So this device helps to control electric equipment like Table Fans, Night Lamps from an android smart phone. There are number of advantages of this device.
- Easy to move
- Not expensive
- Easy to operate
- Can control remotely from a smartphone
So lets build this !!!
Step 1: Things You Need..
- Arduino Uno Board
- Jump Wires
- HC-05 Bluetooth Module
- 2 Channel Relay Module
- Android Phone
- Android App - [Get it!]
- Old phone charger
- Soldering Iron
- Screwdriver
- Scissor
- Paper Cutter
- Wires
- Insulation Tape
- Double tape
- Plug base wall sockets - 2
- Sunk Box - 3
- Sunk Box Cap - 1
- Ply wood
- Self-tapping 1 inch
Step 2: Setting Up Sunk Boxes & Wall Sockets
- Cut the plywood according to the measurements of the sunk boxes.
- Fit sunk boxes to the plywood using self-tappings.
- You can build this according to your imagination :-)
Step 3: Coding the Arduino
Use the following code or download the ino file. Upload this code to arduino.
#include
SoftwareSerial mySerial(10, 11); //Pin10 RX ,Pin 11 TX connected to-- > Bluetooth TX, RX
#define relay1 2
#define relay2 3
#define relay3 4
#define relay4 5
char val;
void setup()
{ pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(relay3, OUTPUT);
pinMode(relay4, OUTPUT);
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, HIGH);
mySerial.begin(9600);
Serial.begin(9600);
}
void loop()
{ //cek data serial from bluetooth android App
if ( mySerial.available() > 0 )
{
val = mySerial.read();
Serial.println(val);
}
//Relay is on
if ( val == '1' )
{
digitalWrite(relay1, LOW);
}
else if ( val == '2' )
{
digitalWrite(relay2, LOW);
}
else if ( val == '3' )
{
digitalWrite(relay3, LOW);
}
else if ( val == '4' )
{
digitalWrite(relay4, LOW);
}
//relay all on
else if ( val == '9' )
{ digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, LOW);
}
//relay is off
else if ( val == 'A' )
{
digitalWrite(relay1, HIGH);
}
else if ( val == 'B' )
{
digitalWrite(relay2, HIGH);
}
else if ( val == 'C' )
{
digitalWrite(relay3, HIGH);
}
else if ( val == 'D' )
{
digitalWrite(relay4, HIGH);
}
//relay all off
else if ( val == 'I' )
{ digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, HIGH);
}
}
Step 4: Fitting Arduino to Sunkbox Cap
Attach arduino uno to the sunkbox cap using a piece of double tape.
Step 5: Wiring Things
Use the old phone charger to power arduino uno.
Here I soldered it to arduino uno.
Connect Arduino Uno, HC-05 Module and 2 Channel Relay Module according to given diagram.
Then connect Wall Scokets and 2 Channel Relay Module as the diagram.
Check the wiring completely and plug the extension cord to the power.
Arduino Uno and Bluetooth Module will turn on.
Then Proceed to next step.
Step 6: Get the App & Connect to Bluetooth Module
Download and install the app. [Here]
Then open settings on your phone, Go to bluetooth settings and pair the HC-05 Module with your phone. Use 1234 as the password.
After that open the app, Click on "Find BT Device".
Then it will automatically discover the HC-05 Module.
Then press "Connection" button.
Now you phone is connected to HC-05 Module. Try pressing 1, 2, 3, 4 buttons and two buttons will work with the relay module. You can hear a tick inside the relays.
Step 7: Packing Things Into the Sunkbox
Pack phone charger, Arduino Uno and other components into the sunkbox. Use double tape to attach them. Do this carefully. You might damage wires or circuit boards.
Step 8: Final View
Now you have finished building Bluetooth Controlled Extension Cord.
Play Around!