Smart Home with Google Assistant & Alexa using NodeMCU ESP8266 (Manual + Voice) | IoT Projects 2021

Tech StudyCell
17 Apr 202110:41

Summary

TLDRIn this Tech StudyCell video, learn to create a home automation system using NodeMCU to control appliances with Google Assistant and Alexa, or manually with switches. The system allows remote control worldwide without needing an Echo Dot or Google Home. The video provides a complete circuit diagram and code, enabling viewers to build this system at home. It also includes a tutorial on using Sinric Pro for device control and configuring both the Alexa and Google Home apps.

Takeaways

  • ๐ŸŒ This video demonstrates how to create a home automation system using NodeMCU to control appliances with Google Assistant and Alexa app.
  • ๐Ÿ”Œ The system allows manual control of appliances with switches and real-time monitoring through Google Home and Alexa app.
  • ๐Ÿ“ฑ No need for dedicated Alexa or Google Home devices; their Android apps can be used for control.
  • ๐Ÿ  The video shows how to control appliances even without an internet connection using manual switches.
  • ๐Ÿ› ๏ธ The project requires a NodeMCU and a 4-channel relay module, and optionally a custom PCB for a professional finish.
  • ๐Ÿ”— Safety precautions are emphasized when connecting appliances to the relay module.
  • ๐Ÿ’ป The video provides a complete circuit diagram and code for the project, available on the iotcircuithub.com website.
  • ๐Ÿ”‘ A Sinric Pro account is necessary for integration with Google Assistant and Alexa, with detailed steps shown for setup.
  • ๐Ÿ”‘ The video explains how to configure devices in the Sinric Pro dashboard and link them to the Google Home and Alexa apps.
  • ๐Ÿ”Œ The code provided includes instructions for setting up Wi-Fi credentials, APP KEY, APP SECRET, and device IDs.
  • ๐Ÿ”„ The video highlights the need to manage switches correctly during the NodeMCU booting process to avoid issues.

Q & A

  • What is the main purpose of the video?

    -The main purpose of the video is to demonstrate how to create a home automation system using NodeMCU that can control appliances with Google Assistant and Alexa app, as well as manually with switches.

  • What are the key features of the home automation system presented in the video?

    -The system allows for remote control of appliances using Google Assistant and Alexa, manual control with switches, real-time status monitoring in the Google Home and Alexa app, and operation even without an internet connection.

  • What components are required to build the home automation system?

    -The system requires a NodeMCU, a 4-channel relay module, and optionally, existing switch boards or push buttons.

  • Is it necessary to have a physical Google Home or Alexa device for this project?

    -No, a physical Google Home or Alexa device is not necessary. The project can be controlled using their respective Android apps.

  • How does the system work without an internet connection?

    -Without an internet connection, the system can still be controlled manually using the switches, but there will be a delay in the operation of the appliances.

  • What is the role of the relay module in this project?

    -The relay module is used to control the appliances by switching the electrical circuit on and off based on the commands received from Google Assistant, Alexa, or manual switches.

  • Why is it recommended to use a PCB for the project?

    -Using a PCB gives the project a professional look and helps in organizing the numerous connections in a neat and efficient manner.

  • How can one order a custom PCB for this project?

    -One can order a custom PCB from JLCPCB by uploading a Gerber file, selecting parameters like quantity and PCB masking color, and then placing the order.

  • What are the required libraries for programming the NodeMCU?

    -The required libraries include SinricPro, ArduinoJson, and WebSockets.

  • How does one configure the Sinric account for the project?

    -One needs to sign up on Sinric Pro, create rooms and devices, and then use the APP KEY and APP SECRET along with the device IDs in the NodeMCU code.

  • How are the devices discovered and controlled in the Alexa and Google Home apps?

    -After enabling Sinric Pro in the Alexa app and logging in with Sinric credentials, devices can be discovered and controlled. Similarly, in the Google Home app, after setting up a home and linking the Sinric account, devices can be controlled.

  • What is the limitation when using the free version of Sinric Pro?

    -The free version of Sinric Pro allows control of a maximum of 3 devices with Google Home and Alexa app.

Outlines

00:00

๐Ÿ› ๏ธ Building a Home Automation System with NodeMCU

The video introduces a home automation project using NodeMCU to control appliances with Google Assistant and Alexa app. It demonstrates the ability to control lamps through voice commands with both Google and Alexa, as well as manually with switches. The video also shows how the system operates offline when Wi-Fi is disabled, reverting to manual control only. The presenter then explains the components needed, including a NodeMCU and a 4-channel relay module, and walks through the circuit setup. Safety precautions are emphasized when connecting the relay module to appliances. A PCB design for a professional finish is mentioned, and the process of ordering a custom PCB from JLCPCB is outlined, including steps for uploading Gerber files and selecting parameters.

