Hello friends, welcome to Tech StudyCell.
in this video we will make a very useful Alexa home automation system using NodeMCU and Arduino
IoT cloud. to make this project you just need a NodeMCU
and a relay module. so you don't need any custom design PCB for
this project. and you also don't need any Alexa devices
like echo dot. you can just use the Amazon Alexa app to control the relay with Alexa. now before going to the details, let me show
you how this Alexa home automation system works. "Alexa turn on switch1". "Alexa turn on switch4". "Alexa turn off switch1". and I can also control
it manually from the Amazon Alexa app. so here you can see I can easily control switches
from the Amazon Alexa app. now let me control it manually. you can see, I can also control it manually
from the push button. now let me turn off the Wi-Fi and show you
how it works without the internet. after turning off the Wi-Fi, the blue LED
turns off automatically which indicates the NodeMCU is not connected with the internet. so I can control these appliances only from
the push button. So let me control it from the push button. if there is no internet still we can control
the appliances manually from the push-button. now let me turn on the wi-fi again. after turning on the Wi-Fi you can see the
NodeMCU automatically connect with Wi-Fi and blue LED turns on So I can again control these
lamps with Alexa. "Alexa turn off switch1". and you can also
use the Arduino IoT cloud app to control is appliances. let me show you. let me turn off the lamp from this app. so
this is a very useful Home Automation project and during the video, I will share the circuit,
code, and order the details. So I will highly recommend you to watch the
complete video and after that, you can easily make this project for your home. so let's get started. to make this home automation project you need
a NodeMCU, a 4 channel relay module, and the pushbuttons. now we have to connect all these components
as per this circuit diagram. you can see, in the circuit, I have given
the 5 volt supply to NodeMCU and relay module. and these pushbuttons are connected across
the GPIO pins and ground pin. and this is the AC circuit. please take proper safety precautions while
connecting these four lamps with the relay module. as you can see there are a lot of
connections, so to make the circuit compact, I have designed a PCB for this project. but as I said, you can also make this project
without using any custom design PCB. still, if you want to get this custom design PCB
then download the Gerber file from the video description and order it from the jlcpcb.
you can order any custom design PCB from JLCPCB with three simple steps. first, upload the Gerber file, then select
the parameters like quantity, PCB marking color, then place the order. if you select faster delivery services then
you will get the PCB within a week. and as you can see the quality of the PCB
is very premium in this affordable price range. so you can always try jlcpcb for any custom
design PCB project. now, these are the components required for
the PCB. now will quickly solder all the components on the PCB. now let me connect NodeMCU with
the PCB. now I will configure the Arduino IoT cloud. for that, I have to connect NodeMCU with my
laptop. this is the code for this project you can
download this code from our website iotcircuithub.com. just visit the article, link given in description. then you can download the code from this button. in the code, you have to enter some details
from the Arduino IoT cloud. so before programming the NodeMCU you have
to configure the Arduino IoT cloud. so you have to visit this page then click
here to create an account. and click create one. give my birthday. now here you have to enter the email id username
and set a password for this account. then click on sign up. here I will use the free plan, and here you
can see this is their free plan. you can create two things, unlimited dashboard. so this plan is sufficient to create this
project. we don't have to buy any paid plan here. now I will click on "IoT cloud". then click on "create things". Now here they have sent a verification code
to the email ID to activate the account. so let me go to my Gmail account. you can see this is the authentication email. I have to click here to activate the account. now again I will go to the Arduino IoT cloud. refresh the page. first, I have to select the device as NodeMCU. so I will click here and select the setup
third-party device. and I will check this ESP8266, and select the model as NodeMCU 1.0,
and click on Continue. now I have to give a name to this device. you can give any name. I am giving this name to this device. now click on next. So it will generate a device ID and secret
key. you have to download that in PDF. So I will click here to download the device
ID and secret key. then I'll click on Continue. you can see our device added. now I will click on this add variable button. as I am going to control four relays, so I
will create 4 variables. so here I will give the name for the first
variable as switch1. you can give any name. now here, I will select "Alexa compatible"
and I will select this is a switch. you can also select light if you want. after that the variable permission should
be "Read & write", and the variable update policy will be selected as "On change". now I will click on "Add variable". Our first variable is created. in a similar way, I have to create the next
three variables. as you can see I have created all four variables for the four relays. and
I have given the names switcht1, switcht2, switch3, and switch4. Alexa will identify that particular switch
with this name. after creating these variables, I will click
on the dashboard and here click on the "Build dashboard". Now here you have to click on this edit icon,
and let me give the name of the dashboard. now click on "ADD". and here select the Switch. I will use the first switch to control the
relay1, so here I will give the name Switch1. and I will link it with the switch1, which
we have created earlier. Click on the link variable. now I have to click on "Done". thus we have created the first switch in the
dashboard. In this way, you have to create four Switches
and link the switches with variables created earlier. you can see, we have created our dashboard
in the Arduino IoT cloud. now again I will click on Things, select the
Things we have created just now. now I will go to the sketch section. here you can see the sketch is automatically
created. and whenever any change happens to switch1,
then what should happen, we have to enter here. We will not update this sketch. We will use the sketch you have downloaded. so from this Arduino IoT Cloud, we will get
the device ID. you can see this is a device id. I will click here to copy the device id. now
go to the Arduino sketch and in the things property, you have to enter the device ID.
so I will enter the device ID here. now I will copy the things ID. Here you can see this is a things id, at the
bottom. I will enter Things ID here. now in the Arduino secret, you have to enter
the Wi-Fi credentials, and the device Key, which you have downloaded in the PDF. so let
me enter the Wi-Fi credentials. Now let me open the PDF which we have downloaded.
and here you can see this is the secret ID. so we have entered the Wi-Fi credentials,
device key which is a secret key. and in the things property, we have entered the things
ID and device ID. after entering all these details we need this Atduinoiotcloud library. so I will go to Sketch, then go to include
library, manage library, and you have to install this ArduinoIotCloud library. I have already installed it. now when you click on install it will ask
to install all other dependencies. so here you have to click on "Install All"
to install all the dependencies. so after installing all the libraries, we
will go to "Tools", select the board as NodeMCU 1.0 and select proper PORT. then we can hit
the upload button. after programming the NodeMCU, you can see
the blue LED turns on, which indicates NodeMCU is connected with Wi-Fi. so you can configure
the Amazon Alexa app. let me open the Amazon Alexa app. first, tap on the device and here
you can see no device connected. now I will tap on "more", select "skills and
games". here I have to search for Arduino. Tap on the Arduino. now select the first option. now tap on "Enable to use" it may ask for
the Arduino IoT cloud credential. so enter the credential, after that, you will
find Arduino has been successfully linked. now again I have to go to the Amazon Alexa
app, and select "Discover devices". now Alexa is looking for a new device and
during this time the NodeMCU should be connected with Wi-Fi. and here you can see four devices
found. so I will go to the device, and in the Switch,
we will get all four devices. I can also control it from the Amazon Alexa
app. as you can see I have connected all these four lamps with the relay module as per the
circuit. now let me turn on the supply. "Alexa turn on switch1", "Alexa turn on switch4". you can also join our Telegram channel Tech
StudyCell to get more such Home Automation ideas. if you find this project helpful then please
hit the like button and share it with your friends. don't forget to subscribe for more such videos
thank you for watching have a great day.