IOT | 3Way Switch Without Current Meter Auto Calibrating | Alexa | NodeMcu | Tutorial #18

  Рет қаралды 23,066

Netmedias

Netmedias

Күн бұрын

In this tutorial you will learn how to control a 3 way switch with Alexa without using a current meter. This project can be done with ESP8266 and NodeMcu.
Project Source Code at GitHub
github.com/nas...
Tutorial # 15
• esp8366 arduino | Home...

Пікірлер: 223
@roystervi
@roystervi 6 жыл бұрын
Hi and thanks for the video I just flash it to my nodemcu and it working great... Question, I ask before... is there a way to control this via http url?? the nodemcu ip address is "192.168.0.182" ... I am looking a way to turn on the switch via a url command again thanks in advance
@netmedias7657
@netmedias7657 6 жыл бұрын
bobby royster Thanks for trying it out. I will update the code and post it to GitHub once I have some free time.
@roystervi
@roystervi 6 жыл бұрын
When you do a update can you please tag me on the code can you please tag my name so I can be notify?
@davidmoran4471
@davidmoran4471 6 жыл бұрын
Nice idea using the diode-resistor to feed the analog in. If the 1/4W resistor was getting warm that would indicate a significant current flow. Wouldn't tapping off from a voltage divider with higher value resistance be a better idea? You could also set the voltage divider to make wider range for AC input. You have another viewer below asking about 230V if you set the divider to give 0.25V for 115/120V then you would have ≈ 0.5V for 230V main power, which is well within the 8266's 1.0V maximum input on A0.
@netmedias7657
@netmedias7657 6 жыл бұрын
David Moran You are right and your are one of the best viewers I have bar none. I did not have to use my brain today to answer some of the questions. You took care of them and thank you for that. 😊
@mkhumbie5484
@mkhumbie5484 6 жыл бұрын
David hi, I am trying to understand the circuitry of the current reading through A0. Unfortunately, I am failing to get my fingers around it. This is what I see. I see two 3 way switches (mechanical relay & a switch) connected back to back with mains power on the common side of the switch and the common of the relay connected to both the load and the diode (in fwd bias) and the diode with the protect resistor of 47kOhms to A0. My question is how is A0 reading any current through? what voltage is it using? When say both switches are allowing current through from mains the load will complete the circuit, cool! the current will also flow thru the diode in fwd biased state BUT not complete the circuit as it is open end through A0 right?? how then do we calculate current through that protecting resistor which I believe is the one we are reading through A0? Please I understand the basics of electronics diodes and voltage divider circuits but I can't see past this. I know it works, here at RSA we are on 230 Mains and I want to implement this...
@tiwar87
@tiwar87 6 жыл бұрын
Netmedias , i did it but i can't calibrate good the System! I don't understand how the ac voltaje is converted in DC to go at A0 pin. I measure with the voltemer and it said 50v that was going to the input A0, i know it wasnt real voltaje! Where can I learn about it or how can I set up the System for a wide range of different loads? Thanks
@pedrohenriquepeixoto3964
@pedrohenriquepeixoto3964 6 жыл бұрын
+David Moran Do you mind elaborating on that? Is this voltage divider like a potentiometer? Electronics is not my forte, so I'm having a hard time following it.
@BTopbas
@BTopbas 4 жыл бұрын
​@@netmedias7657 So which parts needs to works with 220-230v ac main?
@roystervi
@roystervi 6 жыл бұрын
again thanks for the videos and each time I can say I learn something new... keep up the good works
@netmedias7657
@netmedias7657 6 жыл бұрын
bobby royster Thanks
@willrnsantana
@willrnsantana 5 жыл бұрын
WOW!! Simply the perfect solution. Thank you SO MUCH!
@tiwar87
@tiwar87 6 жыл бұрын
Thanks buddie, great idea to replace the current meter, ! Keep going forward..
@netmedias7657
@netmedias7657 6 жыл бұрын
tiwar87 Thanks
@pluckygalaxy
@pluckygalaxy 5 жыл бұрын
Excellent tutorial! Thank you for making this!
@netmedias7657
@netmedias7657 5 жыл бұрын
pluckygalaxy Thank you for your feedback.
@nitishprajapati4060
@nitishprajapati4060 6 жыл бұрын
Thanks for making this type of videos
@netmedias7657
@netmedias7657 6 жыл бұрын
Thank you.
@ccasadog
@ccasadog 5 жыл бұрын
Hi, I don’t have knowledge on electronics, electricity nor programming but I’ve been able to do this tutorial. :) Thank you for making it ease. I’m interested in a 4 way switch so the MCU is in the middle and in case it crashes, I can still turn the light on/off from the two manual switch. I understand that a dpdt relay is needed for this. It would be great if you can do a tutorial about this. Greetings from Spain.
@netmedias7657
@netmedias7657 5 жыл бұрын
Cristobal Casado thank you for your valuable feedback. Stay tuned for more variations for 3 and 4 way switches.
@fasihzafar7423
@fasihzafar7423 6 жыл бұрын
i dont have any alexa devices. i want to use this method with blynk application. will you please help me out ,how to do that.
@wayneperryman4146
@wayneperryman4146 6 жыл бұрын
I also am after the same thing.
@sayedhussaini4894
@sayedhussaini4894 5 жыл бұрын
I also please help me out I want to use this using blynk
@ashwin6970
@ashwin6970 6 жыл бұрын
HI Bro .. i have been watching your videos for the last two days , and trying to understand the things which u have done to connect the three way switch with the single relay ..later but i understood the connection shown in the diagram .. i have not gon the coding part . but i will watch the coding part later . .. other thing is that i dont have much knowledge like you do in electronics components and circuit connections , but just know little bit of this and that .. well coming to the point here .. i have echo dot , a both 4 channel and a 8 channel relay . also have successfully connected to the echo dot and relays with the help of nodemcu esp8266 .. till now haven't fired it up on the ac mains .. but i used with the dc currents to switch on and off all the relays with the help of alexa .. but i havent connected using the three way switch just like liked you shown in the video with dc current , as well as with the ac current too . next thing is that i i wanted to connect it with the ac power .. just like you shown . i was planning for my room automation after seeing your video with the ac current connected with relay and alexa with three way switch . but in the diagram you are connected to only single relay and also connect to a analog input . so here you want to help me out . i dont know what to do with it , as per i wanted to connect a 4 channel relay , (or a 8 channel relay with the help of nodemcu in future ) . also how to connect the analog pin too if using a ( 4 channel or a 8 channel relay' output loads) . so could you do a video how to over come with this situation , showing me how to connect the nodemcu esp8266 + 4 or 8 channel relay + along with ( how to connect the analog pin as input for the 4 channels or 8 channels relay as load ) . hope you will help me out in this .
@kaivalyaahir5758
@kaivalyaahir5758 5 жыл бұрын
hi bro you got any solutions???? i have same situation
@maadhurdhananiwala6546
@maadhurdhananiwala6546 4 жыл бұрын
hey how do I add more different lights and switches to control the light and even commands to Alexa
@alfalotfi
@alfalotfi 6 жыл бұрын
Please sir i'm waiting for 8 channel relay tutorial.
@brunogonzalez6812
@brunogonzalez6812 6 жыл бұрын
Great way to substitute the current meter, just one question, is calibartion need to be done every time we reset it or in case of an electricity failure ?
@netmedias7657
@netmedias7657 6 жыл бұрын
bruno gonzalez You only need to recalibrate if you change the bulb with different power consumption. In case of power failure it does not lose the setting
@prod8592
@prod8592 5 жыл бұрын
Nice videos, I would like to do this project, is way more cheaper than buying a smart switch and you learn about iot, can you make a video in an actual wall and also with a power from the mains. Thanks
@greyhnd001
@greyhnd001 3 жыл бұрын
I really like this and I would like to see it done with micropython. It's easy to install on the esp8266. Micropython is 10 times easier to code as well.
@netmedias7657
@netmedias7657 3 жыл бұрын
Sour coming soon.
@vladpuha
@vladpuha 6 жыл бұрын
Thank you for all you work and tutorials. They are great! I have 2 questions: I understand that A0 input is the only serial pin and you can connect one devise to A0 then do the job. Is it possible to have a setup to convert the current into digital output and then connect it to a data pin. Signal is present then devise is on. 2. Is it possible to have the setup you presented on solid state relay with 2 poles. thank you for your tuts they are easy to follow and reproduce!
@netmedias7657
@netmedias7657 6 жыл бұрын
Vlad Puha I am working on to find a way to leverage digital pins. You will need 2 solid stat relays to do the same setup. I will be doing a tutorial on this soon.
@vladpuha
@vladpuha 6 жыл бұрын
thank you for the clue, Nassir! I will try to figure it out to if I can understand it. As for the analog to digital can a analog to digital be used? (I do programming for leaving dont have knowledge besides beyond basis in the field).
@netmedias7657
@netmedias7657 6 жыл бұрын
Theoretically, it should work.
@marcosyllades8549
@marcosyllades8549 5 жыл бұрын
Hi Nassir, thanks for the greats projects!! I have an issue with Alexa recognizing this device. On serial screen: Saving Calibrating current... 27 Reading EEPROM Door Status: 22 Reading Calibrating current... 22 Saving Calibrating current... 1024 Reading EEPROM Door Status: 1019 Any tougths? Regards.
@netmedias7657
@netmedias7657 5 жыл бұрын
Are you able to discover the device?
@marcosyllades8549
@marcosyllades8549 5 жыл бұрын
Not yet
@marcosyllades8549
@marcosyllades8549 5 жыл бұрын
@@netmedias7657 Hi there, Thanks for your response. Alexa finally detects the device but it says that "Demo switch is nos compatible with this". I had this error first at compiling: exit status 1 request for member 'indexOf' in 'request', which is of non-class type 'int' I comment those lines and it compiles but it doesn´t work as it should. Every time that I turn off the interruptor it keeps turning on by itself!!! 0########## Responding to /upnp/control/basicevent1 ... ########## Got Turn on request turnOnRelay..... 0 The effective value of the current is(in mA) 1024 Switch was on 0########## Responding to /upnp/control/basicevent1 ... ########## Got Turn on request turnOnRelay..... 0 The effective value of the current is(in mA) 156 Switch was off 0########## Responding to /upnp/control/basicevent1 ... ########## Got Turn on request turnOnRelay..... 1 The effective value of the current is(in mA) 1024 Switch was on Any ideas? Thanks in advance.
@ganeshmurukutla8977
@ganeshmurukutla8977 4 жыл бұрын
Marcos Yllades i am also getting thr same error have u resolved it sir ??
@rosspower7514
@rosspower7514 6 жыл бұрын
Thank you for a great video. I am having trouble when the nodemcu is powered from an ac/dc converter. when connected, there is not enough difference in the threshold to detect the current. When powered from a battery source it is fine. any ideas on how to isolate the power supply or stop the feedback?
@netmedias7657
@netmedias7657 6 жыл бұрын
Ross Power I used the ac/dc adopter during the demo and it is working fine.
@bradzimmerman306
@bradzimmerman306 6 жыл бұрын
Hi. I'm just getting started in the Arduino world, and really like your tutorials on home automation. I have run into an issue with getting any of your sketches to work. They flash fine. My network recognizes them. I have used the Nodemcu, and the 8266 12E alone. I cannot get Alexa to control them. I get the message waiting for Belkin International, and "device is unresponsive" on my Alexa App. I turn the 8266 on and off thru Alexa and with the Alexa App, and get the same error messages. Sometimes it turns on, most of the time it doesn't. What Does Belkin have to do with the sketch? Also, the light is usually on- on the Nodemcu..Please help
@johnefthymiadis302
@johnefthymiadis302 6 жыл бұрын
Good job the think is how is going to work on 4 relays and 4 separate loads?
@netmedias7657
@netmedias7657 6 жыл бұрын
Stay tuned. 8 channel tutorial coming soon.
@sanjaykumarsinha3058
@sanjaykumarsinha3058 4 жыл бұрын
That was a huge help! But can you please give us a Blynk compatible code for the same. It will be very helpful. I have got some other codes but they use current meter. And i don't know what changes would i have to make in their code.
@deepachavali2424
@deepachavali2424 4 жыл бұрын
what about fail safe state of the circut.? like power down/ Internet down issues.?
@Morfoz13
@Morfoz13 6 жыл бұрын
Great project!! Is there a way how to replace the commands from Alexa to phone app or http? Thank you in advance!
@Tgrossman96
@Tgrossman96 2 жыл бұрын
Im getting compiling error Arduino: 1.8.16 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200" C:\Users\Admin\Documents\Arduino\IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating.ino\IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating.ino.ino: In lambda function: IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating.ino:232:14: error: request for member 'indexOf' in 'request', which is of non-class type 'int' 232 | if(request.indexOf("GetBinaryState") >= 0) { | ^~~~~~~ exit status 1 request for member 'indexOf' in 'request', which is of non-class type 'int' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
@hansjansen1961
@hansjansen1961 6 жыл бұрын
In the schematics in the video the cathode of the diode is pointing to the HV side. But further on in the video the cathode is pointing in the opposite direction. Why?
@netmedias7657
@netmedias7657 6 жыл бұрын
Hans Jansen I am not sure if this is the case then I may have made a mistake. Just follow the demo.
@capextechnicalservicesllc3054
@capextechnicalservicesllc3054 4 жыл бұрын
hi it is a great video tutorial. can you please help me , how to add MQTT in this program so that i can connect it with home assistant.
@hassanahmad9597
@hassanahmad9597 6 жыл бұрын
what happen if you takeout the led and then turn it on
@netmedias7657
@netmedias7657 6 жыл бұрын
I am not sure what your are asking. It only works when the current is flowing.
@nimeshlad594
@nimeshlad594 5 жыл бұрын
Sir can we make two control using normal SPST switch and relay using some code logic with node MCU ??
@kenprochaska2286
@kenprochaska2286 6 жыл бұрын
Is there a way to power up the MCU or 8266 from the mains? I would like to make a self contained unit with no outside power supply.
@netmedias7657
@netmedias7657 6 жыл бұрын
Ken Prochaska You can use the 110v to 3/5 dc Step Down Buck Converter. They are 3rd the size of MCU. www.ebay.com/itm/1PCS-5W-AC-DC-12V-450mA-Power-Supply-Buck-Converter-Step-Down-Module/191981585009?hash=item2cb2fe8271:g:9LUAAOSwYIxX4QL1 www.ebay.com/itm/1pcs-HLK-PM01-AC-DC-220V-to-5V-Step-Down-Power-Supply-Module-Household-Switch/152825646956?epid=874404704&hash=item23951e4f6c:g:WxcAAOSwh1haJOyT
@amargupta.8847
@amargupta.8847 6 жыл бұрын
Netmedias , can we use any led driver and a 7805 to power the 8266, I think it's cheaper than other sources in my country...... By the way u deserve a great appreciation for ur effort... keep going man....
@netmedias7657
@netmedias7657 6 жыл бұрын
You can use any power supply that can provide 3.3 volts and at least 170 mA.
@pongpolc.8696
@pongpolc.8696 6 жыл бұрын
Thank you for your work. it is very cool. Does Node mcu work with google home mini. Many thank in advance
@netmedias7657
@netmedias7657 6 жыл бұрын
Pongpol C. Thank you.
@seancunningham6785
@seancunningham6785 5 жыл бұрын
I am having an issue where the off command will both turn the relay high then Low, however the On command will do nothing as to changing the relay state . It's almost as if there is always current but I tested with a multimeter and there is none when light is off
@netmedias7657
@netmedias7657 5 жыл бұрын
It is doing that because the current sensing limit is not set correctly or you are using an Active low relay.
@maadhurdhananiwala6546
@maadhurdhananiwala6546 4 жыл бұрын
hey the project is too good and I was trying the code to verify in ide but the error is showing down below: Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Sketch + WiFi Settings, 115200" C:\Users\maadh\OneDrive\Desktop\3 way switch\IOT-3Way-Switch-Without_Current-Meter-Auto-Calibrating-master\IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating\IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating.ino: In lambda function: IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating:232:14: error: request for member 'indexOf' in 'request', which is of non-class type 'int' if(request.indexOf("GetBinaryState") >= 0) { ^ exit status 1 request for member 'indexOf' in 'request', which is of non-class type 'int' This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. ;
@tanmaymondal885
@tanmaymondal885 6 жыл бұрын
why this diode and resister are connected to the a0 port of nodemcu?
@shouryasaha65
@shouryasaha65 6 жыл бұрын
Is it possible to use more than 1 relay? What about I use a 4 relay board? I think the real question is can there be more than 1 input pin for the diode+resistor?
@netmedias7657
@netmedias7657 6 жыл бұрын
Yes, but you need more than one analog pin.NodeMcu has only one. Use ADC converter to control more relay. Watch my Pi3 video. I am working on Sonoff 4 ch pro to make it current sensing without analog pins. Stay Tuned. kzbin.info/www/bejne/pnPblnuiq6tnm7M
@amiromaramir7049
@amiromaramir7049 6 жыл бұрын
Hi engr Nasir Malik i was making these days home project i wanna use relay with 2 way switch and 47k resistor is must or i can use other resistor .help me please
@netmedias7657
@netmedias7657 6 жыл бұрын
You need 47k or above
@ahellard74
@ahellard74 5 жыл бұрын
Hi I was wondering what the code would look like if you just used a opto-isolator and just measured a high or low on the status pin?
@netmedias7657
@netmedias7657 5 жыл бұрын
Remove the "currentMeter();" in on off function in ino file and check the opto high or low and set the of "deviceState" void turnOffRelay() { Serial.println("turnOffRelay....."); Serial.println(digitalRead(relayPin)); // check opto state and set the deviceState variable to high or low Serial.print(digitalRead(relayPin)); if (deviceState == 1){ digitalWrite(relayPin, !digitalRead(relayPin)); // turn off relay with voltage LOW } }
@ahellard74
@ahellard74 5 жыл бұрын
new to programming do I need to still have the current_meter .h file? @@netmedias7657
@netmedias7657
@netmedias7657 5 жыл бұрын
@@ahellard74 NO you don't need it. Remove it from your main sketch. Good Luck
@bhutchins1991
@bhutchins1991 6 жыл бұрын
could you possibly post a link to the libraries you use, just to be sure as there are so many variations! thanks
@netmedias7657
@netmedias7657 6 жыл бұрын
github.com/nassir-malik/IOT-3Way-Switch-Without_Current-Meter-Auto-Calibrating
@roystervi
@roystervi 6 жыл бұрын
any dodemcu will work ???.. I know the older notemcu does not have the VV, also I have a switch I like to try this on. the switch is control from two different location.
@netmedias7657
@netmedias7657 6 жыл бұрын
bobby royster It will work any ESP8266 and NodeMcu.
@SebiMT301
@SebiMT301 6 жыл бұрын
Could you show please how can I do the same directly with raspberry pi? I am working on a smart home solution and my problem is the relay is working with switch but separately and the relay doesn't recognize if I turn my switch. Thank you!
@netmedias7657
@netmedias7657 6 жыл бұрын
I'll upload a tutorial soon.
@krishnpalsinghchouhankp
@krishnpalsinghchouhankp 5 жыл бұрын
Is it possible add 4 or 8 relay and check power
@dipankarsarkar0503
@dipankarsarkar0503 5 жыл бұрын
Can u make a light and ac dimmer with the same 3 way controlling then i can use the light or fan manually or by app?
@netmedias7657
@netmedias7657 5 жыл бұрын
Sure, stay tuned
@markdav13s1
@markdav13s1 5 жыл бұрын
Great video. Is there a way to use the same setup or the setup with power meter to run 2 separate switches to separate relays? And set it so if one relay is on the other relay turns off and vice versa? I'm looking to switch the fan speed between speed one and two with automation with also a backup manual switch. So when I set speed one on the fan speed two switches off. And same thing happens when speed two is selected. This tutorial would definitely help to get one speed going but I need tthe second speed also. They can't both be on at the same time because of the resistance difference on both switches. Hope someone can help.
@netmedias7657
@netmedias7657 5 жыл бұрын
Using this method has limitations since NodeMcu has only one analog pin. You can use converter but it makes it more complected. I show how to use ADC in pi 3 tutorial. I am working on another tutorial that works with that standard GPIO. Stay tuned.
@markdav13s1
@markdav13s1 5 жыл бұрын
Thanks for your reply. What if digital switches were used?
@netmedias7657
@netmedias7657 5 жыл бұрын
You can used ADC converter to use with digital pin.
@aliasaad1347
@aliasaad1347 3 жыл бұрын
i want to use this wonderful method with 8 channel relay , can be done?
@netmedias7657
@netmedias7657 3 жыл бұрын
Yes, you can
@priyeshsahani
@priyeshsahani 4 жыл бұрын
Hey i want to do this with the BOLT IOT KIT. How can i do so please help
@arunsharmasp
@arunsharmasp 6 жыл бұрын
Can I use ACS712 (Current Sensor Module 20A range ACS712 Module module ACS712T Arduino) instead of this diode & resister???
@netmedias7657
@netmedias7657 6 жыл бұрын
Yes you can.
@muthushankar9543
@muthushankar9543 4 жыл бұрын
hello there, when i try to upload the code i get this error.can somebody help to fix this issue IOT-3Way-Switch-Without_Curent-Meter-Auto-Calibrating:232:14: error: request for member 'indexOf' in 'request', which is of non-class type 'int' if(request.indexOf("GetBinaryState") >= 0) { ^ exit status 1 request for member 'indexOf' in 'request', which is of non-class type 'int'
@ajaygupta-pj8qh
@ajaygupta-pj8qh 6 жыл бұрын
Please make video for 8 or 4 CH relay circuit
@netmedias7657
@netmedias7657 6 жыл бұрын
Working on it. Stay tuned.
@ericpeter2055
@ericpeter2055 5 жыл бұрын
the nodemcu can control upto 9 relays as it has 9 digital pins. Is there a way i could use a switch for all the 9 relays?
@netmedias7657
@netmedias7657 5 жыл бұрын
Use optocoupler/isolator to detect the current and then you can use all GPIOs. Good luck
@Theo12415
@Theo12415 4 жыл бұрын
When is the 8 relay video coming out ?
@randisetiawan9789
@randisetiawan9789 4 жыл бұрын
Would you made same project like this but using the blynk app?
@netmedias7657
@netmedias7657 4 жыл бұрын
Sure. Stay tuned
@randisetiawan9789
@randisetiawan9789 4 жыл бұрын
I will wait for it, i have already search for project like this but i couldn't find it
@randisetiawan9789
@randisetiawan9789 4 жыл бұрын
I still waiting sir
@eserviceconsultancy9466
@eserviceconsultancy9466 5 жыл бұрын
Hi if we want to use the same concept in tasmota sonoff firmware , will it work ?
@netmedias7657
@netmedias7657 5 жыл бұрын
It will not work as is. You will have to modify the tasmota code for this to work.
@vanderleisilvasantos5343
@vanderleisilvasantos5343 2 жыл бұрын
Can you make this with 4 relay?
@roystervi
@roystervi 6 жыл бұрын
Hi again... I re-flash the notemcu and have the diode and the resistor pointing accordingly... however, I can only get the light to turn off/off from alexa if the switch is in the on position. I can't seem to get the switch to turn on or off/off the light only if the relay is in the close position. My setup is just like yours along with the nodemcu v3 1########## Responding to /upnp/control/basicevent1 ... ########## Got Turn on request turnOnRelay..... 0 The effective value of the current is(in mA) 10 Switch was off 0########## Responding to /upnp/control/basicevent1 ... ##########
@netmedias7657
@netmedias7657 6 жыл бұрын
bobby royster You need to turn on the light and press the flash button to calibrate it.
@roystervi
@roystervi 6 жыл бұрын
When I say alexa turn off sw it will turn it off and when I say alexa turn off sw it will turn on 1########## Responding to /upnp/control/basicevent1 ... ########## Got Turn off request turnOffRelay..... 1 The effective value of the current is(in mA) 6 Switch was on 1Saving Calibrating current... 0 Reading EEPROM Door Status: -5
@roystervi
@roystervi 6 жыл бұрын
I think I find the problem .... My light switch (LSW) has the black screw where you hook up the two wire going to the relay.... so I connected mines just like you did. upon watch your video over and over the black screw have to go to one wire coming from the lamp. now its working Also, I have to put in a number here ........................."int device_on_current_threshold;//if the current value (100) is greater than this amount then the device is on" so I put 100 since off is 10 and I gave myself some leeway, I replace milliamps to (100).. now its working like it should... doing it this way I was about to use a url command......... "192.168.0.133/switch" turn the light off.........but I have no way to turn it back on via url command...
@vladpuha
@vladpuha 6 жыл бұрын
you connected the pols on the switch wrong or on the relay. check again the tuts and your connection
@yogeshitaliya473
@yogeshitaliya473 5 жыл бұрын
It's possible use multiple relay with A0 ? For example. 4 chenal relay us all connection A0
@netmedias7657
@netmedias7657 5 жыл бұрын
Yogesh Italiya No, You need one analog pin for each relay.
@yogeshitaliya473
@yogeshitaliya473 5 жыл бұрын
@@netmedias7657 thankyou for reply
@Amirt1999
@Amirt1999 5 жыл бұрын
you cau use multiplexer
@amargupta.8847
@amargupta.8847 6 жыл бұрын
Hey can I use the same diode for 230v supply.... and looks like even a simple mistake can burn the nodemcu.....
@thegeekahub7663
@thegeekahub7663 6 жыл бұрын
AMAR GUPTA. Same dought.
@netmedias7657
@netmedias7657 6 жыл бұрын
AMAR GUPTA/The Geekahub Please see the answer by "David Moran" above. Thanks for your comments.
@maadhurdhananiwala6546
@maadhurdhananiwala6546 4 жыл бұрын
i am not able to connect alexa to the esp266
@YoshiFan190
@YoshiFan190 5 жыл бұрын
Hey, can i use the same resistor and diode for 220v systems?
@netmedias7657
@netmedias7657 5 жыл бұрын
Yes
@chi-tinhnguyen5176
@chi-tinhnguyen5176 6 жыл бұрын
What a nice video I have a question that How can we sercure data, if someonce also have alexa and they discover and they control our device... How can we encode that Please help me
@netmedias7657
@netmedias7657 6 жыл бұрын
Chi-Tinh Nguyen Use "WiFiClientSecure" for client instead. You can also use proxy with ssl for server.
@chi-tinhnguyen5176
@chi-tinhnguyen5176 6 жыл бұрын
Thank sir Please tell me that How can I do like you show me above
@sayedhussaini4894
@sayedhussaini4894 5 жыл бұрын
Which terminal of the diode we have to connect to the line wire ?
@netmedias7657
@netmedias7657 5 жыл бұрын
Anode to wire and cathode to NodeMcu analog pin
@RandomFunwithfact
@RandomFunwithfact 6 жыл бұрын
sir i m having a raspberry pi 3 and my plan is to make a smart house using esp2866 12 e i want to plac raspbeery pi in one room and rest al esp2866 12 e will but in whole house many relay will be connect to them i want to control them by smarhone as well as laptop as well as using voice what should i use can u plzz help me
@netmedias7657
@netmedias7657 6 жыл бұрын
Aniket I am doing the siiler thing. I want to use pi with touch screen as hub in few rooms and control everything from it. I will be doing a tutorial where you are able to connect and control multiple RF and wifi devices like ESP8266 and Rf radio. Stay tuned.
@RandomFunwithfact
@RandomFunwithfact 6 жыл бұрын
thanks:)
@ghigginbotham6095
@ghigginbotham6095 5 жыл бұрын
If I have more than one location can I do the same thing, but change location name in the code?
@netmedias7657
@netmedias7657 5 жыл бұрын
There is only one analog pin on NodeMcu. You have two options. First option is to use ADC converter as I show in following video or wait for next video that show how to do this without analog pin. kzbin.info/www/bejne/pnPblnuiq6tnm7M
@roystervi
@roystervi 6 жыл бұрын
Can MQTT be added to this code ? ... I was wonder if I can use something else other than alexa to turn the light on/off as well via mqtt
@netmedias7657
@netmedias7657 6 жыл бұрын
bobby royster You can add MQTT and URL support. I am doing URL trigger on/off in some of the projects.
@roystervi
@roystervi 6 жыл бұрын
does your IOT | 3Way Switch and your IOT | 4Way Switch has URL trigger on/off ... I have not install as yet
@roystervi
@roystervi 6 жыл бұрын
what is the URL command to trigger on/off
@smcengineer6595
@smcengineer6595 6 жыл бұрын
Great Project. is there any way to use multiple relay control using ESP32 ...
@netmedias7657
@netmedias7657 6 жыл бұрын
Yes, See my other tutorial to control multiple relays. For current sensation you will need to use ADC converter if you want to support multiple current sensing devices.
@smcengineer6595
@smcengineer6595 6 жыл бұрын
can we use ESP32 instead of ADC Converter and also want to control it using my smart phone, i am new to NODEMCU Prograaming....
@Little_Shivya
@Little_Shivya 6 жыл бұрын
Really liked it.. Can this work with Google home??
@netmedias7657
@netmedias7657 6 жыл бұрын
I will upload a tutorial for Google Home soon. Stay tuned.
@Roaming_with_akshay
@Roaming_with_akshay 5 жыл бұрын
@@netmedias7657 please tell how to do it
@giraftw2002
@giraftw2002 6 жыл бұрын
why no transistor is required to drive the relay? please advise.
@netmedias7657
@netmedias7657 6 жыл бұрын
Mark Huang I am not sure I understand your question.
@thegeekahub7663
@thegeekahub7663 6 жыл бұрын
We want a sketch of 8 channel relay.
@netmedias7657
@netmedias7657 6 жыл бұрын
The Geekahub This buffet has a long line so you have to wait for your turn :-). Sir, your request is on my to do list. Stay tuned.
@krishnpalsinghchouhankp
@krishnpalsinghchouhankp 5 жыл бұрын
Please Link your all video in next video
@andreamitchell4758
@andreamitchell4758 6 жыл бұрын
the problem is that you are not showing us how to wire it to a 3 way switch setup if you have one 3 way switch then you most likely have another 3 way switch that it goes to this is just showing how to wire the node MCU to the circuit with only one 3 way wall switch i have two 3 way wall switches and i want to use the node mcu and either of the 2 wall switches to control the light so can you pleas ed o video tutorial on how to wire it that way? i see you have both of the traveler wires going to the relay so then how would you connect in the other 3 way wall switch?
@davidmoran4471
@davidmoran4471 6 жыл бұрын
His relay is the second 3 way switch. 2 wall switches and the node mcu control would require one of the wall switches to be a 4 way. The string of switches starts (power end) and ends (load end) with a 3 way switch and the additional switch(es) in the center of the string will all be 4 way switches. look at his IOT | Home Automation with Alexa | 4 way switch Part 3| and you will see it.
@andreamitchell4758
@andreamitchell4758 6 жыл бұрын
but that tutorial shows 3 wall switches and the node MCU smart switch i do not want that either i want 2 wall switches and the node MCU controlling the light , so what do i need and how do i wire it? one 3 way and one 4 way switch then take the neutral wire from the 4 way switch that goes to the light and put it on the com terminal of the relay and then connect the other 2 relay terminals to the 4 way switch traveler wire contacts?
@andreamitchell4758
@andreamitchell4758 6 жыл бұрын
one more issue i see is hw are we going to power the node MCU ? if i want to put this in my wall then can i use a 5v wall wart or maybe a buck converter to power the node MCU but then if you have a 3 way or 4 way switch you won't have one wire that is constantly hot
@netmedias7657
@netmedias7657 6 жыл бұрын
Andrea Mitchell Please see the "David Moran" answer. He is spot on. I am not sure if I can add anything to his answer. Good luck.
@netmedias7657
@netmedias7657 6 жыл бұрын
David Moran Thank you for your help. You did a better job explaining it than could have done.
@girolamonicoletti4625
@girolamonicoletti4625 4 жыл бұрын
Scusa non riesco a trovare il modulo con Alexa. Ciao Grazie
@rushi5778
@rushi5778 3 жыл бұрын
How to add multiple switches????
@rhendytay06
@rhendytay06 6 жыл бұрын
Hi sir, can i change the resistor to 1/4 watt? If can then need to change the value in arduino code ? Nice tutor... Thanks.
@netmedias7657
@netmedias7657 6 жыл бұрын
It is risky. It may heat up and cause problems.
@rhendytay06
@rhendytay06 6 жыл бұрын
can i use a resistor 1/4 watt combine ? how many watt the lamp you using sir ? Thanks.
@netmedias7657
@netmedias7657 6 жыл бұрын
Rhendy Tay you can try to use the 1/4 watt resistor. If it stays cool then you are fine. If it starts to get warm then you will need the 1/2. I did the same thing.
@rhendytay06
@rhendytay06 6 жыл бұрын
Thank sir for your reply, get all working well.
@bigdawg3600
@bigdawg3600 6 жыл бұрын
You are tapping off the 120 volt circuit to feed the GPIO on the micro controller? What about the common?
@netmedias7657
@netmedias7657 6 жыл бұрын
Eric Hughes I am not sure what your question is. Neutral wire is going directly from the plug to light bulb. Thank you for the feedback.
@lelmus3277
@lelmus3277 6 жыл бұрын
You are correct, the high voltage mains have no closed circuit to the ESP because the mains neutral is not connected to the ESP. What he’s doing is making an antenna that’s resonating very high due to the very high voltage and it’s getting picked up by the ADC in the ESP. Kind of similar concept to wirelessly detecting the engine running in a car. It’s not an orthodox design but could work. I probably would have done it very differently, but that’s just me.
@netmedias7657
@netmedias7657 6 жыл бұрын
Eugene Frenkel Thank you for your clarification I really appreciate it.
@mkhumbie5484
@mkhumbie5484 6 жыл бұрын
Hope I am not that late Eugene I have been trying to understand the circuit. So I have two questions what's the use of that 4.7k resistor then? 2. I see the circuit is not grounded but applying so much voltage across A0 will not affect the ESP?
@netmedias7657
@netmedias7657 6 жыл бұрын
Resistor is dropping the current down. My circuit is bear minimum. To protect the board you can use a fuse with correct amp power. Yes it works for 220 volts. You can test it with led first before your connect it to your board.
@miguelelias8932
@miguelelias8932 6 жыл бұрын
Thank you so much for this tutorial, very interesting but for me doesn't work very good. i don't know what I did wrong, because when I say "Alexa, turn on demo switch" Alexa turn off the light, and when I say "Alexa, turn off demo switch" Alexa turn on the light. And sometimes doesn't work at all. Any Ideas????
@netmedias7657
@netmedias7657 6 жыл бұрын
Miguel Elias make sure calibrate it when light is on. Are you using Mechanical relay?
@miguelelias8932
@miguelelias8932 6 жыл бұрын
Thank you for your quick response. Yes, I'm using the same relay you used on your tutorial. I tried to start it over deleting everything and flashing again, but everything got worse. Now i have errors. :(
@miguelelias8932
@miguelelias8932 6 жыл бұрын
esptool v0.4.12 - (c) 2014 Ch. Klippel setting board to nodemcu setting baudrate from 115200 to 9600 setting port from to COM3 setting address from 0x00000000 to 0x00000000 espcomm_upload_file espcomm_upload_mem setting serial port timeouts to 1000 ms opening bootloader resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 36 bytes of data warning: espcomm_send_command: wrong direction/command: 0x00 0x08, expected 0x01 0x08 warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed error: espcomm_upload_mem failed
@miguelelias8932
@miguelelias8932 6 жыл бұрын
This is weird, (I change the name "demoswitch" for "Light"). Now is working but only saying "Alexa turn OFF the light" if the light was off turn it on, and if the light was on, turn it off, if I say " Alexa turn ON the light" Nothing happen, and Alexa replies OK. I can turn ON or OFF the light, only saying "Alexa turn OFF the light. Any Ideas how can I fix this??
@capextechnicalservicesllc3054
@capextechnicalservicesllc3054 4 жыл бұрын
How to add MQTT broker in this
@pedrohenriquepeixoto3964
@pedrohenriquepeixoto3964 6 жыл бұрын
Is there . away to use one ESP8266 to make more than one 3-way switch?
@netmedias7657
@netmedias7657 6 жыл бұрын
Pedro Henrique Peixoto you can use ADC converter. I am trying to find a simpler way.
@pedrohenriquepeixoto3964
@pedrohenriquepeixoto3964 6 жыл бұрын
Netmedias didn't get where this converter would help. I though the bigger issue would be to dedetct the current from multiple switches, since the esp8266 only has one analog input
@netmedias7657
@netmedias7657 6 жыл бұрын
Converts analog to digital and you can check if GPIO high then device is on otherwise it is off.
@nhatminh1209
@nhatminh1209 6 жыл бұрын
Could we use ESP-01 to do it without current meter?
@netmedias7657
@netmedias7657 6 жыл бұрын
nhatminh1209 No, since it does not have a analog gpio. You can use analog to digital converter with esp 01.
@nhatminh1209
@nhatminh1209 6 жыл бұрын
Is digital converter too compicated :) I have fancy on creating like you. Can I ask you sometime with messenger?
@vishaltejwani940
@vishaltejwani940 6 жыл бұрын
How can i use it with ardunio nano and hc05 for time being?
@netmedias7657
@netmedias7657 6 жыл бұрын
Vishal Tejwani You will need some sort of wifi shield for nano for this setup to work. You can use the same sketch for nano just update the GPIO pin.
@justineaaron333
@justineaaron333 5 жыл бұрын
Hello, How to wire with multiple relay I want to measure four different loads using 4 relay module
@netmedias7657
@netmedias7657 5 жыл бұрын
Stay tuned for next tutorial for 8 relays.
@himanshugore4427
@himanshugore4427 4 жыл бұрын
@@netmedias7657 Sir It's about 10 months when the next tutorial is coming.
@netmedias7657
@netmedias7657 4 жыл бұрын
@@himanshugore4427 Sorry for the delay. Next couple of weeks.
@himanshugore4427
@himanshugore4427 4 жыл бұрын
Netmedias Ok Sir waiting for it.
@vishalagarwal1451
@vishalagarwal1451 5 жыл бұрын
I wonder why dont you start your home automation startup you know to much about it??
@netmedias7657
@netmedias7657 5 жыл бұрын
You are right. Stay tuned.
@JoCa_MPC
@JoCa_MPC 6 жыл бұрын
Where you buy the relays ? they are 5v?
@netmedias7657
@netmedias7657 6 жыл бұрын
Jorge Capitão I get them from ebay for banggood. www.banggood.com/5Pcs-5V-Relay-5-12V-TTL-Signal-1-Channel-Module-High-Level-Expansion-Board-For-Arduino-p-1178210.html?rmmds=search&cur_warehouse=CN www.ebay.com/itm/1pc-DC12V-Channel-5V-Low-Level-Power-Supply-Relay-Module-SRD-12VDC-SL-C-Clips/311941401345?hash=item48a1280b01:g:RcMAAOSwxKtYBpYf
@ahellard74
@ahellard74 5 жыл бұрын
Can this code be used on the same network on multiple esp8266s as long as the Device Name "DemoSwitch " is unique?
@netmedias7657
@netmedias7657 5 жыл бұрын
Yes
@ahellard74
@ahellard74 5 жыл бұрын
Ok thanks I have seen people saying they have had issues with more than one device in the same lan.
@ahellard74
@ahellard74 5 жыл бұрын
Netmedias when run the code it seems to work but if I use the Alexa app things don’t work correctly. Have you ever experienced that?
@parimal67
@parimal67 6 жыл бұрын
not able to discover device by alexa. can you help me out?
@netmedias7657
@netmedias7657 6 жыл бұрын
What do you see in Arduino serial window?
@kaivalyaahir5758
@kaivalyaahir5758 5 жыл бұрын
hi you did nice job but i have a issue what if i wanted to control 8 relays so can you tell me the code for that
@netmedias7657
@netmedias7657 5 жыл бұрын
Since there is one analog pin on NodeMcu we can only control one device. I am working on solution where you will be able to control using all GPIO pins.
@kaivalyaahir5758
@kaivalyaahir5758 5 жыл бұрын
@@netmedias7657 hi thanks for your reply i must appreciate it.and for that i have an idea and want to know that if it is possible or not because i am new at home automation.
@kaivalyaahir5758
@kaivalyaahir5758 5 жыл бұрын
@@netmedias7657 can we make a program with if else statement that if the relay is high than make it low and if the relay is low than make it high. for example:- if i say alexa turn on demoswitch than it will figure out that if the relay is high than make it low and it relay is low than make it high. so this way we don't need current sensor or anything else too. and we can control it from physical switch and alexa both... reply if it is possible or not....
@justineaaron333
@justineaaron333 5 жыл бұрын
is this possible with with arduino uno?
@netmedias7657
@netmedias7657 5 жыл бұрын
Justine Aaron Yes, you can use the same code and replace the timer code.
@aliasaad1347
@aliasaad1347 3 жыл бұрын
can this method used with bylnk ?
@netmedias7657
@netmedias7657 3 жыл бұрын
Yes, just watch my bylnk tutorial
@eagleeyegps8003
@eagleeyegps8003 6 жыл бұрын
how 8ch relay can we conect for this project??
@netmedias7657
@netmedias7657 6 жыл бұрын
Working on it. Stay tuned.
@eagleeyegps8003
@eagleeyegps8003 6 жыл бұрын
okay
@88TOPDOG
@88TOPDOG 6 жыл бұрын
Hi can this access via mobile phone APP
@netmedias7657
@netmedias7657 6 жыл бұрын
I will have mobile support in future support.
@Roaming_with_akshay
@Roaming_with_akshay 5 жыл бұрын
How to do same with Google assistant
@netmedias7657
@netmedias7657 5 жыл бұрын
Tutorial coming soon
@hassanahmad9597
@hassanahmad9597 5 жыл бұрын
Is it Work with adafruit?
@netmedias7657
@netmedias7657 5 жыл бұрын
It is Arduino compatible.
@suchitaindulkar9822
@suchitaindulkar9822 5 жыл бұрын
How to do this for 240V
@netmedias7657
@netmedias7657 5 жыл бұрын
Suchita Indulkar Set it up the same way just double the resistor value.
@TheRebanein
@TheRebanein 4 жыл бұрын
Can you tell me what diode you used? (newbie)
@netmedias7657
@netmedias7657 4 жыл бұрын
1n4007
@SimoneGiacomelli
@SimoneGiacomelli 3 жыл бұрын
You are awesome. Thank you for your great tutorial!
@netmedias7657
@netmedias7657 3 жыл бұрын
You're very welcome!
IOT| Home Automation | Sonoff 4ch Pro part1| Tutorial # 20
17:53
Harley Quinn's revenge plan!!!#Harley Quinn #joker
00:59
Harley Quinn with the Joker
Рет қаралды 24 МЛН
طردت النملة من المنزل😡 ماذا فعل؟🥲
00:25
Cool Tool SHORTS Arabic
Рет қаралды 10 МЛН
Game Room Automation with Alexa & Google Home | Part 1 | # 12
25:29
DIY Smart Switch - Part 1 how to use a relay
8:02
byte sized engineering
Рет қаралды 640 М.
Sensors - which one to use
17:06
Electronoobs
Рет қаралды 1,3 МЛН
Big Stepper Motors with Arduino
29:43
DroneBot Workshop
Рет қаралды 1,2 МЛН
Control Nearly ANYTHING with Alexa for under $10! 👍
5:24
MKme Lab
Рет қаралды 261 М.
Motion-activated Servo Motors with Arduino and PIR Sensor
25:20
Rachel De Barros
Рет қаралды 27 М.
Samsung Galaxy S24 Ultra Vs Iphone 15 Pro Max
0:56
Roanet Tech
Рет қаралды 8 МЛН
Как противодействовать FPV дронам
44:34
Стратег Диванного Легиона
Рет қаралды 224 М.
Смартфоны миллиардеров 🤑
0:53
serg1us
Рет қаралды 698 М.
💀СЛОМАЛ Айфон за 5 СЕКУНД😱
0:26
Demin's Lounge
Рет қаралды 144 М.
Как настроить камеру хоп-ап
1:00
TimToker
Рет қаралды 2,7 МЛН
Почему iPhone 16 никого не удивит?
0:42
ÉЖИ АКСЁНОВ
Рет қаралды 82 М.