05:00

๐Ÿ“ฑ Integrating with Sinric Pro and Configuring Apps

This section details the process of setting up the Sinric Pro account, which is necessary for integrating the home automation system with Google Assistant and Alexa. The presenter guides through creating rooms and devices within the Sinric dashboard, assigning each device a unique ID. The code for the NodeMCU is explained, including the necessary libraries such as SinricPro, ArduinoJson, and WebSockets. The video demonstrates how to input Wi-Fi credentials and่พ›ric APP KEY and APP SECRET into the code. The process of configuring both the Amazon Alexa app and Google Home app to discover and control the devices is also covered, including linking Sinric Pro to these apps and verifying the successful connection of devices.

10:01

๐Ÿก Demonstrating the Smart Home System

The presenter concludes by demonstrating the final setup of the smart home system, showing how to control multiple lights using Google Assistant. The video highlights the functionality of the free Sinric Pro account, which supports control of up to three devices with Google Home and Alexa. The presenter encourages viewers to join their Telegram channel for more home automation ideas and invites feedback and subscription for future projects. The video wraps up with a reminder to consider safety during setup and a thank you note to viewers.

Mindmap

Keywords

๐Ÿ’กNodeMCU

NodeMCU is an open-source IoT (Internet of Things) development board that includes an ESP8266 Wi-Fi chip and a microcontroller. In the context of the video, it is used as the central processing unit to control home appliances through Wi-Fi connectivity. The script mentions using NodeMCU to create a home automation system, indicating its role in enabling smart device control.

๐Ÿ’กGoogle Assistant

Google Assistant is a virtual assistant developed by Google, capable of voice-activated smart home control. In the video, it is used to demonstrate the control of home appliances remotely by issuing voice commands such as 'Hey Google, turn on all lamps', showcasing the integration of voice control in home automation.

๐Ÿ’กAlexa

Alexa is a virtual assistant developed by Amazon that can control smart home devices. The script describes using Alexa to turn on and off room lights, indicating its compatibility with the home automation system built using NodeMCU, and highlighting the versatility of the system to work across different platforms.

๐Ÿ’กHome Automation

Home Automation refers to the control and management of home appliances and systems using networked controls. The video's theme revolves around creating a home automation system using NodeMCU, which allows for remote control of appliances through Google Assistant and Alexa, as well as manual switches, exemplifying the core concept of home automation.

๐Ÿ’กRelay Module

A relay module is an electronic device that acts as an electrically controlled switch, allowing the control of high voltage appliances with low voltage signals. In the video, a 4-channel relay module is used with NodeMCU to control various home appliances, illustrating its function in the automation setup.

๐Ÿ’กManual Switches

Manual switches are physical controls used to turn electrical devices on or off. The script mentions the ability to control appliances manually with switches, emphasizing the dual functionality of the system to operate both through automation and traditional manual methods.

๐Ÿ’กReal-time Status

Real-time status refers to the immediate and ongoing display of the current state of a system. The video mentions monitoring the real-time status of appliances in the Google Home and Alexa app, which is crucial for home automation as it provides users with up-to-date information about their home's state.

๐Ÿ’กSinric Pro

Sinric Pro is a cloud service that enables IoT devices to integrate with Alexa and Google Assistant. The video script describes configuring Sinric Pro to connect NodeMCU with Alexa and Google Home, indicating its role as a bridge between the homemade automation system and popular voice control platforms.

๐Ÿ’กCircuit Diagram

A circuit diagram is a visual representation of an electrical circuit. The video promises to share the complete circuit diagram for the home automation project, which is essential for understanding how to physically assemble the components like NodeMCU and the relay module.

๐Ÿ’กWiFi Connectivity

WiFi connectivity is the ability of a device to connect to the internet wirelessly. The script describes the NodeMCU automatically connecting to WiFi after Wi-Fi is turned on, which is fundamental to the operation of the home automation system as it enables remote control and communication.

๐Ÿ’กCustom Design PCB

A custom design PCB (Printed Circuit Board) is a board tailored to specific project requirements. The video mentions designing a PCB for a professional look, suggesting a step for enhancing the project's appearance and organization, and possibly its reliability.

Highlights

Introduction to creating a home automation system using NodeMCU.

Control appliances with Google Assistant and Alexa app.

Manual control of appliances with switches.

Real-time status monitoring in Google Home and Alexa app.

Demonstration of voice control with Google Assistant and Alexa.

Ability to control appliances without an Alexa device or Google Home.

Manual control demonstration with switches.

Functionality of the system without an internet connection.

Automatic reconnection to Wi-Fi by NodeMCU.

Simple circuit diagram using NodeMCU and a 4-channel relay module.

Safety precautions while connecting appliances with the relay module.

Option to use push buttons instead of switches.

