Alexa Smart Home Automation system using NodeMCU ESP8266 & Relay Module | IoT Projects

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • In this IoT project, I have made the Alexa Smart Home Automation system using NodeMCU ESP8266 & Relay Module. You can control lights, fans, and other home appliances with the voice command. I have used only the Amazon Alexa app to connect the Echo Dot smart speaker with the NodeMCU.
    JLCPCB Prototype for $2(Any Color): jlcpcb.com
    Download PCB Garber file for this NodeMCU project
    drive.google.c...
    Required Components for this Alexa smart home project
    1. NodeMCU or ESP32 board amzn.to/3fJA4EG
    2. Relay Module amzn.to/2BQ5Y3o
    3. Alexa Echo Dot amzn.to/2PkTOTe
    Required Components for Relay Module:
    1. Relays 5v (SPDT)
    2. BC547 Transistors
    3. LED 5mm
    4. 220-ohm Resistors
    5. Connectors
    Download Code for this Alexa Home Automation projects
    drive.google.c...
    During the video, I have shared the circuit diagram for this Alexa control home automation and also explained the code for this IoT project. This is a very simple home automation project, so you can easily make this smart home device with NodeMCU and Relay module. I have also shown how to set up the Amazon Alexa app for this smart house project. You can control up to 10 home appliances with Alexa.
    There is a limitation, the NodeMCU, and the echo dot smart speaker should be connected with the same wifi network.
    If you face any issue please let me know in the comment section.
    ------------------------------------------------------
    Thanks For Watching...
    ✅ SUBSCRIBE ✅LIKE ✅SHARE ✅ COMMENTS
    Find out more such projects: easyelectronic...
    Find us on Facebook: / techstudycell
    -------------------------------------------------------
    Other smart home IoT projects:
    Latest ESP32 projects playlist:
    • ESP32 Projects
    How to make Smart Home using Arduino Bluetooth IR & Sensors
    • How to make Smart Home...
    Home Automation using Google Assistant, Blynk, IFTTT, NodeMCU
    • Home Automation using ...
    IoT based Home Automation with sensors and NodeMCU control Relay | Real-Time Feedback
    • IoT based Home Automat...
    #Alexa
    #SmartHome
    #TechStudyCell

