- 11
- 54 180
mujTech
เข้าร่วมเมื่อ 15 ม.ค. 2017
How to build your own DIY smart electrical socket
In this video I show how you can build your own DIY smart electrical socket using easily accessible components and tools. I built this prototype recently and it worked smoothly for my home and can generally control table lamps, small fans, TVs and heaters rated less than 10A. The plugs and sockets used are British but the same method used in this video can be applied for the American versions.
NOTES:
- When I wired the socket, it can be noticed that I used blue wires for both
the live and neutral terminals of the socket. This is not correct according to codes and standards and this was due to the fact that I was limited on coloured wires at the time. You will notice that in the wiring diagram at the end of the video, the correct wiring colours are used according to British standards.
- In the wiring diagram, the red, orange and black wires are for the jumper wires.
- The relay that I used in this project is generally rated for resistive loads rated less than 10A max. This means that any appliance or other inductive loads (eg. large fans, motors, pumps ect) that is rated higher than that will not work with this prototype. It will eventually cause the relay contacts to heat up because they will pass current more than they were designed to handle. If you want to control larger appliances, or continuously use inductive loads with it make sure to use a different relay module.
- In order to interface the ESP32 microcontroller correctly, I recommend watching my
tutorial on how to code and configure the ESP32 as well as communicating with via the Blynk app from your smart phone. Link: th-cam.com/video/JhUJ8Egnrnw/w-d-xo.html
Link to code: drive.google.com/file/d/1wx9OJ8YMJodSz01R8h2w8FAZZzkZgJC-/view?usp=sharing
COMPONENTS:
ESP 32 -
5V RELAY MODULE -
SOCKET OUTLET -
SOCKET BACKBOX -
ELECTRICAL PLUG -
BLANK FACEPLATE 2 GANG -
USB CHARGER -
ELECTRICAL CONNECTOR -
PVC CONDUIT FITTING - 20MM -
ELECTRICAL WIRES -
FEMALE TO MALE JUMPER CABLES -
NOTES:
- When I wired the socket, it can be noticed that I used blue wires for both
the live and neutral terminals of the socket. This is not correct according to codes and standards and this was due to the fact that I was limited on coloured wires at the time. You will notice that in the wiring diagram at the end of the video, the correct wiring colours are used according to British standards.
- In the wiring diagram, the red, orange and black wires are for the jumper wires.
- The relay that I used in this project is generally rated for resistive loads rated less than 10A max. This means that any appliance or other inductive loads (eg. large fans, motors, pumps ect) that is rated higher than that will not work with this prototype. It will eventually cause the relay contacts to heat up because they will pass current more than they were designed to handle. If you want to control larger appliances, or continuously use inductive loads with it make sure to use a different relay module.
- In order to interface the ESP32 microcontroller correctly, I recommend watching my
tutorial on how to code and configure the ESP32 as well as communicating with via the Blynk app from your smart phone. Link: th-cam.com/video/JhUJ8Egnrnw/w-d-xo.html
Link to code: drive.google.com/file/d/1wx9OJ8YMJodSz01R8h2w8FAZZzkZgJC-/view?usp=sharing
COMPONENTS:
ESP 32 -
5V RELAY MODULE -
SOCKET OUTLET -
SOCKET BACKBOX -
ELECTRICAL PLUG -
BLANK FACEPLATE 2 GANG -
USB CHARGER -
ELECTRICAL CONNECTOR -
PVC CONDUIT FITTING - 20MM -
ELECTRICAL WIRES -
FEMALE TO MALE JUMPER CABLES -
มุมมอง: 1 566
วีดีโอ
Wireless and Hands-free Prototype Light Switch
มุมมอง 2964 ปีที่แล้ว
This is a prototype that I built where I combined the application of infrared proximity sensors with the wireless technology of XBee radios. If you wish to build this, then please watch my tutorial video in the link below on XBee radios if you never worked with them before. Link: th-cam.com/video/J5lw0ZqBQRs/w-d-xo.html PRIMARY COMPONENTS: Arduino UNO R3: ar.banggood.com/Wholesale-Arduino-Compa...
Ener-J Wifi Smart Switch: Unboxing, Review and Installation
มุมมอง 3.1K5 ปีที่แล้ว
I made this video to discuss the ENER-J 1 gang smart switch, where I focus on it's technical specifications and how to install it correctly. Music: Precious Instrumental by Sparks Music
Home Automation: Light Control Using ESP32 and Blynk App
มุมมอง 7K5 ปีที่แล้ว
In this tutorial I demonstrate how you can control a light bulb from your smart device using the ESP32 microcontroller and the Blynk App via Wi-Fi. Code: drive.google.com/file/d/1wx9OJ8YMJodSz01R8h2w8FAZZzkZgJC-/view?usp=sharing Relay: SRD-05VDC Music: Precious Instrumental by Sparks Music
Wireless DC Motor Control Using XBee Radios
มุมมอง 7305 ปีที่แล้ว
In this video I show how you can control DC motors wirelessly using XBee radios. You can see my first tutorial on XBee radios here: th-cam.com/video/J5lw0ZqBQRs/w-d-xo.html Links to main components: -Sparkfun XBee shield: www.sparkfun.com/products/12847 -XBee Series 1 radio: www.sparkfun.com/products/11215 -Arduino Uno R3 Microcontroller: store.arduino.cc/usa/arduino-uno-rev3 -TIP122 Transistor...
Servo Motor Control Via IR Sensor
มุมมอง 1.1K6 ปีที่แล้ว
Music credits: Serkan Çağrı, Mesut Kahramanoğlu
Controlling Home Appliances With Arduino
มุมมอง 1106 ปีที่แล้ว
For this application, you can use any type of relay as long as it is compatible with Arduino. The relay module that I used in this video is "Keyes_SR1y" Music: Casey Calhoun - Classic
Servo motor control using potentiometer via arduino
มุมมอง 1817 ปีที่แล้ว
This is a simple Arduino based application of controlling a Servo motor's degree of rotation based on the analog reading of a potentiometer. Music: Casey Calhoun - Classic The code is taken from this tutorial: www.arduino.cc/en/Tutorial/Knob
Serial communication between computer and arduino uno r3 with LCD
มุมมอง 9237 ปีที่แล้ว
In this video I show step by step tutorial of a simple serial communication application between my laptop and an Arduino board. Moreover, two LEDs are controlled by the laptop and their status are displayed on an LCD. Music: Casey Calhoun - Classic
XBee tutorial: Turning on an LED wirelessly using Arduino via XBee radios
มุมมอง 35K7 ปีที่แล้ว
In this tutorial, I demonstrate a simple application of the ZigBee protocol based XBee radios. Using Arduinos, I demonstrate how to wirelessly control an LED. Parts required and where to buy some of them: - Arduino Uno R3 boards (x2) www.sparkfun.com/products/11021 - XBee series 1 Radio (x2) www.sparkfun.com/products/11215 - Spark fun XBee dongle www.sparkfun.com/products/11697 - Adafruit XBee ...
Coordinator (Transmitter) Code: #include <SoftwareSerial.h> #include <XBee.h> // constants won't change. They're used here to set pin numbers: const int buttonPin = 7; // the number of the pushbutton pin const int ledPin = 13; // the number of the LED pin // Variables will change: int ledState = HIGH; // the current state of the output pin int buttonState; // the current reading from the input pin int lastButtonState = LOW; // the previous reading from the input pin // the following variables are unsigned longs because the time, measured in // milliseconds, will quickly become a bigger number than can be stored in an int. unsigned long lastDebounceTime = 0; // the last time the output pin was toggled unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers SoftwareSerial Xbee(2, 3); // RX, TX //---------------------------------------------------- void setup() { pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); Xbee.begin (9600); // set initial LED state digitalWrite(ledPin, ledState); } //---------------------------------------------------- void loop() { // read the state of the switch into a local variable: int reading = digitalRead(buttonPin); // check to see if you just pressed the button // (i.e. the input went from LOW to HIGH), and you've waited long enough // since the last press to ignore any noise: // If the switch changed, due to noise or pressing: if (reading != lastButtonState) { // reset the debouncing timer lastDebounceTime = millis(); } if ((millis() - lastDebounceTime) > debounceDelay) { // whatever the reading is at, it's been there for longer than the debounce // delay, so take it as the actual current state: // if the button state has changed: if (reading != buttonState) { buttonState = reading; // only toggle the LED if the new button state is HIGH if (buttonState == HIGH) { ledState = !ledState; } } } // set the LED: digitalWrite(ledPin, ledState); Xbee.write(ledState); Serial.println(ledState); // save the reading. Next time through the loop, it'll be the lastButtonState: lastButtonState = reading; } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- End Device (Receiver) code: #include <SoftwareSerial.h> #include <XBee.h> SoftwareSerial Xbee(2, 3); int data = 0; //---------------------------------------------------- void setup() { Serial.begin(9600); Xbee.begin(9600); pinMode(7, OUTPUT); } //---------------------------------------------------- void loop() { while(Xbee.available()) { data=Xbee.read(); Serial.print(data); } if(data==0) { digitalWrite(7, LOW); } if(data==1) { digitalWrite(7, HIGH); } }
Thank you!
Thank you for your helpful video ! I wanna know how I can send two data in the same time. I’m actually working with Dht22. And I want to send temperature and humidity using 2 xbee s2c pro and two Arduino ! Thank you
What is the range of these radio communication components?
Can a Zigbee sensor data be read in XBee module? I have Zigbee PIR Sensor of different make. I want to read its data on my Raspberry Pi. I have an Xbee module with its USB Dongle. Please guide.
Great Man. Congrats for you. Please, Your code when finish the Power Up of the Arduino the X-BEE alrealdy to start to transmit without any command over the pushbutton....Someone here Can help me?
Sir can you share the code please.
Why you did a software serial. Why you didn’t connect them directly to pins tx rx (0,1)
You have womens hands F’kn Panzy
And you have sh*t for brains, whats your point?
You saved my entire carrer, thank you! T.T
Can you do a demo for ultrasonic sensor data transmission using XBEE+Arduino
How long( in meters) they can communicate?
why my xctu cannot discover my xbee S2C module
Have you tried using the XCTU software to "Recover" your Xbee? It resets all the settings back to default and will bring your Xbee back to life :)
thanks for sharing :)
Sketch would be nice
1:58 Shouldn't that be cm not inches. What is the exact measurement please?
For those who have a shield with an XBEE/USB switch, mine only worked on the USB setting. Took like 6 hours to figure that out
are you a jocker
what really changes if I use 2 xbee series2, an Arduino UNO, and a NANO?.. its all I have. thank you so much! Great video. Also its 3 years later so what changes since then?.. if you know. thank you !
Whats the range
KRYPTONITE TEC Approximately 10 meters inside buildings and 20 meters outside. The signal will reach between 20 to 30 meters but there will be a delay
75m to 100m
@@mujtech4887 Can you help me with coding?
@@jigmie1797 Code has been posted in the comments
Thanks for the awesome video! super helpful :) One question: Could you accomplish the same project by taking off the atmega328p chip from the UNO and just using that as the standalone microcontrollers to control the motors? Lemme know if my question is not clear enough. Thank you again!
Elliot Hey there! Technically you can although I have yet to implement it myself so I might not be able to give you a full answer. I’m assuming you want to design your own embedded circuit boards for the transmitter and receiver? I can give you a few points that might help you: - You can use the same code that I used in the video but you would need to flash it to the Atmega bhip. - The Xbee shields would be redundant and you would need to directly wire the RX and TX of the radio with the RX and TX of the chip on a PCB board - You need a crystal oscillator chip, which is the same silver semi round chip on the Arduino board. The oscillator will feed the Atmega chip a signal at a certain frequency to execute the code. - If you’re using a 9V battery as your power source like I did, you need a voltage regulator to step down the voltage to 3.3V since the maximum voltage rating of the Xbee radio is 3.3V. Any voltage beyond that fed to the radio will burn it. Likewise for the Atmega chip, the maximum Input voltage is 5V
which xbee library did u use?
Xbee.h (Arduino library)
why is the TX and RX goes to pin 2 and 3 in the arduino? the RX and TX text in arduino is on pin 0 and 1. i really new to xbee, pls help me Thank you in advance
im using xbee shield v03. so what pin shall i use on the SoftwareSerial Xbee(?,?); ?
Michael Nathaniel Hi Michael. At that time, I encountered some issues when I used the hardware serial ports of the arduino (pins 0 and 1) with the XBEE shield. Hence I used the “softwareserial” library to configure pins 2 and 3 to act as TX and RX so that I can receive serial data from the XBee radios. With the softwareserial library, you can configure any digital pin on the arduino to function as TX and RX, similarly to pins 0 and 1 and in this case I used pins 2 and 3.
@@mujtech4887 Thank you for replying. i use pin 0 and 1 for the RX and TX, and i think it works. But something is wrong when i receive the data i send. when i print the received data, i got a bunch of number and i don't know what it is. here is my code for send data. #include <SoftwareSerial.h> #include <Printers.h> #include <XBee.h> SoftwareSerial XBee(0,1); String data; void setup() { // put your setup code here, to run once: Serial.begin(9600); XBee.begin(9600); data = "test send data"; } void loop() { delay(3000); // put your main code here, to run repeatedly: static char *dataSend = data.c_str(); // need to use c_str() because the write function don't accept String XBee.write(dataSend); } and her is the receive code #include <SoftwareSerial.h> #include <Printers.h> #include <XBee.h> SoftwareSerial XBee(0,1); String data; void setup() { // put your setup code here, to run once: Serial.begin(9600); XBee.begin(9600); } void loop() { delay(3000); // put your main code here, to run repeatedly: while(XBee.available()) { data = XBee.read(); Serial.print(data); // Serial.print((char)data); Serial.print(" "); } Serial.println(); Serial.println("===================="); } can you help me? in your tutorial, you just send a number(1 or 0). can you tell me how to send a String? or there is another way? i need to send some datas from sensors.
Michael Nathaniel I still haven’t tried to send string data via arduino. From what you’re telling me, the numbers that you are receiving are the ASCI codes of the characters that are sent from the transmitter and it’s showing like that because you’re printing them at the receiver using “serial.print”. Perhaps if you change it to “serial.write” it might work?
Easy informative video..thanks alot
code please
UPDATE: New video posted (Wireless and Hands-free Prototype Light Switch) It uses the same XBee radios shown in this video Link: th-cam.com/video/A8MTWsSVoEQ/w-d-xo.html
Can I have the Code link please......
Check the comments, I posted the code
Can you provide a link for the code?
Hi. I'm trying to run this kid - digi xk-z11-t-w. But i receive the next error. I work with digi esp for python, and i'm trying to use digi tank solution simulation. Any help? XTankSensor: DoCommandRequestForMiscSensorInformation -> START! XTankSensor: DoCommandRequestForMiscSensorInformation -> REQUEST SENT! XTankSensor: scheduling a state machine callback of 20 seconds and a backup callback of 30 seconds.
Thank you! Im No longer scared of Xbee
Do u recommend having a 1k resisitor between rx and tx pins instead of direct connection like you show?
Austin Mosley if you’re using a shield then you don’t need a resistor otherwise yes
Hi, im trying to do this but I have xbee series 2, do I have to configure it differently? When I was configuring them, there was no MY section
how to order a robot with 4 button pussoire transmitter (arduino1) / receiver (arduino2) with this principle of Xbee as on the example of led please answer me ?????
yougourthene brinis You can use the same principle shown in this video but instead of having the receiver XBee controlling an LED have it control a motor driver
Can I get the code
Can I get a code of this
Hey can you send me the link to the project? THANKS
Hey I have a doubt ...I have configured both the radios to be end user, actr the transmitter is supposed to be coordinator and the receive is supposed to be the end-user right ??
I need aurdino code
It's been posted in the comments
What is the schematic of the switch? I have hooked it up and programed it exactly like you say but I can not get it to work. Is the 5v and the resistor common and the terminal connected to pin7 make the connection? I think I have my pushbutton set up wrong....Please Help!
This is perfect for my application! Great job! Can you please post the Arduino code in the coments or provide a link to the code please? Thank you so much!
me to I need the code please ,
i need the codes
I posted the code in the comments
Hello i'm doing a project with Xbee and i don't know where to start. Basically what i want to do is a wireless object counter.The Xbee must be able send the number of object to the computer wirelessly (with the aid of arduino and ultrasonic sensor) whenever an object passes near the sensor. Any advice on how to do this please? Thank you.
Probably a bit late on this but XBee is a radio transmitter. I don't think most computers have radio capabilities. So I suppose you could connect an XBee to your PC. Doesn't Arduino have Bluetooth? If not I'm sure there's a shield for that. I feel like that might work. But who knows. I'm curious what you ended up doing though.
I have a question, why you use pin 2 and 3 in arduino for RX, TX from xbee? it is possible if I use pin RX, TX in arduino directly to connect TX,RX from xbee?
Pins 0 and 1 are hardware serial ports that can only transmit and receive to one device at a time. Since we are using the serial commands in this code, we are communicating the Arduino with the computer via these pins so we can't also use them to communicate it with the XBee radios. Hence, the digital pins are used. In the Arduino Mega however, you are given 3 hardware serial ports to choose from so you can use two ports at the same time without the need of using the digital pins like I did in this video.
mujTech ooh ok, I got it! Thankyou dude👍
ooh sir, i have another question. i wonder if i want to controll the LED intensity with potensiometer, can you explain it? i've tried but still failed. thanks
Unfortunately Adapter is no longer for purchase
i need links for arduino programming
I posted the code in the comments
nice job! very understandable and i liked the step by step setup and visible code - maybe make your code downloadable? i hope you do some more! thx
Like your videos great work and now my question is I have xbee mod sheild and one xbee Bluetooth wireless module so my question is would it still work or I need to get the same cuz talking to the people at this electronic store they said it will because they the same xbee but the other xbee said xbee Bluetooth module and the other day xbee sheild module
Can you give code
hello...your work is very interesting Well I did everything on your tutorial.... but unfortunately it is not working with me I did all the checks....both Xbees are communicating with each other...the codes are same as yours....I just don't know what is the problem Any Advice?? Thanx in advance