ESP8266 WiFi relay control

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2017
  • ESP8266 WiFi Relay Control
    In this video we set up an ESP8266 as a web server to control a relay. With this setup you can control almost anything: lights, motors, fans, heaters, etc from anywhere in the world.
    WeMos® D1 R2 WiFi ESP8266 Development Board -- goo.gl/5U7LMy
    You can get the code here: pastebin.com/mjW9CZpr
    ~-~~-~~~-~~-~
    Please watch: "Diodes: The basic building block of all digital circuits"
    • Diodes: The basic buil...
    ~-~~-~~~-~~-~
  • บันเทิง

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

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

    So cool, just got my 8266 boards in from Banggood. Thanks for very clear instructions.

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

    Love the "HTML mambo jumbo"! Made my evening! :))

  • @rickbrown945
    @rickbrown945 6 ปีที่แล้ว +2

    great job with this information! i've sat through a lot of tutorials lately and this one is one of the few keepers!
    i'm looking forward to trying this out soon! THANKS

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

    Thank you so much! This is the missing link I was looking for. I’m planning to create a door lock with (motorized) metal bars, but wanted a simple way to control it via Internet.

  • @MauroAnderlini
    @MauroAnderlini 6 ปีที่แล้ว +7

    thanks for this very clear tutorial that made me clear into several things!

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

    Thanks so much for the great tutorial! I was wondering how to go about doing this exact same thing, but uploading that http code to a subdomain on my personal website in order to control the relay from anywhere.

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

    Checking out your channel for the first time.. Really cool! Thanks for sharing all your hard but cool work!

  • @goodwill7643
    @goodwill7643 5 ปีที่แล้ว +3

    some internet browsers are checking URL links for updates, what can cause random switching. So you need to keep it in mind by using GET method in URL. And you need to check for WiFi connection if got lost and you need to reconnect. I had similar issues some time ago for standby application.

  • @borayurt66
    @borayurt66 4 ปีที่แล้ว +2

    I like the way you explain things to dummies like me! Subscribed!

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

    Ja, super helpful! Thanks so much. I felt pretty confused when first getting this guy but am now stoked.

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

    Loved the video you explained it in a very easy way to follow but was hoping you were going to show an easier way than that as I just want two Wemos d1 mini boards with a switch on the first one on-off, and the 2nd one with a light so when the switch on the first one is turned on the light on the second one comes on. any suggestions would be good thanks!!

  • @dewaldolivier3216
    @dewaldolivier3216 2 ปีที่แล้ว +1

    Amazing tutorial, thank you for the detailed video!

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

    Nice video, I did similar with NodeMCU controlling external lights from my phone remotely, works a treat, Very nice project, next wil be camera, n PIR detection, . Cheers

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

    Great video thanks so much for showing an example I had one of these with no idea how to control it

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

    Thanks for the code! With a little html programming that could make a neat setup. You could turn on/off a device from anywhere on your network or beyond. Thanks for the video can't wait for tomorrows adventure. Oh I didn't have time last night but will give it a go.

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

      I guess Im asking randomly but does anybody know of a trick to get back into an instagram account?
      I was dumb lost my login password. I would love any assistance you can offer me

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

      @Kobe Asher instablaster ;)

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

      @Leo Louie Thanks so much for your reply. I got to the site through google and Im waiting for the hacking stuff atm.
      Takes a while so I will get back to you later when my account password hopefully is recovered.

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

      @Leo Louie It worked and I actually got access to my account again. Im so happy:D
      Thank you so much, you really help me out !

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

      @Kobe Asher No problem =)

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

    Thanks, everything worked!

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

    Hi, Thanks for the video. a question : output of esp8266 signal is 3v? & how did you manage to control 5v relay input signal?

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

    Thanks for the code i will have to try it out!

  • @kawaiimetal6906
    @kawaiimetal6906 4 ปีที่แล้ว +2

    it worked perfectly here.. thanks from Brazil

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

      Are you using the WeMos D1 R2 as well?

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

    Dear thank you for your videos. I have a question of how can we connect from outside of the network , maybe by mobile network or etc.

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

    Nice and informative video.
    Question - i connected wemos with relay and AC power accessories. i'm able to control but because of no power-backup or whatever reason if there's couple power fluctuations, it wipes out the config from the esp8266.
    Any ideas, how to avoid it ?

  • @Ali-yj9di
    @Ali-yj9di 3 ปีที่แล้ว +1

    Thank you so much, its working fantastic

  • @user-mc4xv9jg8d
    @user-mc4xv9jg8d 4 ปีที่แล้ว

    You are a good teacher. nice video. thank you so much.

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

    great video. I plan to use the ios Blynk app to run some domestic projects. I saw the relay on eBay but they don't come with the black pc breakout board you have on your video. where can I find the relay attachment base? thanks once again for the great tutorials!

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

    this was a good tutorial
    thank you

  • @2KD2Gaming
    @2KD2Gaming 5 ปีที่แล้ว

    Thanks, Good one man!

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

    thanks.. good job brother..

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

    If you don’t know already, I’m not going to tell you - good idea!

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

    Thanks for your tutorial, you helped me so lot! I'm brazilian and you helped me to choose this device for learn more about arduino with wifi works. Great tutorial! Thank you for yout time.
    Sorry for poor english.

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

      +Yuri Alexsander Your English is just fine. Thank you for your kind words.

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

    it is also ideal to set these up with static IP addresses as well so the devices retain their addresses and you know who is who. Anyways here is a modified sketch that supports multiple relays and has a nicer webpage
    #include
    const char* ssid = "yourssid";
    const char* password = "yourwifipass";
    WiFiServer server(80);
    String header;
    String output4State = "Off";
    String output5State = "Off";
    String output12State = "Off";
    String output13State = "Off";
    String output14State = "Off";
    const int output4 = 4;
    const int output5 = 5;
    const int output12 = 12;
    const int output13 = 13;
    const int output14 = 14;
    unsigned long currentTime = millis();
    unsigned long previousTime = 0;
    const long timeoutTime = 2000;
    IPAddress local_IP(0.0.0.0);
    IPAddress gateway(0.0.0.0);
    IPAddress subnet(0.0.0.0);
    IPAddress primaryDNS(0.0.0.0);
    IPAddress secondaryDNS(0.0.0.0);
    void setup() {
    Serial.begin(115200);
    pinMode(output4, OUTPUT);
    pinMode(output5, OUTPUT);
    pinMode(output12, OUTPUT);
    pinMode(output13, OUTPUT);
    pinMode(output14, OUTPUT);
    digitalWrite(output4, LOW);
    digitalWrite(output5, LOW);
    digitalWrite(output12, LOW);
    digitalWrite(output13, LOW);
    digitalWrite(output14, LOW);

    if (!WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)) {
    Serial.println("STA Failed to configure");
    }
    Serial.print("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected.");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
    server.begin();
    }
    void loop(){
    WiFiClient client = server.available();
    if (client) {
    Serial.println("New Client.");
    String currentLine = "";
    currentTime = millis();
    previousTime = currentTime;
    while (client.connected() && currentTime - previousTime = 0) {
    Serial.println("GPIO 4 On");
    output4State = "On";
    digitalWrite(output4, HIGH);
    } else if (header.indexOf("GET /4/Off") >= 0) {
    Serial.println("GPIO 4 Off");
    output4State = "Off";
    digitalWrite(output4, LOW);
    }
    else if (header.indexOf("GET /5/On") >= 0) {
    Serial.println("GPIO 5 On");
    output5State = "On";
    digitalWrite(output5, HIGH);
    } else if (header.indexOf("GET /5/Off") >= 0) {
    Serial.println("GPIO 5 Off");
    output5State = "Off";
    digitalWrite(output5, LOW);
    }
    else if (header.indexOf("GET /12/On") >= 0) {
    Serial.println("GPIO 12 On");
    output12State = "On";
    digitalWrite(output12, HIGH);
    } else if (header.indexOf("GET /12/Off") >= 0) {
    Serial.println("GPIO 12 Off");
    output12State = "Off";
    digitalWrite(output12, LOW);
    }
    else if (header.indexOf("GET /13/On") >= 0) {
    Serial.println("GPIO 13 On");
    output13State = "On";
    digitalWrite(output13, HIGH);
    } else if (header.indexOf("GET /13/Off") >= 0) {
    Serial.println("GPIO 13 Off");
    output13State = "Off";
    digitalWrite(output13, LOW);
    }
    else if (header.indexOf("GET /14/On") >= 0) {
    Serial.println("GPIO 14 On");
    output14State = "On";
    digitalWrite(output14, HIGH);
    } else if (header.indexOf("GET /14/Off") >= 0) {
    Serial.println("GPIO 14 Off");
    output14State = "Off";
    digitalWrite(output14, LOW);
    }

    client.println("");
    client.println("");
    client.println("");
    client.println("html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}");
    client.println(".button { background-color: #195B6A; border: none; color: white; padding: 16px 40px;");
    client.println("text-decoration: none; font-size: 30px; margin: 2px; cursor: pointer;}");
    client.println(".button2 {background-color: #77878A;}");
    client.println("Control Interface");
    client.println("Relay 01 is: " + output4State + "");
    if (output4State=="Off") {
    client.println("Turn On");
    } else {
    client.println("Turn Off");
    }

    client.println("Relay 02 is: " + output5State + "");
    if (output5State=="Off") {
    client.println("Turn On");
    } else {
    client.println("Turn Off");
    }

    client.println("Relay 03 is: " + output12State + "");
    if (output12State=="Off") {
    client.println("Turn On");
    } else {
    client.println("Turn Off");
    }

    client.println("Relay 04 is: " + output13State + "");
    if (output13State=="Off") {
    client.println("Turn On");
    } else {
    client.println("Turn Off");
    }

    client.println("Relay 05 is: " + output14State + "");
    if (output14State=="Off") {
    client.println("Turn On");
    } else {
    client.println("Turn Off");
    }

    client.println("");
    client.println();
    break;
    } else {
    currentLine = "";
    }
    } else if (c != '
    ') {
    currentLine += c;
    }
    }
    }
    header = "";
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println("");
    }
    }

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

    Appreciate! Keep Creating Such Awesome Videos Boss!

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

    Hey, awesome and interesting tutorial, thanks. I was just given a D1 and was wondering whether you think it would be possible to create a SONOS Speaker control board using it? E.g. pause/play/volume for the SONOS. I'm relatively new to anything arduino related, and kinda alright at programming! hahah

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

      +Jamie Bridges I have never messed around with SONOS but but I would imagine you could

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

    Nice project and tutorial 👍

  • @eddie_Za
    @eddie_Za 10 หลายเดือนก่อน

    Wow, a 6years old guide n i just started learning now...😅

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

    Is it the same relay that we use for both dc and ac peripherals that we are operating, in this case the bulp

  • @jamest.5001
    @jamest.5001 4 ปีที่แล้ว

    I just realized, the diy bms uses the wemos d1 mini/ mini pro! I don't really care for WiFi, do you know if the data that goes out on WiFi, can it be sent through HDMI also? And what it would require if possible? Good day sir!

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

    good job, thank you.

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

    Thanks a lot for the description. It is great. How can I make the app for multiple channels? Thank you.

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

    Have you ever done something like turning off a relay if/when the main power goes off so that your solar power doesn't feed back into the grid?

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

    Thanks for the video, man! I was trying to wrap my head around an ESP-01, to toggle a bunch of LEDs through a webpage. This setup would be perfect. Perhaps in another video you could turn on and turn off an appliance with this just to give us an idea of how it's done?
    PS: Is port 80 the only port we must use for html or can we use any other port number?

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

      Vivek Venkat Subramaniam this video IS how you turn on and off an appliance. that's what the relay is for. appliance goes through the relay.

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

      Yes, port 80 is designated for HTTP (HyperText Transfer Protocol) which is the protocol that runs the internet. You can send HTTP traffic over other ports but you'd have to configure the device/code to run its server on a different port and you would have to make the requests from that port as well.

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

    good video.ty for sharing

  • @quoit99training83
    @quoit99training83 6 ปีที่แล้ว +2

    Exactly what I was looking for! Hey is there a tutorial on using “deep sleep” for esp8266 to conserve battery?

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

      +quoit99 training Here's my entire esp32 playlist:
      th-cam.com/play/PLGhvWnPsCr58OIrVHh21zc1w_ZRU4VqNf.html
      Check out esp32 features demo

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

    Switching coils without buffer transistor and protection diode can be dangerous. I can recommend a ULN 2003 driver. It has 7 protected buffers in one 16 pin package.

  • @coolfiretech
    @coolfiretech 4 ปีที่แล้ว +2

    Thank you sir,It is very useful to me...but a doubt, what is DIP switch sir...please reply me sir....

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

    The webserver loads fine for me, and i can click on on and off, but it doesn't switch the relay. I can manually switch it by plugging and unplugging the analog or ground pins though, do you know what is up?

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

    Thanks for another great video but I am having a problem loading the ESP8266WiFi.h library. I noticed in the comment section that someone asked that question before and the reply but try as I might I cant find that library or file.. what am I doing wrong, thanks

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

    thanks u a lot

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

    hey....buddy....this video is awsm....bt I have a question , by this relay can we operate SINGAL PHASE MOTER ...motor use for pumping water that we use in our homes.....

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

    Very nice

  • @Khish4710
    @Khish4710 4 ปีที่แล้ว +2

    i encountered 'D5' was not declared in this scope??
    i'am only a beginner
    thanks for your response

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

      Try just changing to "5". Not all boards have "D5", some just have a number so I found changing it to "5" got rid of that error.

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

    Cool project!!
    Can you access this server from outside of your local network?

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

    Thanks. It works very well, but how can we prevent the change to very small font.
    I tried with client.println(""); bus it doesn't work

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

    Back EMF? Are you sure you are using the term correctly for that diode. I think it's there to drain the relay coil quickly so the contacts don't linger in the on position when the power is cut. Back EMF refers to motors.

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

    I hope you still respond to these comments. I've been trying to get my ESP8266 to trigger my relay module. However because the relay module runs on 5v, the relay does not activate with the 3.3v signal from the ESP8266. Works just fine with an arduino but I can't get it to trigger with an esp. Can you give me any workaround for this problem?

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

      +Riyadh Marthinus different relay? Or different micro...

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

      learnelectronics so, believe it or not. Just yesterday I got this sensor kit in the mail and it had a relay module that worked just fine with the esp. I think the issue is that the relay modules that I have only detects 5v as an active high signal whereas the one I got yesterday takes 3.3v as an active high too. Its a pitty because I ordered so many of those modules but maybe I could trigger them with a transistor or something. Thanks for checking up though man!

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

    Hello from Greece! Nice, simple video as always!Can you make more videos about the ESP-8266? For example, how to toggle a pin from internet using cellular data from phone or using other, non local WiFi..? Or how to connect two ESP-8266 together?
    Looking forward to your reply!

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

      Nikos Mountakis hi! I'm happy you liked the video. there will be at least 1 esp8266 video a week.

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

    I really do not understand those people who put dislike for this video...

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

    question on which board you have selected in the IDE?? generic 8266? thanks

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

    thanks

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

    Effective and cool

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

    Hi Brother may I ask what library did you use?

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

    Good!

  • @JasonRobards2
    @JasonRobards2 4 ปีที่แล้ว +2

    When I used this code to have a wemos repeatingly respond to a client (like my C# program running on pc), the client starts throwing SocketExceptions and such. Took me a while to figure out what this all meant. Only after some searching, I found that the server (the arduino) disconnects after the first response.
    It seems that the code used here makes a new client every loop and the client needs to reconnect every time.
    Just a heads up in case somebody runs into similar programs.

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

      Did you find a solution, what is?

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

      @@anukreddi WiFiClient client = server.available(); --> this creates a new client object, disconnecting the old one, if there is one.
      I instead put it like this:
      Before setup:
      WiFiClient client;
      In loop:
      if (!client) {
      client = server.available();
      return;
      }

  • @zulfitrizulkarnainasnahzul7276
    @zulfitrizulkarnainasnahzul7276 5 หลายเดือนก่อน

    hi .. how to set up everything we need at HTTP section in our phone to access and control the board?

  • @MyChannel-he1tm
    @MyChannel-he1tm 5 ปีที่แล้ว +1

    tnx bro..i make it

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

    thanks for code all work! can you explean how to ad more channels for more relays? thanks

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

      +B.g Veenstra thanks. Check out this video I did with 3 channels
      th-cam.com/video/-9D-vtZ-wl4/w-d-xo.html

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

      thanks but it is not possible to load the code in my ESP8266 wifi shield
      do you want to make a code for me? i am a total noob with this
      email birdiebertus@hotmail.com

    • @learnelectronics
      @learnelectronics  6 ปีที่แล้ว +2

      +B.g Veenstra I could write the code for you. My rate is $50.00/hr US. Estimate 4 hours.

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

      Oké for me is it posible to pay with paypal

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

      +B.g Veenstra Yes it is, email me arduino0169@gmail.com and we can work out the details.

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

    Another neat thing you can do with these is upload a different firmware that turns these into WiFi repeaters

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

    Hello!
    I have a question...
    Do i can to connect the WEMOS D1 directly to the computer?

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

      In the beginning you do to program it. After that. No.

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

    Thanks for the video! First time with ESP8266.
    Text on phone is really small. How do I make it bigger? I know it's HTML.

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

    Thank you.

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

    Why Everytime i Connect The Wemos To Electric The Led Lamp Must Be On

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

    Hye...Can i Know what app That U Use To Control?

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

    Hi
    Does the board can execute the sketch if it s unplugged form the pc an plugged with the dc power supply?

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

      yes, it does not need to be plugged into pc

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

      Thaks, also this applies to NODE MCU?

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

      +narut99 yes it does

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

      Thanks a lot

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

    Hi, I have a question. can i power up a 5 volt 4 channel relay module with a 5 volt 0.7-0.8 mAh wall type charger, which is basically use for charge the simple mobiles.
    If yes, then how i connect, i mean what will be the circuit diagram. which wire will be connect with the vcc and which wire connect with the ground and which wire is connect with the ESP8286.
    OR,
    ESP8266 nodeMCU board 3.3volt is sufficient for 4 channel 5 volt relay?
    i am try to built a home automation project.
    Thank you very much. Please help me

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

      Well, how did it go?

  • @ManuelCastillo-kq3xy
    @ManuelCastillo-kq3xy 5 ปีที่แล้ว

    Hi, i need control 8 relay. It’s possible? How i doit this? Help me, please!!!

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

    Hi! Anything with an esp8266 for sending and receiving data and control that goes through an external cloud server?

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

      Ever tried Blynk?

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

      @@MutheloKhakhathi Didn't try. Besides, it's not free like adafruit.io

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

    how i access the ip address??? i getting error when i access the ip address "the site can't be reached"
    please help

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

    how can I found ESP8266 wifi module on proteus8 professional?

  • @S24W2
    @S24W2 8 หลายเดือนก่อน

    I have to say I did not get a lot of the code stuff, more of an explanation would have been helpful, I'm not really sure what's is going on gere, what is the server etc ? But tha k you anyway was still good video and helpful

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

    I'm on my network fine, but my router doesn't properly find the IP address of the ESP in the NAT list for the firewall. Any Ideas?

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

    I have been using this setup, but the wifi on the WeMos goes into sleep mode then you cant
    access it thru the phone, unless you hit the reset button to wake it up, any way to keep it active?

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

      dwpetty3723 you can try this:
      if (WiFi.status() == 6) { ESP.reset(); }
      it checks to see if your WiFi is disconnected (status 6) and restarts if it is.

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

      I tried the code in the loop, still does not work, this happens on my computer browser as well as my Iphone browser. so it must be the WeMos board, my other wifi devices in the house work fine, hopefully somebody will have an answer. thanks for the reply

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

      dwpetty3723 I'm sorry I couldn't help, Im a hardware guy. I muddle through programming by the seat of my pants. Find Brian Lough on TH-cam. He's an Irish TH-camr, very well versed in the 8266. He's a cool guy, send him a pm.

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

    By any chance does anyone have any code to assign a static address and not dhcp? Also can you show us how one could add a switch and have the url display status off said switch?

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

    Not much info on how the phone was set up, did you just enter the ip address in the phone browser?

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

      dwpetty3723 yes. the serial monitor will tell you address.

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

    right after the flashing the relay goes to ON
    and it is not possible to turn in off in the browser
    it's like it stays constantly on and doesnt respond to inputs

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

      it works when i connect it to the 3.3v

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

      The problem is the 5V-relais used with the 3.3V ESP-logic. If you use it as described in the tutorial, you might blow your ESP8266, if you operate the relais with 3.3V it might not switch reliably. You should either use a 3.3V-relais or a circuit adapting the 3.3V logic to 5V logic.
      The tutorial holds another problem: it is using the String class to evaluate the http requests. This will fragment the memory and crash the program after running for a longer time (can be hours, days or weeks - depending on the number of requests you send)

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

    Cool
    How can you integrate this into smart life app?

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

    how can we install the library

  • @matteopisanello7787
    @matteopisanello7787 4 หลายเดือนก่อน

    how could i obtain the wan ip address in order to control the board in remote?

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

    Hello,good video! I would like to create wifi or bluetooth controlled relay what has battery inside or needs very low woltage.Its going to be in my dirtbile which has no power lines.I would use it to start and stop it.For stopping it connect one wire to ground and for starting connects one to plus.T.jorma

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

    Hello congratulations from Belgium. Everything works I tested. How can I make the text bigger on the web page of my Android 192.168.1.XX smartphone because the text is too small. thank you

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

    When I try to verify this code, the arduino IDE gives this one error:
    Wifi_ESP8266_2:18:14: error: 'd5' was not declared in this scope
    int ledPin = d5;
    Any suggestions?

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

      instead of d5 type 14
      it will work

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

      @@krishaanthramaraj1215 It worked. You are a genius. Thank you!!

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

      Your welcome

  • @JamesSmith-hg1ei
    @JamesSmith-hg1ei 5 ปีที่แล้ว

    What library did you use for this code

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

    @learnelectronics Great video brother! Subbed!
    The HTTP section is a Response Header to a valid HTTP-GET request. When you click to power on the component, you're sending an HTTP-GET request. The response is just a formality.
    Print this out!
    www.ntu.edu.sg/home/ehchua/programming/webprogramming/HTTP_basics.html
    That will teach you everything you need to know about HTTP in 20 pages.
    Also, using the DMZ is dangerous. It sets a device outside your firewall. It's just as easy to set up Port Forwarding and it's MUCH safer. It's done in your router settings/config as well. Making a device other than your router accessible from outside the network is dangerous enough, you put a device in the DMZ and the firewall will no longer protect it.

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

    is it possible if i switch Arduino WeMos to be Arduino Uno R3 ?

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

      R3 has no WiFi

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

      @@learnelectronics even if i combine R3 with ESP8266 ??

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

      You could. But for all that work.... Why not just use 8266?

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

      Learnelectronics is waiting ... what? what do you mean "only use 8266"? ... do you mean if I use uno R3 I have to combine it with esp8266 which is basically R3 and 8266 separately (not one module) and if I use weMos I don't need to combine it with esp8266 because weMos already has esp8266 on Arduino itself?

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

    Can you add library please.

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

    The butttons on my webbrowser are not working. Can you help out, please?

  • @iztokramljak
    @iztokramljak 6 ปีที่แล้ว +2

    "HTTP mumbo jumbo" hahahah ;)

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

    Can't the switch set timer

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

    while thats cool its a bit overkill :P for my uses a simple 433 Mhz remote was enough (switching my stereo that i built from china parts). i might have to create an internet activated switch for my computer though one day. that way i could work on my computer even when im not at home

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

      you software engineers, always wanting to write a program for this, an app for that lol

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

      we need employment too :P

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

    What about an implementation of the BLYNK service as a way to control the lights or devices via Google Home, Alexa...
    Great work, keep it up

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

      I don't understand what you are asking. Do you mean to use BLYNK in place of Alexa or Google? Or use BLYNK in conjunction with them?

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

    the only missing thing is: you did not explain how to open Arduino IDE , and which board to choose. thank you so much

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

    Can someone please give a link to the ESP8266WiFi.h library i cannot find it

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

      When you install the ESP8266 boards file, the library is installed.

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

      @@learnelectronics I've search through the Boards Manager and cannot find the ESP8266 boards listing.