Google Assistant Controlled Multiple Appliances | Monitor Sensor's data | IoT Projects | ESP8266 12e

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone now in this video I will teach you wouldn't project with multiple applications dislike you will control multiple appliances using Google assistant you can automate your appliances but turning them on automatically as soon as you enter into the room you can get notifications if anyone enters your room secretly and even buzzer buzzer for intrusion detection you can monitor various parameters just like temperature humidity co2 concentration sound intensity light intensity etc so these are some qualities of one single project which we await to make in this video I made some teasers and uploaded on to my channel to just let you know what variety of projects you can do with this single board now it's up to you that how you can combine all this components and make something innovative out of this so let's get started so let's just see what this project includes so this project includes esp8266 20 development world and we can say an or MCU board as a central controller of our project ESP becomes the first priority for my IOT related projects as it has a great community support secondly it also works with our Dino firmware so we can have multiple example codes to get started with our projects secondly we have 4 5 or relays to switch for appliances I have used this 330 ohm resistor and bc547c ster who drive this relays the reason of using the resistor is just to increase the current for driving a relays then we have one servo motor now why I have used the servo that I will let you know in the second part further we have dht11 sensor to monitor temperature and humidity of the room this module includes one micro controller and a capacitive sensor in it that sends the sensor to you to boot temperature and humidity which is processed by this inbuilt micro controller that process data is read by an ESP board along with its dedicated library we also have 4 analog sensors which can sense sound motion gas and light intensity as we have only single analog pin in a spectrally board I have used this analog multiplexer module to interface multiple sensors this model will take 2 digital pins as input to select up to 4 analog sensors so we need to have these many components and one PCB for this project now I have designed this PC me online at easy idiot comm on this you can easily design the PCB but just inserting the required components and making the connections I made this in a two layer format after making the design save it it in a gerber file format if you want to get the gerber file or this project just let me know in the comments below after that I have ordered ten of these PCBs from the website called GLC PCB comm a company that provides premium quality PCBs at very reasonable price to order PCBs just go to JL CBC be calm and make an account here after making an account log into that account after that click on quote Now button here upload your Gerber file that you have just downloaded select the number of PCBs then select the color of the masking you want for your PCB that's it complete the order by making the pavement and wait for the PCBs to arrive at your doorstep gives you LC PCB a try to make your projects look neat and well arranged one by one I have shielded all the components on this PCB for ESP 2 6 6 2 le board and for the multiplexer module I have used this female headers so that I can reuse them in my next project after shouldering all the components it will look something like this if you want to make connections on your own then the connection of all the components I use are something like this now let's start with the logic used in our project first we will learn how to control multiple appliances using Google assistant and also monitoring census data over Internet and for that the process is first we will ask a Google assistant on a smart phone to switch on fan that command will be given to IFTTT server IFTTT stands for if this then that this is a great platform to merge two services by making an applet will then how to make an applet in a while basically I have Krita T need to have one condition and one action if the condition is satisfied then the particular action will be performed for example in our case I've given the condition as if my Google assistant listens to turn on fan then perform an action of sending data 1 to fan feed of my Adafruit equity broker so this kind of applets you can make in ifttt.com coming back to the process when the condition is satisfied the data will be sent to Adafruit impurity broker now let's see how M gedit evokes m TT T stands for message queue it elementary transport which has two major components broker and client broker is regarded as a server and clients are nothing but our microcontroller ports here one more term comes as topics topics can be regarded as particular folder on the whole server let's understand mqtt with an example suppose we have three clients a b and c two clients me and see a subscribe to a topic called temperature on the MDT broker now if the client a publishes the data on the temperature for example 22.5 then that same data is sent to everyone subscribe to the temperature topic the broker can be a local broker that works within the range of a Wi-Fi router or it can be a cloud-based broker that can work from anywhere in the world the one which we are using is a cloud-based server so that we can say and receive data from anywhere in this world let us get back to the process so in a fruit mqtt topics are regarded as fields here we have created a field called fan now at ESP board which is acting as MQTT client is already subscribed to the field called fan so any data change in that field will be received by our ESP board as the data received is 1 the relay which is connected to the ESP board will be turned on and the fan which is attached to the relay will eventually turn on for monitoring sensors on internet we have attached several sensors to a ESP board with the help of the multiplexer module the data of all the sensors is sent to different different fields on a same in Krita d broker with an interval of 20 seconds now we can easily observe the data through mqtt dashboard on a laptop or a smartphone so this is the process through which we can control appliances using Google assistant and also monitor census data from anywhere in this world let's see how to implement this using our ESP board in our do you know first of all go to the website cut IO dot adafruit.com make an account here this website provides us a free MQTT broker on which we can create up to 10 feeds after making a count again go to i/o by Jeff root calm then you will observe this page click on actions and create new dashboard your rendom name and description for your understanding after creating go inside the dashboard and click on the plus icon on the right corner here first we will select a toggle button as we need to just turn on and off the appliances after that we need to create feed name which is nothing but the topic which we discussed earlier so I will create feed as relay 1 likewise I will create feed for all other appliances so I created four fields for each Relays now I will add another for sensor monitoring in a free account we can create only and feeds if we create more than ten it will show an error now we will subscribe a first person to relive one field click on next step now here we need to define what data we need to said when the button is on and what data to send when the button is off so for that I'm sending one for on and I'm sending zero for off then tip on create block similarly we will create different switches and will subscribe to the respective fields now for sensor we need to wander the value so we will select the gorge this time and subscribe to the topic called co2 here we'll to define the range of values to show and need to label it according to the parameters we are monitoring so likewise they will do it for all of the sensors after creating all this we will click on this green gear icon and arrange all the blocks properly so this all set up we need to do on the Adafruit MQTT broker side rest of the work need to be done on the arduino coding side and of course on IFTTT let them do the coding of I ESP board first of all you need to download this Adafruit MQTT library and the dht11 library was laying is our label in the description below so now about that and install it into your adeno after that open up the score whose Lee is also available in the description below I have made this code for controlling appliances as well as monitoring census data so let's understand this code first of all declaration of all necessary libraries for interfacing esp8266 Adafruit immunity client and dht11 sensor module after that I have defined all the pins according to the purpose which is mentioned in the comments after that we need to give the credentials of a Wi-Fi router or a mobile hotspot as a ESP require in connection to talk to the Adafruit server then we need to provide details of an Adafruit MTD server here you just need to change the username and key which you can get from the Adafruit account go to IOT AFRICOM click on the yellow key icon here you'll get your username and unique AI yo key after that some necessary declaration for mkdd client which we don't need to change moving ahead here we have to name the feeds which we need to subscribe and we need to publish i'll show you how to write this by writing one feed for both publish and subscribe for publish will first write in a food underscore mb TT underscore public space here you need to mention what variable so i will write it as light for light sensor is equal to either fruit underscore MPD t underscore publish into circular bracket address of n QT t comma eru underscore username double inverted comma now here we need to mention the feet name which we can find from an Adafruit account for that go to your inner product town click on the gear icon and click on this question mark icon of the blog whose field name you want to know in my case I will click on the question icon of light here I will copy the string slash feed slash light and paste it in this double inverted commas of the code then bracket close and semicolon this is how we can make a variable to publish to any feed now similarly you can make a variable for subscribing to any field just right Adafruit underscore immunity underscore subscribe space again a variable name in my case it is light one is equal to either fruit underscore MVP and this could subscribe into the bracket address of MQTT comma aiu underscore username into semicolon here also you need to mention the feed name which you can get through the same method so this is how you can create a variable for both published and subscribe after that defining DST type as dht11 and some necessary things for DST senses after that in the void setup I have defined the inputs and outputs after that Wi-Fi dot begin function for establishing connections to our router da stated begin function to establish connection with DHT sensor after that going inside the loop first of all empty t dot connect function will be executed in which ESP board will try to establish connection with MQTT broker i just used this buzzer just to give feedback about the connections like if the board is establishing a connection it will burst with a delay of 200 millisecond and as soon as it makes the connection it will make a long words of two seconds hearing the buzzer we come to know that a connection is perfectly established let's see this buzzer in action so after establishing the connections we are wandering the fields who we subscribed for 22nd which is defined here even it that comes to our subscribe topics and after 22nd we are publishing the data offer sensor to the respected feeds here important thing to note is a data sending and receiving is in the string format now to convert that string into integer we are using a function called a TOI that is a sky to integer which converts the data received to an integer data type which we can use to turn on and off the appliances for publishing we are selecting different sensors by giving different signal to s0 and s1 pin of multiplexer module for first both are low then for the second high low then low high and for the fourth both are high now let's just upload the code and see it in action wait we haven't yet configured IFTTT for that foot install I have 2d on your smart phone and sign in with your Google account then go to last menu my app let's now click on the plus sign on the top right corner here first we need to provide condition for that we are going to use Google assistant then we will click on say a simple phrase in this we need to add the statement which we are going to say after ok Google just like turn on light one then we can also add some optional statements if we want to after that we also need to mention that what Google assistant should say in response so I will right okay turning on light one after that click OK now we need to give a command to perform and Google assistant listens to this statement for that we'll select the inner proof service click on send data to Adafruit IO select the field on which you need to send the data and write the data to be sent in our case it is one click on ok then finish likewise will create another applet for turning of the light this we will write the data to save as zero likewise we can create other fields for all other appliances we can even add multiple tasks with single statement like we can turn off all the plants ease by saying OK Google turn off everything for this you need to create multiple applets all of which will have similar phrase for example I have created multiple applet which has similar condition that is turn off everything but all of them has different actions so what will happen is all appliances will change off by saying this single sentence this is the task to be performed on your IFTTT side now just make sure that the Google account you used for IFTTT is the same account you used for your Google assistant now for that go to google app on your smart phone and switch to the Google account which you have used at the time of login in the IFTTT now long press your home button and activate your Google assistant now ask for anything you want if both Google accounts are same then only it will work okay so everything is done now let's see it in action I have loaded the code and inserted the ESP board in the PCB less power of the board after long buzzer buzzer we are ready to go now let's go the census data for that you just need to go to IO dot adafruit.com you can observe the data or do your - now I have installed this project at best ATL and the math let me take a brief about this type of ATL labs here ATL stands for utterly tinkering lab which is an Indian government initiative under which 2500 such labs are set up across India inside school premises and this best ATL is one of 10 Intel power ATL's the question is are this kind of lab open for all well yes all you have to do is search for a tail lamps on meeting iOS website and contact the school tell them that you want to contribute as a mentor for more details about ATL labs you can message on the Facebook page of past ATL whose link is our level in the description below so yeah this is it about the part one and in the part two I will let you know why and how interface the servomotor with this and I will also let you know how to get the real-time notifications on your smartphone so wait for the next part and give big thumbs up if you really love this project time for some giveaways I will be giving away this PCBs to four of my viewers in the part 1 and other 4 in the part 2 to get those PCBs you just need to comment down what best you can make using this PCBs or we can say using this project what other applications you can think which can be implemented using this board just comment your ideas in the comment box best four will get those PCBs remember you need to be subscriber of my channel so ending this video here subscribe my channel if you want to learn more innovative projects in automation IOT and electronics wait for the next video until then explore learn share with me techie SMS [Music]
Info
Channel: techiesms
Views: 64,669
Rating: undefined out of 5
Keywords: iot, esp8266, esp8266 projects, techiesms, iot projects, home automation, controlling appliances through google assistant, esp8266 home automation, home automation using esp8266, esp8266 multiple sensors
Id: 9dxEdDDb_gE
Channel Id: undefined
Length: 22min 0sec (1320 seconds)
Published: Sat Feb 24 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.