Professional PCB design and ordering from JLCPCB.

Components required for the PCB and soldering process.

NodeMCU configuration with Sinric account for IoT integration.

Device creation and room setup in Sinric Pro.

Code download and library installation for the project.

Entering Wi-Fi credentials and Sinric APP KEY and APP SECRET in the code.

Device ID entry for each device in the code.

Code upload to NodeMCU and board selection.

Configuration of the Amazon Alexa app for device discovery.

Linking Sinric Pro account with Alexa app.

Google Home app setup and device discovery.

Demonstration of controlling appliances with Google Assistant.

Limitation of using switches during NodeMCU booting process.

Invitation to join Telegram channel for more home automation ideas.

Call to action for likes, shares, and subscriptions.

Transcripts

play00:00

Hello friends, welcome to Tech StudyCell.

play00:01

In this video we will make a very useful home automation system using NodeMCU to control

play00:08

all the appliances with Google Assistant and from the Alexa app. and we can also control

play00:15

appliances manually with switches and monitor the real-time status in the Google home and

play00:20

Alexa app. let me show you how it works.

play00:22

Hey Google, turn on all lamps.

play00:29

Hey Google, turn off room light.

play00:33

Alexa, turn on room light.

play00:40

Alexa turn off night lamp.

play00:47

Hey Google, turn on night lamp.

play00:54

Thus, you can easily control appliances from anywhere in the world, using the Google Assistant

play01:01

and Alexa.

play01:03

You don't need any Alexa device like echo dot or Google home for this project.

play01:08

you can just use their Android app. let me control the appliances manually from the switches

play01:15

and you can see I can easily control all appliances.

play01:18

now let me turn off the internet, and show you how it works without internet.

play01:25

I have turned off the Wi-Fi, so I can control these lamps only from the manual switches.

play01:31

there is some delay as you can see after I turn off the switch it is taking some time.

play01:38

now let me turn on the Wi-Fi again.

play01:41

after turning on the Wi-Fi the NodeMCU will automatically connect with Wi-Fi and then

play01:46

we can control the appliances both from Google Assistant and Alexa.

play01:50

let me show you.

play01:52

Hey Google, turn off night lamp.

play01:58

hey Google, turn off room light.

play02:04

you can easily control appliances with Alexa, Google and from manual switches.

play02:09

and you can make this project without using any custom design PCB. you just have to use

play02:14

a NodeMCU and a relay module to make this project and during the video, I will share

play02:20

the complete circuit diagram, code for this project.

play02:23

so you can easily make this project for your home.

play02:26

let's get started.

play02:27

[Music]

play02:36

To make this project, we just need a NodeMCU a 4-channel relay module and you can use the

play02:42

existing switch board or push button.

play02:44

now you have to connect all this components as per the circuit diagram. as you can see

play02:50

the circuit is very simple.

play02:52

I have connected these switches across the GPIO pin and ground pin. and this is the AC

play02:57

circuit and this is LIVE and this is is neutral wire.

play03:01

please take proper safety precautions while connecting these appliances with the relay

play03:06

module.

play03:07

now if you use push button instead of switches then you have to refer this circuit.

play03:11

and again I have connected this push buttons across the GPIO pins and ground pin. as you

play03:16

can see there are a lot of connection, so to give the project a professional look I

play03:21

have designed a PCB for this project and order it from the jlcpcb. you can order any custom

play03:28

design PCB from JLCPCB with three simple steps.

play03:32

first upload a Gerber file then select the parameter like quantity, PCB masking color.

play03:39

then place the order.

play03:41

If you select a faster delivery service, then you will get the PCB within a week.

play03:46

and as you can see the quality of the PCB is very premium in this affordable price range.

play03:52

so you can always try jlcpcb for your any custom design PCB project.

play03:58

now these are the components required for the PCB. now I will quickly solder all the

play04:03

components on the PCB. now let me connect NodeMCU with the PCB.

play04:07

Before uploading the code I have to configure the Sinric account.

play04:12

for that I will use Sinric pro and you have to visit this page.

play04:16

I will mention the link in the description.

play04:19

then click on signup, and you have to mention all these details to create an account. I already

play04:25

have an account in Sinric Pro. so I will click on login and enter the credential and then

play04:32

click on login. this is the dashboad.

play04:35

first we will go to rooms.

play04:37

and here I will add one room.

play04:40

you can give any name but I am giving "Living Room" and then click on save.

play04:46

Our room created.

play04:48

then we'll go to Devices.

play04:50

here I am using the free version so I can add maximum 3 devices.

play04:55

first, we have to click on "Add devices" then give the name of the device.

play05:00

I am giving "Room Light".

play05:01

Device type will be "Switch" and I will select the room as "Living room".

play05:06

then I will click on Next.

play05:08

