Instructions on how to make devices that turn on / off lights and fans in Vietnamese

With a device that turns on and off lights, fans and other home-made voice devices are guided in the article below, you can turn your room or house into a smart home at a cost only. very low.

With a device that turns on and off lights, fans and other home-made voice devices are guided in the article below, you can turn your room or house into a smart home at a cost only. very low.

  1. Instructions for making backup batteries from an orange, charging nearly 40% of the battery for iPhone
  2. Instructions for making devices turn on and turn off lights automatically when the light / dark is super simple with only 50,000 VND
  3. Homemade ultra-light light switch, only you can turn it on

Materials to prepare:

Picture 1 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

  1. A UNO R3 aduino circuit (cost about VND 130,000)
  2. A Bluetooth module HC-06 (cost about VND 120,000)
  3. Module relay 5v 1 to 8 channels depending on the number of devices you need to control (cost about 25,000 VND)
  4. Power cord to connect.

Step 1:

First, connect the Bluetooth module with Arduino according to the diagram below:

Picture 2 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

 

Connect the power cord to the bluetooth module HC-06.

Picture 3 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Connect RX and TX signals.

Picture 4 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Step 2:

Picture 5 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

On the relay module, the power supply pins for the active module are DC + and DC-. Signal pins are IN.

Picture 6 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

To turn off the devices, you connect the relay signal pins.

Picture 7 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese
Connect the IN pin of the Relay module to pins 2 or 3, 4 because pins 2, 3 and 4 on the Arduino are used to output relay signals.

Picture 8 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Step 3:

Picture 9 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

3 pins COM, NC and NO on Relay act as a switch to control electrical equipment. COM is the middle foot, NO normally open and NC is normally closed.

Picture 10 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Just like a switch, connect the replay module to an electrical device.

Picture 11 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Step 4:

Picture 12 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Copy the following code into Braod Arduino using Arduino IDE.

String data;
int tb1 = 2;
int tb2 = 3;
int tb3 = 4;
void setup () {
Serial.begin (9600);
pinMode (tb1, OUTPUT);
pinMode (tb2, OUTPUT);
pinMode (tb3, OUTPUT);
}
void loop () {
while (Serial.available ()) {// Check the byte to read
delay (30); // Delay to be more stable
char c = Serial.read (); // proceed to read
if (c == '#') {break;} // Exit the loop when detecting the word #
data + = c; // data = data + c
}
if (data.length ()> 0) {
Serial.println (data);
if (data == "turn on device 1" || data == "Turn on device 1" || data == "1")
{digitalWrite (tb1, HIGH);}
else if (data == "turn off device 1" || data == "Turn off device 1" || data == "a")
{digitalWrite (tb1, LOW);}
// tb1
if (data == "turn on device 2" || data == "Turn on device 2" || data == "2")
{digitalWrite (tb2, HIGH);}
else if (data == "turn off device 2" || data == "Turn off device 2" || data == "b")
{digitalWrite (tb2, LOW);}
// tb2
if (data == "turn on device 3" || data == "Turn on device 3" || data == "3")
{digitalWrite (tb3, HIGH);}
else if (data == "turn off device 3" || data == "Turn off device 3" || data == "c")
{digitalWrite (tb3, LOW);}
// tb3
data = "";}} // Reset variables

Step 5:

Picture 13 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

After connecting the modules on the phone, we download the Bluetooth Voice Control software here and install it on the Android phone.

Picture 14 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

After installation, we open the software and select the device.

Picture 15 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Here, you choose to connect to the device named tail 06 HC.

Picture 16 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Now say "turn on device 1" and "turn off device 1" to turn on and turn off the light. To change this phrase into other phrases, you can edit it in the Arduino code file.

Picture 17 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

With this software, you can set to turn on, turn off 3 devices. To be able to control all the devices in the house with this software, you can add more switches.

Picture 18 of Instructions on how to make devices that turn on / off lights and fans in Vietnamese

Good luck!

Update 24 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile