Alexa Smart Home System Using NodeMCU Relay Module

by techstudycell in Circuits > Microcontrollers

4328 Views, 9 Favorites, 0 Comments

Alexa Smart Home System Using NodeMCU Relay Module

NodeMCU Alexa control Relays Pic 1.jpg
Alexa Smart Home Automation system using NodeMCU ESP8266 & Relay Module | IoT Projects
NodeMCU Alexa control Relays Pic 10.jpg
NodeMCU Alexa control Relays Pic 11.jpg

In this IoT project, I have made the Alexa Smart Home Automation system using the NodeMCU ESP8266 & Relay Module. You can easily control light, fan, and other home appliances with the voice command. To connect the Echo Dot smart speaker with the NodeMCU, I have used only the Amazon Alexa app.

If you don't have Echo Dot smart speaker, still you can control the home appliances. And you can also monitor the relay time feedback of the switches from the smartphone. You can also use the ESP32 board instead of the NodeMCU microcontroller.

Supplies

1. Alexa Echo Dot

2. Relay Module

3. NodeMCU or ESP32 board

4. Relays 5v (SPDT)

5. BC547 Transistors

6. LED 5mm

7. 220-ohm Resistors

5. Connectors

Circuit Diagram

NodeMCU Alexa control Relays Pic 2.jpg

As you can see the circuit for this home automation project is very simple. You can easily make this circuit with the Relay module and NodeMCU.

Here, I have used D1, D2, D5, D6, D7 pins of NodeMCU to control the 5 Relays. And I have used a 5V mobile charger to supply the circuit.

Program the NodeMCU

NodeMCU Alexa control Relays Pic 6.jpg
NodeMCU Alexa control Relays Pic 7.jpg

In the tutorial video, I have explained the code in detail.

As I said, you can use both NodeMCU or ESP32 for this project. I have used the ESPAlexa library for this project.

If you use NodeMCU ESP8266 then you have to download and install the ESP8266 board version (2.5.1) (as shown in the picture).

I have faced some issues with the latest version of the ESp8266 board library while uploading the code.

In the code enter the WiFi credentials, and set the names of the devices like Room light, fan, Night Lamp, etc.

Here, I have used the active High relay module, so if you use the active low relay module then you have to do little modifications in the code as shown in the tutorial video.

Still, if you face any issue, let me know in the comment section.

I have attached the code for this Alexa home automation project.

Configure the Amazon Alexa App

NodeMCU Alexa control Relays Pic 8.jpg

First, download and install the Amazon Alexa App from the Google PlayStore or App Store.

Your mobile and the NodeMCU should be connected with the same wifi network.

Steps to add devices in Amazon Alexa App.

1. Open the Amazon Alexa App.

2. Goto Devices.

3. Tap on the "+" icon on the top, then select Add Devices.

4. Select Light then selects Other.

5. Tap on the Discover Devices.

It will take some time to discover all the devices. After that add all the devices one by one in the Amazon Alexa App. In the tutorial video, I have step by step how to connect devices with the Amazon Alexa app.

Designing the PCB

NodeMCU Alexa control Relays Pic 5.jpg

Although you don't need any custom design PCB to make this smart home system. But to make the circuit compact and to give the project a professional look, I have designed the PCB for this Alexa project.

Order the PCB

FPDLGBTKDD3KZHV.jpg
FI5K86IKDD3KZHX.jpg
jlc.jpeg

After downloading the Garber file you can easily order the PCB

1. Visit https://jlcpcb.com and Sign in / Sign up

2. Click on the QUOTE NOW button.

3 Click on the "Add your Gerber file" button.

Then browse and select the Gerber file you have downloaded.

Uploading the Gerber File and Set the Parameters

FDSWBRHKDD3KZI2.jpg
FP9IO6DKDD3KZI1.jpg

4. Set the required parameter like quantity, PCB color, etc

5. After selecting all the Parameters for PCB click on SAVE TO CART button.

Select Shipping Address and Payment Mode

FUW3Y8GKDD3KZHZ.jpg
FYS3X74KDD3KZI0.jpg
FSEO3JLKDD3KZSH.png

6. Type the Shipping Address.

7. Select the Shipping Method suitable for you.

8. Submit the order and proceed for the payment.

You can also track your order from the JLCPCB.com.

My PCBs took 2 days to get manufactured and arrived within a week using the DHL delivery option.

PCBs were well packed and the quality was really good at this affordable price.

Solder All the Components

vlcsnap-2020-08-03-11h17m42s856 (2).png
vlcsnap-2020-08-03-11h19m44s404 (2).png

After that solder all the components as per the circuit diagram.

Then connect the NodeMCU.

Connect the Home Appliances

NodeMCU Alexa control Relays Pic 3.jpg

Connect the home appliances as per the circuit diagram.

Please take proper safety precautions while working with high voltage.

Connect 5Volt DC supply to PCB as shown in the circuit.

Turn on the 110V/230V supply and 5V DC supply.

Finally, We Can Control the Light, Fan With Alexa

NodeMCU Alexa control Relays Pic 4.jpg
NodeMCU Alexa control Relays Pic 9.jpg

Now you can control your home appliances in a smart way.

Just say which devices you want to turn on or off to Alexa, Alexa will do the job for you.

I hope you have liked this home automation project. I have shared all the required information for this project.

I will really appreciate it if you share your valuable feedback,
Also if you have any query please write in the comment section.

For more such projects Please follow TechStudyCell.

Thank you for your time & Happy Learning.