Control a Relay From Anywhere Using the ESP8266

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ค. 2024
  • 📝 Get our FREE guide to learn how to build IoT projects with the ESP8266: makecademy.com/control-esp826...
    In this project, I show you how to control a simple relay from anywhere, using the ESP8266 WiFi chip. You will then be able to adapt the project to control any home appliance from anywhere in the world.
    -----------------------------
    Follow us on social media:
    Facebook: / makecademy
    Twitter: / makecademy
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 151

  • @openhomeautomation
    @openhomeautomation  ปีที่แล้ว

    Hope this video was useful for you! I would love to hear what you think about it in the comments :)

    • @alexjames6747
      @alexjames6747 24 วันที่ผ่านมา

      Have you tried it? Does it work? Really?

    • @alexjames6747
      @alexjames6747 24 วันที่ผ่านมา

      Doesn't compile. cannot covert "String" to "char" in initialization.
      char* out_topic = arestVar.get_topic();
      Even if it compiles, what it should DO?

  • @douglasthomson2986
    @douglasthomson2986 5 ปีที่แล้ว

    Fabulous. Thanks for this. Just what I was looking for. Subscribed!

  • @bobarry8167
    @bobarry8167 7 ปีที่แล้ว +1

    Nice. Just got your book. Still learning. Didn't know about the dashboard - W4GHV since '54

  • @SoumilShah
    @SoumilShah 8 ปีที่แล้ว

    Hey there just want to thank you for creating videos
    We learned a lot from you

  • @billfield8300
    @billfield8300 8 ปีที่แล้ว

    Thanks for the video. you made this look very simple and easy.

  • @craigminca7446
    @craigminca7446 7 ปีที่แล้ว +2

    great video mate. thanks, your tutorial makes it so much easier.

    • @craigminca7446
      @craigminca7446 3 ปีที่แล้ว

      @Justice Sutton you just hacked your friend? Wow!! Who needs enemies.

  • @swathivinod
    @swathivinod 6 ปีที่แล้ว

    Very informative. Thank you for posting this video.

  • @WhiteysWickedWorkshop
    @WhiteysWickedWorkshop 7 ปีที่แล้ว

    Awesome video. Thanks for taking the time to show the world your knowledge. Its truly appreciated.

    • @kristophersean2747
      @kristophersean2747 2 ปีที่แล้ว

      you probably dont care at all but does someone know of a tool to get back into an instagram account..?
      I somehow lost my login password. I appreciate any assistance you can offer me!

    • @ishaancurtis620
      @ishaancurtis620 2 ปีที่แล้ว

      @Kristopher Sean instablaster =)

  • @MsSebaastian
    @MsSebaastian 7 ปีที่แล้ว +2

    thanks for the great tutorial your awesome man

  • @firazpeerjade
    @firazpeerjade 7 ปีที่แล้ว +1

    Ty..soo mush for sharing this tutorial.

  • @VINSMOKExOSKI
    @VINSMOKExOSKI ปีที่แล้ว

    Great video as always!

  • @mountainfanatic
    @mountainfanatic 8 ปีที่แล้ว +1

    Please make a LCD display (20x4) for MQTT topics and also an OLED display for MQTT topics, those two project would be really needed and appreciated.

  • @Hasanjanac
    @Hasanjanac 7 ปีที่แล้ว +1

    great work.thanks....

  • @hagensiekerj
    @hagensiekerj 7 ปีที่แล้ว

    How would you make it control a 2nd relay? My intention is to make a 2 plug outlet box. Great tutorial! I did it and it works perfectly.

  • @CARLOSINTERSIOASOCIA
    @CARLOSINTERSIOASOCIA 7 ปีที่แล้ว

    Great videoo, thank yoou soo muuch, was exactly what i needed

  • @MountainNZ
    @MountainNZ 8 ปีที่แล้ว

    Great resource, hard to find something that will do this.

  • @timjackson6467
    @timjackson6467 7 ปีที่แล้ว

    Great vid thanks learned much - sadly cloud esp8266 sketch will not compile?

  • @djjjozsi
    @djjjozsi 3 ปีที่แล้ว

    hello! after watchin n+1 WIFI solution, this helped me a lot to understand the internet controlling thing. thank you!

  • @bigsscore8378
    @bigsscore8378 4 ปีที่แล้ว

    Thank you , very good .

  • @victorramos6393
    @victorramos6393 5 ปีที่แล้ว

    dude you are amazing, it worked very well

  • @davidharper4289
    @davidharper4289 7 ปีที่แล้ว

    Very cool.....................you have given me another headache LOL........thank you for sharing

  • @dericc8611
    @dericc8611 8 ปีที่แล้ว +1

    Love it! Thanks for the video! :)

  • @kingsukmajumder9970
    @kingsukmajumder9970 7 ปีที่แล้ว

    Hi, Can you please discuss about the aREST library that you have written? I know the concepts would be a bit advance for most of the people but that would really help and understand it better for web and mobile application developer like me. Would wait for your next video. Thank You.

  • @Pencilart435
    @Pencilart435 4 ปีที่แล้ว

    Thanks for the video, but please tell what if we have more appliances to connect?

  • @brasiloikos
    @brasiloikos 8 ปีที่แล้ว

    thanks!!

  • @sushilshrestha5903
    @sushilshrestha5903 6 ปีที่แล้ว

    really interesting projects and i want to know that how the device is connected and communicating through different wifi or interner???

  • @udith-pz4tv
    @udith-pz4tv 8 ปีที่แล้ว

    best,,,,,,,,Thanks

  • @bh-db2rp
    @bh-db2rp 6 ปีที่แล้ว +1

    Hi, this is very interesting, and I was able to build something similar; my main question is about the power. If we want to put this installation somewhere we need to get power for the ESP and power for the relay, or for the device driven by the relay. how can we set up something with power for both ? thanks

    • @openhomeautomation
      @openhomeautomation  6 ปีที่แล้ว

      For the ESP you'll need some external USB power adapter that you can plug to the mains electricity

  • @Labtronicchile
    @Labtronicchile 7 ปีที่แล้ว

    thank you so much! for this video!!
    what purpose have the number five , is a delay by 5 seconds ?

    • @SteinErikDahle
      @SteinErikDahle 7 ปีที่แล้ว +1

      Victor morales delgado, no. "5" refers to pin no 5.

    • @Labtronicchile
      @Labtronicchile 7 ปีที่แล้ว

      Stein-Erik Dahle thank you :)

  • @grantforest1553
    @grantforest1553 7 ปีที่แล้ว

    Great video so when ahead and built it. Everything works OK. But when I reset the ESP (switch off then on again) I am unable to switch the relay. Is there a way of automatically reconnecting to aRest? so that I do not have to manually get into the aRest dashboard each time I power off.

  • @brock335
    @brock335 7 ปีที่แล้ว

    super! i want to send sensor data wirelessly to esp8266 and trigger relay when a sensor value condition is true.. is it possible??

  • @FrankP83
    @FrankP83 7 ปีที่แล้ว

    is possible to send on/off using a dashbutton from amazon!?

  • @gibo588
    @gibo588 7 ปีที่แล้ว

    Hey guy do you have to set any port to open on your router for this?

  • @SoumilShah
    @SoumilShah 8 ปีที่แล้ว

    HELLO SIR i have a doubt what about the device id it has be user defined i mean we have to enter manually ? any id ? or what is it ?

    • @openhomeautomation
      @openhomeautomation  8 ปีที่แล้ว

      +Soumil Shah Hey! It means you can enter anything you wish, it's just a way of identifying your device on the network :)

  • @jatinkathuria6102
    @jatinkathuria6102 8 ปีที่แล้ว +1

    I am working on the same project as of yours but i wanted to know how to connect various esp 8266 to each other in master slaves? (1:N) configuration?

    • @openhomeautomation
      @openhomeautomation  8 ปีที่แล้ว

      +Jatin Kathuria Check my blog for more projects with the ESP8266 :)

  • @vasil-yt
    @vasil-yt 5 ปีที่แล้ว +1

    Hey I really need help with an issue i have.
    *So here is the problem.*
    The sketches (doesn't matter which) I upload will go uploading till a 100%.
    After this the sketch does NOT do anything at all.
    I tried an empty sketch with just Serial.PrintIn("Working!") in the loop command, but no response.
    I get no errors while uploading, it just goes to a 100% and says done uploading.
    *My setup*
    Adruino IDE
    NodeMCU ESP8266-12E
    All settings checked multiple times and changed but that did not solve the problem.
    While uploading the light flashes till its done.
    I hope ANYONE knows what this is or does. I got mine from China and i'll probably have to ask to get my money back.

  • @diegorgzm
    @diegorgzm 5 ปีที่แล้ว

    Thanks for the video! Could you tell me if it's possible to control an ESP8266 in the air? (whitout router or real WiFi), I mean the ESP8266 can 'create' a network WiFi and also recieve and send data?

  • @jean-francoiscartier658
    @jean-francoiscartier658 8 ปีที่แล้ว

    Merci :) !

  • @TheRealBobHickman
    @TheRealBobHickman 7 ปีที่แล้ว

    Nice video. Does the relay board have a diode for reverse EMF protection? If not, it could potentially damage the ESP8266 when the relay is turned off.

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      The one I use does indeed have a protection via a diode.

    • @TheRealBobHickman
      @TheRealBobHickman 7 ปีที่แล้ว

      Good to know. not obvious from the video.

  • @hector2g299
    @hector2g299 4 ปีที่แล้ว

    Hello, how can i do to get its own wifi signal from de esp3266 ó 8266 ? since gonna install it in my car to start it via cellphone?

  • @Weglobaltech
    @Weglobaltech 8 ปีที่แล้ว

    Nice video ! Can you make a video or send info on how to create my own dashboard on my own server ?
    Thanks

    • @openhomeautomation
      @openhomeautomation  8 ปีที่แล้ว

      Thanks! Indeed, that's something that would be interesting :)

  • @sandychatterjee7457
    @sandychatterjee7457 7 ปีที่แล้ว

    I am using a nodemcu board but since the power output is 3.3v it just power up the relay and also cant turn on the relay what is the solution ?

  • @bernaduslokaputra
    @bernaduslokaputra 6 ปีที่แล้ว

    Hi there, thanks for your tutorial. But, I want to ask you. What is different your device with nodemcu? I tried your tutorial with nodemcu but doesn't work

    • @sr05051986
      @sr05051986 4 ปีที่แล้ว

      bernadus lokaputra same for me

    • @samot56498
      @samot56498 4 ปีที่แล้ว

      @@sr05051986 Hey, maybe you find solution?? For controling relay with NODE MCU?

  • @swapneelsukhdani6746
    @swapneelsukhdani6746 5 ปีที่แล้ว +1

    @ Can you show this video with app control.. control home devices anywhere in world using app

  • @lpfigue
    @lpfigue 4 ปีที่แล้ว

    Hi, does it use a secure connection?

  • @yasaswinikovela3367
    @yasaswinikovela3367 5 ปีที่แล้ว

    can u explain the same using thingspeak.

  • @clientesym
    @clientesym 7 ปีที่แล้ว

    newbie here, parts list and url? btw can I use esp8266 board to control different relays wirelessly?

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      Check the corresponding article on our website :)

  • @fasihzafar7423
    @fasihzafar7423 7 ปีที่แล้ว

    can you explain how to operate the 5v relay over nodemcu.(without logic level converter or npn trasistor)
    Because nodemcu gpio output is 3.3volt

  • @ridwan1472
    @ridwan1472 7 ปีที่แล้ว

    can you help?. its saying (Invalid library found in C:\Users)

  • @Kenneth548
    @Kenneth548 3 ปีที่แล้ว

    Thanks for your tutorial on project ESP8266 control relay from anywhere. I found problem in uploading code as the message say " 'class a Rest' has no member named 'get topic'. Please can you help ?

    • @openhomeautomation
      @openhomeautomation  3 ปีที่แล้ว

      Hi, make sure to update all the libraries to their latest versions we did a lot of changes recently

  • @liminni9633
    @liminni9633 7 ปีที่แล้ว

    many thanks it works, but i click off LED on, ?

  • @MrBobWareham
    @MrBobWareham 5 ปีที่แล้ว

    Thanks for the video I have joined your channel in the hope that I see a project similar to the one I want to do that is 8266 door sensor with an indicator on my phone so when I am in the workshop I know when the post arrives, any suggestions?

    • @openhomeautomation
      @openhomeautomation  5 ปีที่แล้ว +1

      Hi Bob, thanks! I recommend checking our website for more projects: openhomeautomation.net/

    • @MrBobWareham
      @MrBobWareham 3 ปีที่แล้ว

      @@openhomeautomation I tried your link above but just get an error not able to connect Thanks, Bob

  • @nicotinte5832
    @nicotinte5832 7 ปีที่แล้ว

    will it work with a ceiling light that need 220v to work? thanks!

    • @davidpodeszwa7010
      @davidpodeszwa7010 7 ปีที่แล้ว

      If you get some relay able to switch this high voltage you could prooably control your light

  • @nadaalabdulelah8006
    @nadaalabdulelah8006 6 ปีที่แล้ว

    from where do we get the device id ??

  • @amrutamagdum228
    @amrutamagdum228 7 ปีที่แล้ว

    hi we tried the same project our WiFi get connected but there problem like connection to mqtt failed try after 2 min can suggest me plz what go wrong ?

  • @rc4625
    @rc4625 7 ปีที่แล้ว

    Is there a way of setting this up like that but controlling the relay from a python script on a raspberry pi instead of a webpage?

  • @volpeta
    @volpeta 7 ปีที่แล้ว

    I am using Esp8266-12e when debugging I am geting : exit status 1 Error compiling for board NodeMcu 1.0 esp-12E Module
    Vive la France

  • @PrcuisaDExsa
    @PrcuisaDExsa 7 ปีที่แล้ว

    what if the relay two or more? thanks before

  • @ilyassayoujil4105
    @ilyassayoujil4105 ปีที่แล้ว

    Thanks for tNice tutorials amazin tutorial! Such a helpful one

  • @johnverbendoy
    @johnverbendoy 7 ปีที่แล้ว

    Where i can find the device i.d? please reply asap :D thank you

  • @GentleStrangerOhOh
    @GentleStrangerOhOh 4 ปีที่แล้ว +6

    Thanks for this tuto! However the dahsboard.aRest.io user interface has changed and one cannot define the device ID, since it is an empty pick list!! That do not allow to enter any text with the actual device ID!!! No device ID no system working!!

  • @rafaelrangelszillat3802
    @rafaelrangelszillat3802 7 ปีที่แล้ว

    Hi, congratulations for this video, but i have some questions.
    I tried to conect with my ESP8266-12E, uploading direct from my PC the code in the microcontroler. But it dosen't work.
    When I upload the code and press rst comes this error in monitor serial comes this error:
    häüȤlìÉã¤$0xølb8ÉüÿŠH�lèˆhl$�y2xÍú................................................. (the points dosn't stop coming)
    and nothing more. This result that i can't conect in aREST.
    Did you know what i should do to fix it?
    thanks for your attention

    • @hamzakhalid2957
      @hamzakhalid2957 7 ปีที่แล้ว

      Rafael Rangel Szillat change your esp module it may b an error

  • @asheshsinha6684
    @asheshsinha6684 8 ปีที่แล้ว

    can i use Adafruit Feather HUZZAH with ESP8266 WiFi instead>?

  • @benjaminwright4612
    @benjaminwright4612 7 ปีที่แล้ว

    could you do this with multiple relays and control which one turns on or turns on a sensor also if you were to do this how would you receive the data that the sensors collect via wifi or Bluetoothh

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      Sure, that will work fine for multiple relays, and you could also use the same project to collect data from sensors

    • @benjaminwright4612
      @benjaminwright4612 7 ปีที่แล้ว

      thank you so much for answering my question i halve had a hard time find a way to make a resonably cheap home autamation systom a milion thank yous

  • @mdkamruzzamanrussel612
    @mdkamruzzamanrussel612 7 ปีที่แล้ว

    My relay is working properly.

  • @vikitapes1170
    @vikitapes1170 7 ปีที่แล้ว

    The maximum digital output from a ESP module is just 3.2 volt and 30 mA and how does it turn ON a Relay of Coil Voltage of 5V ?
    any technical answer for this ?

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      Works just fine on this relay at least :)

    • @vikitapes1170
      @vikitapes1170 7 ปีที่แล้ว

      Okay but there must be a Technical explanation for this .
      are you sure there was no transistor in the Relay Module your were using ?

    • @SteinErikDahle
      @SteinErikDahle 7 ปีที่แล้ว

      Raja Vigneshwaran, most relay-modules controls the relay via an optocoupler to separate it from any dangerous voltages.

  • @gregormocnik5665
    @gregormocnik5665 7 ปีที่แล้ว

    Which relay exactly are you using? Is it 5V relay?

  • @RameshwarTalwar
    @RameshwarTalwar 5 ปีที่แล้ว

    How to control 18 relays which are at different locations..

  • @dipeshpatidar2473
    @dipeshpatidar2473 6 ปีที่แล้ว

    from where we will get device id?? or is it on us to select id??

  • @ehsanaz1928
    @ehsanaz1928 6 ปีที่แล้ว

    why show this massage {"message":"Requested device not found"} and my unique_id : "r56f89i"
    what is API key in account ?
    My module is esp 8266-01
    ُSome one can help me??

  • @mcgamingproyt
    @mcgamingproyt 7 ปีที่แล้ว

    Is there a way to control this with siri via homekit, but without the use of a homekit server in between ?

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      That'd be difficult in my opinion, but with a server running on a RPi in the middle that should be no problem !

    • @mcgamingproyt
      @mcgamingproyt 7 ปีที่แล้ว

      can a RPi Zero be used or any other cheaper Pi alternative ?

    • @davidpodeszwa7010
      @davidpodeszwa7010 7 ปีที่แล้ว

      I think you could run Tcp server on ESP, connect to it and control it with some own made protocols

    • @mcgamingproyt
      @mcgamingproyt 7 ปีที่แล้ว

      oh ok, I have ordered a Pi Zero to be sure

  • @ParrudoRicardo
    @ParrudoRicardo 7 ปีที่แล้ว

    i followed every step and the program uploads but when i it the reset and monitor the status only crazy symbols appear in the screen and they go on forever tried many times over and always with the same result :/

    • @SteinErikDahle
      @SteinErikDahle 7 ปีที่แล้ว +1

      Ricardo Vieira, try changing the bps-rate (bits pr second or Baud). It'll mostly likely be 115200 bps, but sometimes other bps-rates are used.

    • @ParrudoRicardo
      @ParrudoRicardo 7 ปีที่แล้ว

      Stein-Erik Dahle thank you I will try that

  • @csabi72
    @csabi72 7 ปีที่แล้ว

    once you pulled up the software i got lost LOL

  • @ravichudgar
    @ravichudgar 7 ปีที่แล้ว

    while compiling its show error that "exit status 1
    Error compiling for board Generic ESP8266 Module." please send me solution

  • @igrewold
    @igrewold 7 ปีที่แล้ว

    By the way, there are 3V relays.
    www.fasttech.com/products/0/10024423/5288402-huike-hk4100f-dc-3v-shg-3v-6-pin-power-relay

  • @ANTHONYBOOTH
    @ANTHONYBOOTH 5 ปีที่แล้ว

    I have a NodeMcu Development Board ESP8266 12E Internet WIFI CH340 v3 USB ESP12 ESP-12 UK on order....

    • @samot56498
      @samot56498 4 ปีที่แล้ว +1

      You can control relay with ESP8266 12E, like in this video above?

    • @ANTHONYBOOTH
      @ANTHONYBOOTH 4 ปีที่แล้ว

      @@samot56498 SURE!!! ...I went on to connect it to my IFTTT and Google home assistant...

    • @samot56498
      @samot56498 4 ปีที่แล้ว

      @@ANTHONYBOOTH Thank you very much for your answer. :D :D

  • @samudralankaiahjampani4825
    @samudralankaiahjampani4825 6 ปีที่แล้ว

    source code for 4 switches (i.e 4 relay operating)

  • @bipinpanchal5630
    @bipinpanchal5630 7 ปีที่แล้ว

    Dear Sir
    how to get device id
    please sugess.

  • @mdkamruzzamanrussel612
    @mdkamruzzamanrussel612 7 ปีที่แล้ว

    After few days arest dashboard will not be worked properly

  • @wizofcodes9300
    @wizofcodes9300 8 ปีที่แล้ว

    I used some of your libraries,I was able to control the relay from anywhere over the internet.Here is the problem for me,the device is responding in JSON format.What am I suppose to do to create my own dashboard dashboard without using dashboard.arest.io

  • @mdkamruzzamanrussel612
    @mdkamruzzamanrussel612 7 ปีที่แล้ว

    I can help every body.

  • @R2053
    @R2053 7 ปีที่แล้ว

    is it also possible to use password with the device id?

    • @openhomeautomation
      @openhomeautomation  7 ปีที่แล้ว

      It is possible using aREST Pro :) Check the videos on th-cam.com/channels/TZOzcRUkEJNRQF-Vh9C7rw.html

  • @vacoff2717
    @vacoff2717 6 ปีที่แล้ว

    but what about safety someone can hack your wifi to control your things

  • @tropicaljantie
    @tropicaljantie 7 ปีที่แล้ว

    zse lamf is on zanx zu tis fproject :)

  • @julita1880
    @julita1880 6 ปีที่แล้ว

    help Arduino: 1.8.4 (Windows 10), Board:"Adafruit Circuit Playground"
    In file included from C:\Users\teren\Desktop\sketch_sep17b\sketch_sep17b.ino:1:0:
    C:\Users\teren\Documents\Arduino\libraries\ESP8266SSDP/ESP8266SSDP.h:33:25: fatal error: ESP8266WiFi.h: No such file or directory
    #include
    ^
    compilation terminated.
    exit status 1
    Fout bij het compileren voor board Adafruit Circuit Playground
    Dit rapport zou meer informatie bevatten met
    "Uitgebreide uitvoer weergeven tijden compilatie"
    optie aan in Bestand -> Voorkeuren. open home automation

    • @F_N9901
      @F_N9901 6 ปีที่แล้ว +1

      Julita Doorewaard you have to include the esp library

  • @prabhatchaudhary9885
    @prabhatchaudhary9885 7 ปีที่แล้ว

    sir this code which u have used in the video.... is it available in the example ??? if yess can u please share the steps to open this example??? sir please reply as fast as possible.............

  • @phonenew789
    @phonenew789 7 ปีที่แล้ว

    connect133t

  • @sayerman
    @sayerman 7 ปีที่แล้ว

    Can't understand you

  • @felinetech9215
    @felinetech9215 7 ปีที่แล้ว

    plz help where can I get the libraries for Arduino
    plz provide a link

  • @mdkamruzzamanrussel612
    @mdkamruzzamanrussel612 7 ปีที่แล้ว

    When I connect to my wifi then I get some time, so I drink a cup of tee

  • @urban8644
    @urban8644 5 ปีที่แล้ว

    Parle français

  • @maxwellmoojw8544
    @maxwellmoojw8544 7 ปีที่แล้ว +1

    great work.thanks....

  • @shadenneiroukh5069
    @shadenneiroukh5069 7 ปีที่แล้ว

    how can i get device ID?