Control lights remotely | IoT Switch using Arduino Cloud and ESP8266 - Home Automation

Sdílet
Vložit
  • čas přidán 29. 07. 2024
  • Using Arduino IoT Cloud and NodeMCU ESP8266, we will build a wireless and WiFi-enabled switch to control your lights or appliances remotely wherever you are
    -------
    Funky (Sting) by Twin Musicom is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
    Artist: www.twinmusicom.org/
    ――――
    Disco Sting by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
    Source: incompetech.com/music/royalty-...
    Artist: incompetech.com/
    ――――
    Chucky the Construction Worker - Stings by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
    Source: incompetech.com/music/royalty-...
    Artist: incompetech.com/
    ――――
    Country Cue 1 by Audionautix is licensed under a Creative Commons Attribution 4.0 license. creativecommons.org/licenses/...
    Artist: audionautix.com/

Komentáře • 14

  • @rochesterpenaranda9268
    @rochesterpenaranda9268 Před 2 lety +2

    There is no link for the code in the description. can you send it to me pls?

  • @loupejr.fuentes7815
    @loupejr.fuentes7815 Před 2 lety +1

    More vids po. More power❤️

  • @m37ma6
    @m37ma6 Před 2 lety

    The link is an advertisement for music, please upload it again, thank you

  • @Ozone.23
    @Ozone.23 Před 2 lety +2

    hello video creater can you sent the code that you says you will provide in the discription please thankyou

  • @marylorenlorico6354
    @marylorenlorico6354 Před rokem

    It Can works without Arduino Ide

  • @arijitmondal118
    @arijitmondal118 Před rokem

    give the code you pasted

  • @Ahmedbedeir-zd9he
    @Ahmedbedeir-zd9he Před rokem

    where the code?

  • @shreyashkale1791
    @shreyashkale1791 Před rokem +1

    /*
    Sketch generated by the Arduino IoT Cloud Thing "Untitled 2"
    create.arduino.cc/cloud/things/ceeec7a4-b3ce-484a-a5b3-e58ed768d3fa
    Arduino IoT Cloud Variables description
    The following variables are automatically generated and updated when changes are made to the Thing
    CloudSwitch _switch_;
    Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
    which are called when their values are changed from the Dashboard.
    These functions are generated with the Thing and added at the end of this sketch.
    */
    #include "thingProperties.h"
    #define RelayPin1 0 //D3
    #define wifiLed 16
    int toggleState_1 = 0;
    void setup() {
    // Initialize serial and wait for port to open:
    Serial.begin(9600);
    // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
    delay(1500);
    // Defined in thingProperties.h
    initProperties();
    // Connect to Arduino IoT Cloud
    ArduinoCloud.begin(ArduinoIoTPreferredConnection);

    /*
    The following function allows you to obtain more information
    related to the state of network and IoT Cloud connection and errors
    the higher number the more granular information you’ll get.
    The default is 0 (only errors).
    Maximum is 4
    */
    setDebugMessageLevel(2);
    ArduinoCloud.printDebugInfo();
    pinMode(RelayPin1, OUTPUT);
    pinMode(wifiLed, OUTPUT);

    digitalWrite(RelayPin1, HIGH);

    }
    void loop()
    {
    ArduinoCloud.update();
    // Your code here
    if (WiFi.status() !=WL_CONNECTED)
    {
    digitalWrite(wifiLed, HIGH);

    }
    else{
    digitalWrite(wifiLed, LOW);
    }
    }
    /*
    Since Switch is READ_WRITE variable, onSwitchChange() is
    executed every time a new value is received from IoT Cloud.
    */
    void onSwitchChange() {
    // Add your code here to act upon Switch change
    if (_switch_ == 1)
    {
    digitalWrite(RelayPin1, LOW);
    Serial.println("Device ON")
    toggleState_1 = 1;
    }
    else
    {
    digitalWrite(RelayPin1, HIGH);
    Serial.print("Device OFF");
    toggleState_1 = 0;
    }


    }

    • @vikramgavade1805
      @vikramgavade1805 Před rokem

      Heyy I Wana Do this project so I Need some help of you how cam I contact with you

    • @shreyashkale1791
      @shreyashkale1791 Před rokem

      kale_shreyash_ contact me here

    • @asasrandom
      @asasrandom Před rokem

      the code is working but when i turned off the switch it clicks but when i turn it on again it doesnt work. i need to touch the relay module before it turned on again hehe. Please help whats the problem.

    • @shreyashkale1791
      @shreyashkale1791 Před rokem

      @@asasrandom see the connections.

  • @imstubby6844
    @imstubby6844 Před rokem

    get rid of the 'music'