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.
- Instructions for making backup batteries from an orange, charging nearly 40% of the battery for iPhone
- Instructions for making devices turn on and turn off lights automatically when the light / dark is super simple with only 50,000 VND
- Homemade ultra-light light switch, only you can turn it on
Materials to prepare:
- A UNO R3 aduino circuit (cost about VND 130,000)
- A Bluetooth module HC-06 (cost about VND 120,000)
- Module relay 5v 1 to 8 channels depending on the number of devices you need to control (cost about 25,000 VND)
- Power cord to connect.
Step 1:
First, connect the Bluetooth module with Arduino according to the diagram below:
Connect the power cord to the bluetooth module HC-06.
Connect RX and TX signals.
Step 2:
On the relay module, the power supply pins for the active module are DC + and DC-. Signal pins are IN.
To turn off the devices, you connect the relay signal pins.
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.
Step 3:
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.
Just like a switch, connect the replay module to an electrical device.
Step 4:
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:
After connecting the modules on the phone, we download the Bluetooth Voice Control software here and install it on the Android phone.
After installation, we open the software and select the device.
Here, you choose to connect to the device named tail 06 HC.
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.
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.
Good luck!
You should read it
- Explore a special high-tech bathroom with the ability to control everything by voice from the toilet to the mirror
- How to use Voice Control in iOS 13
- How to control the entire Android device by voice
- How to turn off voice control on iPhone
- Instructions on how to turn off voice control on iPhone quickly
- How to enable Windows 11 voice control
- Users can control voice music on Spotify in the future
- The control commands are useful with Bixby Voice on Galaxy S8
- How to set up voice recognition in Windows 10
- Fake Voice 7.0 - Download Fake Voice 7.0 here
- Search Google by Vietnamese voice via Chrome
- Top 15 applications to 'transform' your voice on iPhone
Maybe you are interested
What is Microsoft Management Console (MMC)? Steps to use Microsoft Management Console You can install Android apps on Windows 11 using APK files Quickly create a Google Meet meeting with a short domain name 5 mobile security risks you need to avoid The most basic insights to becoming a Hacker - Part 1 China - hacker 'factory'