Комментарии • 315

  • @hellzlegendz
    @hellzlegendz 4 года назад +1

    Thank you very much, with a little code adjustment and additional wring I have mine set up with an 8-way relay and it works perfect.

    • @TechStudyCell
      @TechStudyCell  4 года назад +1

      I have already made an video on Alexa 8 Relays. Please refer this video ruclips.net/video/b5yr-H6jJAc/видео.html

  • @ArtisanPallet
    @ArtisanPallet 4 года назад +3

    Simple but useful home automation project👍👍👍

  • @KWESKOJ
    @KWESKOJ 4 года назад +2

    Thanks a lot mate. i have used several tutorials . not worked but yours . i thanks sooo much. i have subscribed at once.

  • @sreeram9220
    @sreeram9220 3 года назад +1

    Thank you for the video bro I do exactly and it work superbly when ever my nodemcu is reboot or power cut relay state is turn to normal can you do it to remember the previous relay state something like that to turn which ever device is turned on or not

  • @Oyuvi
    @Oyuvi 4 года назад

    A big big shout out to Tech StudyCell. Saw a lot of other videos but this is the one that worked.

  • @cadetahnafhasansabuz2735
    @cadetahnafhasansabuz2735 3 года назад

    Great Brother. Really you are a great teacher.

  • @partha013
    @partha013 2 года назад +1

    it is working good but I have some issues
    when ever power cuts and comes back all device turns on
    can u tell me the code to turn them default off after every restart.

  • @shamimahmed-ux4jy
    @shamimahmed-ux4jy 4 года назад +1

    Can it control with mobile alexa

  • @raajasekard1358
    @raajasekard1358 4 года назад +1

    Thanks for explanation and the code it worked for me. Initially, the devices are not discovered after restarting and trying it again it got detected. :-) :-)

  • @tonysicily2687
    @tonysicily2687 4 года назад

    This is AWESOME, THANK YOU, saved, liked & subscribed

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Thanks. You may also like our other home Automation project with Alexa. Please visit our channel.

    • @tonysicily2687
      @tonysicily2687 4 года назад

      @@TechStudyCell Already have, I am loving your channel, you really have helped me decipher this ‘black art’ programming is easy. But knowing nothing, makes learning about IoT very hard as I do not even know what to research.
      Fantastic, thank you. The NodeMCU is such a great device. Next port of call will be the Nano T-Call for long range projects.
      Unless you have a better suggestion? 🤔🤔🤞

  • @electronic7979
    @electronic7979 4 года назад +2

    Nice project.

  • @prempatel1564
    @prempatel1564 4 года назад +1

    thanks bro it worked for me

  • @anujkumar-zt3nz
    @anujkumar-zt3nz 4 года назад

    beautifully explained...... thank you study cell for making this video... hope 2 see many in future.. :)

  • @artcloudns984
    @artcloudns984 3 года назад +1

    Sir ssid new bnate hai ya hospot hota hai

  • @Justinzac100
    @Justinzac100 3 года назад

    Extremely helpful video

  • @arijitchakrabarty8760
    @arijitchakrabarty8760 Год назад

    We can control the lights with the alexa app also right??

  • @enes9602
    @enes9602 3 года назад

    Can we check with google home and google assistant?

  • @centrodoreforco-aulasderef7743

    Always usefull. Thanks!

  • @SmartSoftek_Private
    @SmartSoftek_Private 3 года назад +1

    Nice project, attractive way of explaining thank you, but I have a question, all the Alexa smart home videos with esp8266 focus on direct contact with relay, can you make a video that you change that to UART message to be received by another system (aurduino or microcontroller) that can control larger number of relays and maybe other systems also?

  • @sanu7210
    @sanu7210 4 года назад

    is this same think processible using google assistant

  • @adamusgruby4650
    @adamusgruby4650 2 года назад

    can you describe the rest of the components you saw in the project. For example, what value are the diodes and what are the resistors that are next to the connection block. The resistors that are between the LEDs do not look like 220 because their code starts with black. Can you provide more information or a wiring diagram for this device? Regards. Adam.

  • @piyushagarwal3835
    @piyushagarwal3835 3 месяца назад

    While searching aleaxa finds only one device can u tell me how to solve this issue

  • @3736june
    @3736june 4 года назад +1

    Thank you

  • @sanu7210
    @sanu7210 4 года назад +1

    after uploading your code esp is not connected with my wifi i have cheaked ssid password which i put correct but stile it is not connected with my wifi

  • @Doitcreative
    @Doitcreative 2 года назад

    Sir.. can i connect 8 or 16 channel relay ... It can possible to control.... I want to control ten motors using relay by voice commands

  • @rakeshdeb91
    @rakeshdeb91 4 года назад

    Successfully executed your processes. But one drawback is , when power cut happened, during the time of come back of power, all the bulbs are stared running even you don't want them to run. Could you please suggest any solution!???

  • @akshaydholakiya9460
    @akshaydholakiya9460 9 месяцев назад

    how many relay control and add device from alexa? issue only 10 device discovred

  • @MrSk2012
    @MrSk2012 3 месяца назад

    Hii . I made thi project in 2021 and it was working perfectly but in 2024 when m trying to pairing device with alexa, alexa is not showing device or pairing. Will you please guide me ?

  • @ELECTROMOD
    @ELECTROMOD 3 года назад

    Can we connect multiple ESP32 devices to the same account as shown in the video?

  • @adarshsutariya7987
    @adarshsutariya7987 4 года назад

    supply to relay is from nodemcu???? if yes explain how because it output is 3.3V...

  • @nouraldinbinkhadra394
    @nouraldinbinkhadra394 4 года назад

    Hello this is amazing thank you very much
    But I have a question
    If I need the lamp turn on just for 1 second thin turn of automatically what i can do
    ((I need a button not switch))

  • @pushpendra140
    @pushpendra140 3 года назад

    I have made this home automation system I am not able to find out the devices in alexa can you please help me for my issue

  • @shakerileiwat4341
    @shakerileiwat4341 4 года назад

    Great job ♥♥♥
    Should I buy Alexa Echo Dot to do this project or does it work without it (just alexa App) ??

    • @TechStudyCell
      @TechStudyCell  4 года назад +1

      Thanks. Please refer this video ruclips.net/video/Sx9akwBwK4g/видео.html
      You don't need echo dot.

  • @rakeshdeb91
    @rakeshdeb91 4 года назад

    Inbuit option for retaining the same state as before power failure should be used. My humble request to you to help me for this.

  • @disharanilmini9503
    @disharanilmini9503 3 года назад

    YOUR CORD all upload done but onther step alexa not working. what is the problem.

  • @soulfulchitransh
    @soulfulchitransh 3 года назад

    i m gettin no device found on alexa app. what to do. even i unplugged the alexa and plugged it again.

  • @sindhujalingampally6066
    @sindhujalingampally6066 3 года назад

    Is it contains 2 stages

  • @HarshGupta_27
    @HarshGupta_27 4 года назад +1

    i am having trouble connecting my lights to relay board please help

  • @paulpkae
    @paulpkae 4 года назад

    Many thanks for sharing the code. How can you change the device type to something other than Lights

    • @tonysicily2687
      @tonysicily2687 4 года назад

      Any mains powered device with work, if connected to the relay in the same way.

    • @paulpkae
      @paulpkae 4 года назад

      @@tonysicily2687 hi yes, I realise that. I was referring to the device type in the Alexa app. They are all device type "Lights". What if I want it to be type "Plug", "Switch", "TV" or "Fan" for example?

    • @tonysicily2687
      @tonysicily2687 4 года назад +1

      @@paulpkae ah ok, thanks for clarifying, hopefully some one can help you. The best of luck 👍👍

    • @AvdheshSolanki
      @AvdheshSolanki 3 года назад

      I also have the same question

  • @purushottamdey
    @purushottamdey 3 года назад

    Is it able to control from another network or internet (not same wifi network) through alexa?
    Obviously nodeMcu will be connected to a fixed alexa device or a mobile which have alexa.

  • @iamrahsal
    @iamrahsal 4 года назад

    Can we control the devices manually by the wall switches along with this?

  • @mschaffer2826
    @mschaffer2826 3 года назад +1

    Great job. How would you add a sensor/digital read to tell the status of an input?

  • @jcwire1685
    @jcwire1685 4 года назад +1

    Great video, can you tell me if I actually need a echo device to discover the nodemcu. Right now I have a fire tv cube and using the Alexa app on my iPhone and it doesn’t seem to be able to discover it

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Thanks. Yes, you need an Alexa device like echo dot.

    • @jcwire1685
      @jcwire1685 4 года назад

      @@TechStudyCell thanks for getting back to me so quick

  • @jorgebarragan6496
    @jorgebarragan6496 4 года назад +2

    Hello greetings from Mexico.
    Is it necessary to connect the components (the led or spotlight)?
    Or is it enough to load it to the nodemcu without connecting the components?
    Since I load the code, but without component, I look for the devices but my echo dot 3gn has not found them

    • @nomiahmad5268
      @nomiahmad5268 3 года назад +1

      Did u solve the problem of finding devices. Please let me know. ahmadnomi52@gmail.com

  • @GOURAB_DAS_12
    @GOURAB_DAS_12 2 года назад

    Will this code works without Alexa Smart Speaker... Actually I want the alternative of Blynk

  • @chandramohan-zi5bh
    @chandramohan-zi5bh 11 месяцев назад

    Alexa not detecting node mcu8266, no compilation error

  • @erikhoffman
    @erikhoffman 4 года назад +1

    Brilliant! I tried to add another 5 output relays but I couldn't - wonder if you can help
    I copied everything that include the setting and pasted and changed the values but couldnt
    as soon as l add after the Serial.begin(115200); it compiles but will not run
    Help would be great
    Thanks in advance
    Erik Hoffman

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Please refer the following video ruclips.net/video/OJ4CzWyRQr4/видео.html
      I have added more features and shown each steps in details. Thank you.

  • @chiranjibisahoo5408
    @chiranjibisahoo5408 3 года назад

    Hey buddy can we directly connect google home mini instead of Alexa to Aurdino library as you shown???I dont wanna use blynk app or ifftt etc..

  • @KundanRaha
    @KundanRaha Год назад

    your code is working fine. But I have one issue which is when power fails it will not retain last On state, It reset to Off.Kindly update this.

  • @rajeshkumarj9623
    @rajeshkumarj9623 3 года назад

    Hi Tech StudyCell, how to change the wake word like turn on light to open light...

  • @harshaldhatkar
    @harshaldhatkar 3 года назад

    Nodemcu program not sure
    USB not connected error please solution

  • @dipaksonone2917
    @dipaksonone2917 3 года назад

    sir can we add manual buttons to it?

  • @sanu7210
    @sanu7210 4 года назад

    Hiw you get this ok feedbacks from alexa

  • @SSATechInTelugu
    @SSATechInTelugu 4 года назад +1

    Sir.. Alexa coading made by you is very good. How can we make manual switch coading in that. Pls send me video. I want Esp8266 code board

    • @TechStudyCell
      @TechStudyCell  4 года назад +1

      I will try to cover that in upcoming videos. Thanks.

  • @RahulRoy-hj5qo
    @RahulRoy-hj5qo 4 года назад

    Is it possible to do with Mobile hotspot

  • @drakatislit
    @drakatislit 3 года назад

    i want to interface a small led without relay do i need to change the code for that?

  • @aliasgarsarodawala4045
    @aliasgarsarodawala4045 3 года назад

    I using your code for my project but cannot find the device in alexa app......i am just using the app on my phone i dont have smart speaker, but my phone and mcu board is connected with the same wifi.
    Please help

  • @vginside
    @vginside 3 года назад

    Do you need echo device or you can just use alexa app also to connect? Since i dont have echo but trying your code using app it says not device found!! (in serial debug window it shows connected to my wifi). Your reply is appreciated!

  • @abhinandanjain8280
    @abhinandanjain8280 3 года назад

    All relays turn on at boot, is there any way to solve this?

  • @GMDII
    @GMDII 4 года назад

    Great video man! thanks a lot!

  • @feedbackplus1435
    @feedbackplus1435 2 года назад

    ESP 8266 not reponding to Alexa when use local wifi router, its only work on mobile hotspot

  • @justdoingodswork
    @justdoingodswork Год назад

    is there any limit of number of devices with ESPALexa.h library?

  • @tanmaygupta6751
    @tanmaygupta6751 4 года назад +1

    Bro can you please share a code that works with alexa and Google assistant as well. I use both devices and since ifttt is no longer free my old code doesn't work anymore.

  • @edwardsantos5403
    @edwardsantos5403 4 года назад

    Is there a way to turn off the bulbs trought arduino?

  • @tushthushan5590
    @tushthushan5590 3 года назад

    Can't keep the power on and off without resetting?,😇

  • @balaramyadav1920
    @balaramyadav1920 4 года назад

    Hi Iam not able to see in alexa app any lights or discoverable in the app, NodMCU & my mobile & Alexa echo Show its in the same network

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Just restart the echo dot, then try again. Please refer this video ruclips.net/video/OJ4CzWyRQr4/видео.html

  • @aaryansarat4513
    @aaryansarat4513 3 года назад

    I need your help please help me
    My alexa is not able to find the devices but before it was able to find and again o got the same issue please help me

  • @Faltuyoutuber5412
    @Faltuyoutuber5412 4 года назад

    I made it but Alexa aap not add this module I tried many times but it app show no device find .
    bro solve my problem please

  • @Blinix2
    @Blinix2 3 года назад

    Sad thing is that this reset when a power outage occurs, anyone has solved this?
    A few solutions that I can think are:
    *use a power bank to power device, and connect that power bank to a usb charger to always have energy.
    *Use a battery module thingie to power it, same as power bank but gives more options when designing
    *I believe these devices have onboard persistent storage, but I think it has short life so making some code that has this in mid is important, something like “every hour write the last state of device”, that or storing this last state on a separate server or storage device

  • @ramanpahwa2845
    @ramanpahwa2845 3 года назад

    For integrating with Alexa, is it necessary to do coding in the firmware itself?

  • @riteshsinha5900
    @riteshsinha5900 3 года назад

    no echo dot , no sinric pro //// only esp and android with alexa app installed any possibilities ?????

  • @imtiazasghar8511
    @imtiazasghar8511 3 года назад

    Bhai tmam lights reverse operate kar rahi turn on bolny par band ho rahi ha or turn off bolny par chal rahi ha ...ye code ma problem ha ya connections ma kindly tell ma

  • @CuriousityRoom
    @CuriousityRoom 4 года назад

    Hi can you explain why only 10 devices can be connected with Alexa using this method and how to overcome this limitation.

  • @fadlan7281
    @fadlan7281 3 года назад

    how can i continues this project without ur custom pcb ?

  • @beeriotce6768
    @beeriotce6768 4 года назад

    Is it necessary to have an Alexa device or just use my phone to search for it? I don't have Alexa, but I tried the Alexa app to find it, but I couldn't find the device set according to the code.

    • @TechStudyCell
      @TechStudyCell  4 года назад

      For this project you must have an Alexa device.
      If you don't have any Alexa device then please refer to the following video
      ruclips.net/video/Sx9akwBwK4g/видео.html

  • @IOTMAN7
    @IOTMAN7 3 месяца назад

    Good Afternoon, I really hope someone sees this comment and can help. I am doing this project for a Senior Project for my graduation requirement. The code is working fine for me but when I connect the lights to Amazon Alexa it only discovers one 1 device. When I delete the device it found it finds the next one. Can someone help.

  • @crazykid71
    @crazykid71 4 года назад

    Everything I did as per your Video.but Alexa not detecting any lights. Please help me

  • @rupesh0702
    @rupesh0702 4 года назад +1

    I will try and let you know...

  • @sakeerhussain3506
    @sakeerhussain3506 4 года назад

    Can we possible with alexa app only without speaker sir?

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Yes. You have to use Sinric. No Echo dot required.
      Please refer this video ruclips.net/video/Sx9akwBwK4g/видео.html

  • @manmeetsinghKJ
    @manmeetsinghKJ 4 года назад

    bhai plz make a project of all in one, like 4 lights & fan with speed slow n fast with push button also

  • @niteshnahar4724
    @niteshnahar4724 4 года назад

    Hi, I tried this and it worked well. but can you give some information on electricity consumptions as Im planning to use it in my home for 24x7

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Power consumption is very low. Less than 1 watt

  • @alexandrumatei7389
    @alexandrumatei7389 4 года назад

    Hello.
    I want to do a smart home project that responds to voice commands using Amazon Alexa.
    The idea is that I have to give up relays and I have to use control circuits for force.
    Can you help me?

  • @Maxxhunter556
    @Maxxhunter556 Год назад

    You didn't give the all components name

  • @t.thangtran7334
    @t.thangtran7334 4 года назад

    hey bro. why i can't use esp 8266 Controlsle for this fan

  • @kumareshdhara8723
    @kumareshdhara8723 3 года назад

    Without Alexa dot
    Can we use this with alexa app

    • @TechStudyCell
      @TechStudyCell  3 года назад

      If you don't have echo dot, please refer to the following video ruclips.net/video/gpB4600keWA/видео.html

  • @lolakutony3457
    @lolakutony3457 4 года назад

    Hi i have setup all the connection and uplaod the code on the NodeMCU the last part when i faced problem when connect alexa app in the app it shows me no device found yet i dont know what is the problem please advice

    • @TechStudyCell
      @TechStudyCell  4 года назад

      This is common problem. Please check NodeMCU and echo dot conneted with same WiFi.
      If you face same issue please try 2-3 times.

    • @lolakutony3457
      @lolakutony3457 4 года назад

      @@TechStudyCell hi sir it connect but when u give command to alexa to open both bedroom light it shows on the amazon alexa app on but no the lamp it doesnt trigger the relay to open light any advice in this project i only used two channel relay n two lamp i would like to buy ur PCB send me ur number so that we can talk about the PCB

    • @TechStudyCell
      @TechStudyCell  4 года назад

      If both conneted, then you should see the device name in Alexa App. Other wise restart Alexa and add the device as shown in video

  • @phmdfly2653
    @phmdfly2653 4 года назад

    Can I use an 8 channel board with same set up for controlling 8 bulbs. What would be the changes needed

    • @TechStudyCell
      @TechStudyCell  4 года назад

      Yes. Please refer this video ruclips.net/video/b5yr-H6jJAc/видео.html

  • @antonio.chetta
    @antonio.chetta 2 года назад

    Does this work also with Echo Flex?

  • @Harshu_The_legend
    @Harshu_The_legend 4 года назад

    Bro.2 channel kaam nhi kar rhe hain please help..i followed all steps carefully..

  • @rahulseran762
    @rahulseran762 3 года назад

    Can you include Wifi manager in this code

  • @atreyraikar8784
    @atreyraikar8784 2 года назад

    I m faceing some problem with alexa and node mcu, alexa is not getting connected can someone help me?

  • @amritsinghmoyal
    @amritsinghmoyal 3 года назад

    Sir ek Q hei h...hme relay ko on krna h bt ek specific time tk on rkhna h ..jese 5 sec tk or fir apne aap off honi chaiye...supose i command that alexa turn on relay 1 and its on bt for 5 sec ..and i want it automatic off after 5 sec..

    • @MaheshBahutePPTSIndia
      @MaheshBahutePPTSIndia 3 года назад +1

      add delay in that executed file
      for eg. in code
      to make these changes in
      first device
      void firstLightChanged(uint8_t brightness)
      {
      //Control the device
      if (brightness == 255)
      {
      digitalWrite(RelayPin1, HIGH);
      Serial.println("Device1 ON");
      delay(5000);
      digitalWrite(RelayPin1, LOW);
      }
      else
      {
      digitalWrite(RelayPin1, LOW);
      Serial.println("Device1 OFF");
      }
      }

    • @amritsinghmoyal
      @amritsinghmoyal 3 года назад

      @@MaheshBahutePPTSIndia sir can you merge two program plss for ESP32 board ...
      1. fingerprint door lock by android fon with app ..
      code// #include
      WiFiClient client;
      WiFiServer server(80);
      #define wifiLed 2 //D2
      const char* ssid = "wifi name"; //WIFI SSID
      const char* password = "password"; //WIFI PASSWORD
      String data ="";
      int Relay4 = 26; //D26
      void setup()
      {
      pinMode(Relay4, OUTPUT);
      digitalWrite(Relay4,HIGH);
      Serial.begin(115200);
      connectwifiFing();
      server.begin();
      }
      void loop()
      {
      client = server.available();
      if (!client) return;
      data = checkClient ();
      Serial.print(data);
      if (data == "RELAY4SUCCESS")
      {
      digitalWrite(Relay4,LOW);
      delay(100);
      digitalWrite(Relay4,HIGH);
      }
      }
      void connectwifiFing()
      {
      Serial.println("Connecting to WIFI");
      WiFi.begin(ssid, password);
      pinMode(wifiLed, OUTPUT);
      Serial.print("WiFi Connected ");
      digitalWrite(wifiLed, HIGH);
      while ((!(WiFi.status() == WL_CONNECTED)))
      {
      delay(300);
      Serial.print("..");
      }
      Serial.println("");
      Serial.println("WiFi connected");
      Serial.println("NodeMCU Local IP is : ");
      Serial.print((WiFi.localIP()));
      }
      /********************************** RECEIVE DATA FROM the APP ******************************************/
      String checkClient (void)
      {
      while(!client.available()) delay(1);
      String request = client.readStringUntil('
      ');
      request.remove(0, 5);
      request.remove(request.length()-9,9);
      return request;
      }

    • @amritsinghmoyal
      @amritsinghmoyal 3 года назад

      @@MaheshBahutePPTSIndia and 2nd program is relay on off by alexa ...
      code//
      #include
      #include
      Espalexa espalexa;
      #define RelayPin1 23 //D23
      #define SwitchPin1 13 //D13
      #define wifiLed 2 //D2
      int toggleState_1 = 0;
      boolean connectWifi();
      void firstLightChanged(uint8_t brightness);
      // WiFi Credentials
      const char* ssid = "wifi name";
      const char* password = "passwrd";
      // device names
      String Device_1_Name = "Study Lamp";
      boolean wifiConnected = false;
      //our callback functions
      void firstLightChanged(uint8_t brightness)
      {
      //Control the device
      if (brightness == 255)
      {
      digitalWrite(RelayPin1, LOW);
      Serial.println("Device1 ON");
      toggleState_1 = 1;
      }
      else
      {
      digitalWrite(RelayPin1, HIGH);
      Serial.println("Device1 OFF");
      toggleState_1 = 0;
      }
      }
      void relayOnOff(int relay){
      EspalexaDevice* d = espalexa.getDevice(relay-1); //the index is zero-based
      switch(relay){
      case 1:
      if(toggleState_1 == 1){
      d->setPercent(100); //set value "brightness" in percent
      digitalWrite(RelayPin1, LOW); // turn on relay 1
      toggleState_1 = 0;
      Serial.println("Device1 ON");
      }
      else{
      d->setPercent(0); //set value "brightness" in percent
      digitalWrite(RelayPin1, HIGH); // turn off relay 1
      toggleState_1 = 1;
      Serial.println("Device1 OFF");
      }
      break;
      default : break; }
      delay(300);}
      // connect to wifi - returns true if successful or false if not
      boolean connectWifi()
      {
      boolean state = true;
      int i = 0;
      WiFi.mode(WIFI_STA);
      WiFi.begin(ssid, password);
      Serial.println("");
      Serial.println("Connecting to WiFi");
      // Wait for connection
      Serial.print("Connecting...");
      while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
      if (i > 20) {
      state = false; break;
      }
      i++;
      }
      Serial.println("");
      if (state) {
      Serial.print("Connected to ");
      Serial.println(ssid);
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());
      }
      else {
      Serial.println("Connection failed.");
      }
      return state;
      }
      void addDevices(){
      // Define your devices here.
      espalexa.addDevice(Device_1_Name, firstLightChanged); //simplest definition, default state off
      espalexa.begin();
      }
      void setup()
      {
      Serial.begin(115200);
      pinMode(RelayPin1, OUTPUT);
      pinMode(wifiLed, OUTPUT);
      digitalWrite(wifiLed, HIGH);
      pinMode(SwitchPin1, INPUT_PULLUP);
      //During Starting all Relays should TURN OFF
      digitalWrite(RelayPin1, HIGH);

      // Initialise wifi connection
      wifiConnected = connectWifi();
      if (wifiConnected)
      {
      addDevices();
      }
      else
      {
      Serial.println("Cannot connect to WiFi. So in Manual Mode");
      delay(1000);
      }
      }
      void loop()
      {
      if (WiFi.status() != WL_CONNECTED)
      {
      //Serial.print("WiFi Not Connected ");
      digitalWrite(wifiLed, LOW); //Turn off WiFi LED
      //Manual Switch Control
      if (digitalRead(SwitchPin1) == LOW){
      relayOnOff(1);
      }
      }
      else
      {
      //Serial.print("WiFi Connected ");
      digitalWrite(wifiLed, HIGH);
      //Manual Switch Control
      if (digitalRead(SwitchPin1) == LOW){
      relayOnOff(1);
      }
      //WiFi Control
      if (wifiConnected){
      espalexa.loop();
      delay(1);
      }
      else {
      wifiConnected = connectWifi();
      // Initialise wifi connection
      if(wifiConnected){
      addDevices();
      }
      }
      }
      }

    • @amritsinghmoyal
      @amritsinghmoyal 3 года назад

      @@MaheshBahutePPTSIndia and rember its for ESP32 board DEV kit vi

  • @adedayoajibade8686
    @adedayoajibade8686 3 года назад

    Good job. I'm having issue with the code, showing this error message "leaving.... Hard resetting via RTS". HOW do I resolve this issue? Thanks for your quick response.

  • @saikatbiswas4402
    @saikatbiswas4402 4 года назад +1

    Nice

  • @bazurto_dev
    @bazurto_dev 3 года назад

    is the use of echo dot mandatory?

    • @TechStudyCell
      @TechStudyCell  3 года назад

      For this project, yes. Otherwise you can check my video on Arduino IoT Cloud and Sinric Pro.

  • @vikrantbhardwaj6779
    @vikrantbhardwaj6779 4 года назад +1

    Can you share the code please I liked your project

    • @TechStudyCell
      @TechStudyCell  4 года назад

      You can download the code from description

  • @qbmqatarolakara8425
    @qbmqatarolakara8425 4 года назад

    hi dear can we connect blynk to alexa

    • @TechStudyCell
      @TechStudyCell  4 года назад

      The Alexa App has all the features that Blynk have. Why you need both.

  • @GoogleAccount-rh2ls
    @GoogleAccount-rh2ls 4 года назад

    Excellent explantion 👍

  • @shreedeepgangopadhyay4623
    @shreedeepgangopadhyay4623 4 года назад

    please check the google drive link of the code. It's not working. I have mailed you for some queries related to the assembled PCB of some of your projects. I want to buy all those PCBs. But first of all please make the drive link available to us. I beg of your help

    • @TechStudyCell
      @TechStudyCell  4 года назад +1

      I have checked. The link is working. But still if you face problem please refer the following link. Thank you.
      www.hackster.io/techstudycell/alexa-home-automation-system-using-nodemcu-relay-module-234617#code
      You can also refer this video: ruclips.net/video/OJ4CzWyRQr4/видео.html

  • @prateekagarwal9984
    @prateekagarwal9984 4 года назад

    the alexa app is not findin any devices, the wifi is connected on serial monitor, both on the same wifi , still not showing on the app

    • @TechStudyCell
      @TechStudyCell  4 года назад

      The NodeMCU, echo dot, and Amazon Alexa App should be connected with same WiFi.