now if you want any notification related to that device then you can turn it on.

play05:14

I don't need that notification. and again I will tap on next. and then I'll click on

play05:21

save.

play05:22

our device is created.

play05:23

in similar way I will create the next two devices.

play05:27

so I have created these devices and is device has a unique ID, you can see.

play05:33

which will be required in the code.

play05:36

now we can program the NodeMCU for this project.

play05:39

this is the code for this project you can download this code from our website iotcircuithub.com.

play05:46

just visit the article, link given in the description.

play05:49

then you can download the code from this button. and in this code, I have mentioned all the

play05:55

required links to download the board and libraries.

play05:59

or you can also visit this page. and here you can see they have mentioned all the required

play06:05

libraries.

play06:06

you need "SinricPro", "ArduinoJson" and "WebSockets" libraries.

play06:10

after doing that you have to mention the Wi-Fi credentials.

play06:14

here your have to mention the Wi-Fi name and Wi-Fi password.

play06:18

then you have to mention the "APP KEY" and "APP SECRET".

play06:22

so if you go to your Sinric account, in the "Credentials", you will find the "APP KEY"

play06:30

and "APP SECRET".

play06:31

you just have to copy this and then here you have to paste the "APP KEY" and "APP SECRET".

play06:39

after that, you have to mention the device ID for each device.

play06:44

so let me enter the device ID. again I have to go to the Sinric account and go to "Devices"

play06:51

now we have to copy the device ID. let me copy it.

play06:54

then I have to paste it here.

play06:56

Thus, you have to enter the device ID for all three devices.

play07:02

and here you can see, these are the GPIO pins, I have used for this project.

play07:07

now if you use Switch, then you have to comment this line.

play07:11

but if you use push button then just uncomment is line.

play07:15

you can use same code for the pushbutton.

play07:18

so again I have to comment it, as I am using switch for this project.

play07:23

now I can upload this code to NodeMCU. for that I will go to Tools, select the board

play07:29

as "NodeMCU 1.0" and a proper PORT. then I can hit the upload button.

play07:36

now I will configure the Amazon Alexa app. so let me open the Alexa app and in the device

play07:44

you can see there is no device connected.

play07:47

now I will tap on more and select the "skills and games" and here I have to search for Sinric

play07:54

Pro. then I will tap on the Sinric Pro. now tap on the "Enable to Use".

play08:02

then you have to enter the Sinric credential.

play08:05

so here I will enter the email id and password which I have used for the Sinric. after that

play08:12

tap on sign in.

play08:14

you can see, Sinric Pro has been successfully linked.

play08:18

now again have to go to the Amazon Alexa app. now I have to tap on "Discover devices".

play08:24

it will take some time and during this time the NodeMCU should be connected with the Wi-Fi.

play08:30

Here you can see, 3 devices found.

play08:33

so I have to go to "Device" and in the "Plug" you can see these are the devices connected.

play08:40

now let me configure the Google Home app for this project.

play08:44

Let me open the Google Home app. in this app first I have to create a home.

play08:51

So I will tap on "create new home".

play08:53

and here I am giving the name "Smart Home" you can give any name.

play08:59

now tap on "Continue".

play09:01

the home is created.

play09:03

now again I will tap on this "+" icon. and select the first option "Set Up device". and

play09:10

here I will select "Works with Google".

play09:12

here you have to search for Sinric Pro and then select the Sinric Pro. again it will

play09:19

ask the Sinric credential.

play09:21

So we have to login the Sinric account.

play09:24

then tap on sign in.

play09:27

after that, you have to go to the homepage of the app. and here you can see 3 devices

play09:34

connected in the living room.

play09:37

you can see these are the three devices.

play09:38

Kitchen light, night lamp and room light.

play09:42

I can control these devices from the Google Home app.

play09:46

I have connected all these four lamps with this relay module as per the circuit.

play09:50

now let me turn on the 5 volt supply.

play09:53

now if you use switch, then there is one restriction, that during the booting process of NodeMCU

play09:58

this switch-2 must be turned off.

play10:01

but if you use push button then there is no such restriction.

play10:06

now let me control appliances with Google Assistant.

play10:09

hey Google, turn on all lights.

play10:12

So this is a very useful Smart home system, and as I am using the free version of Sinric Pro account

play10:21

so I can control maximum 3 devices with Google home and Alexa app. you can also join our

play10:27

Telegram channel "Tech StudyCell" to get different Home Automation ideas.

play10:31

if you like this project, then please hit the like button and share it with your friends.

play10:36

don't forget to subscribe for more such projects.

play10:38

thank you for watching have a great day.

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
Home AutomationNodeMCUGoogle AssistantAmazon AlexaDIY ProjectSmart HomeIoT DevicesRelay ModuleSinric ProNodeMCU Coding