[Music] so hello everyone and welcome to yet another home automation project based tutorial video and this time we tried some unique new refreshing way to control to interact with your home appliances which is by just scanning those qr code attached to all those appliances just pick out a smartphone scan the qr code and toggle your appliances like a magic okay so this is kind of a concept it's not just limited to home automation project only when you go through this video you understand this concept and maybe you can find out new ways new application where this concept can be used so it's always great to learn new concept new ideas and maybe implement those ideas later on in some other fields that being said let's start with this fresh new concept so first of all let's start with the hardware part of the project so for hardwood part what i did is i just utilized my previously made home automation project which are like internet and manual home automation using esp82 all in one home automation using again using esp32 so what you can do is you can also utilize your own like previously made home automation projects and change the core of the esp32 or the nodemcu board and it will work with this particular concept as well okay so in case you already have those uh pcb designs and circuit diagrams what you can do is you can just order your own custom pcbs as i did okay so here i would like to thank glc pc before you know sponsoring those amazing pcbs well you can also order your own custom designed pcb by just uploading the gerber file of those pcb projects select the color masking if you really wanted and pay for your order now if you select the fastest delivery option you may get the pcbs delivered within 7 days so try adding your own custom pcbs from dlc pcb to make your project looks neat and more compact so yeah that was all about the hardware part take the relay take the esp boards attach at particular gpio and good to go for the hardware everything every magic every logic is happening inside the code only so what i'll do is straight i will take you to the arduino code and i'll explain you all the things about how this project is actually working okay so yeah here is the code which i named as qr home automation as this is working on qr code first of all this project this code will work for both esp8266 and esp32 board so you don't need to change anything it is compatible for both the boards okay after that here i've defined the pin numbers on which i have attached the relay so here i'm using my internet and manual home automation pcb which was based on esp32 board and if you want that exact same pcb you can get it for free by ordering tech sms merchandise the link for that is in the description okay after that here to provide the city name and password of your wi-fi router so this whole home automation concept project is working under local area networks so make sure that your esp32 board and the device through which you will be controlling should be connected with the same wi-fi network now here is one great thing you don't even need to enter the site name and password on your phone for example if you if any guest is coming inside your home inside the studio you don't need to let them know uh type manually about their id name and password and connect to that router i'll show you one step using which your phone or the any of the phone will get easily connected with the same wi-fi network straight after that here i have created a very small web page which will display four buttons as my project had four relays so i have defined four different buttons here okay after that what i'm doing is i'm just enabling a server running on our esp32 board only which will be running locally of course okay straight after that here all the wi-fi connection uh logic is written after that we are just beginning the server and here is one important line which is about mdns server okay so what mdns means is see what happens is whenever we upload this kind of a local area network or local server course on esp32 board our router assigns a local ip address to that board and using that local ip address we'll be able to interact with that particular board okay but what happens is this this all are the dynamic local ip address assigned by the router okay so whenever your device get connected you are not aware about which id or which uh ip address is assigned to your board okay so every time it get connected to it it gets a different local ip address so it's become really very difficult to get those ip addresses but here is the solution for that using mdns you no longer need to remember you no longer need to worry about the ip address assigned you can assign a name to that particular esp board and using that name you can access that esp board from your local area network okay for that purpose mdns is used okay so here i have named my device as esp that means that once this code is uploaded once that board is connected with the wi-fi i can access those uh relays attached to that board by requesting the address called as esp dot local okay no ip address nothing okay so that's the power of mdns but in some of the mobile phones it may happen that mdns don't work so you have to go for the local ip address okay straight after that here i have written uh several functions which are responsible for controlling the relays for example in case we are getting the request as led one slash on it will just turn that gpio pin high in case we are getting off it will just turn the gpio to low okay so based on different different addresses i'm just turning on different different relays okay and furthermore what i did is if i get this address as led three slash toggle for example so inside toggle what i'm doing is so as soon as this link is requested this function will open up and what it will do is if previous state of led was high then it will turn to low and if the previous state was low it will turn too high so whenever you request the same link it is turning on and off the relay turning on and off that particular pin okay basically it is toggling that pin so that's why i defined these functions as well just to toggle the appliances okay straight after that uh in the loop we are doing nothing uh the server is handled by default okay so all the links are handled by default by this particular usb board so that was the simple code based on the link request we are just turning on and off the appliances that's pretty simple code okay so what i'll do is i'll straightaway upload this code onto my esp32 board and after that i insert this esp32 board onto my uh pcb project okay so that was all about the coding part as well but still we are left with that magical part like how we will be creating the qr code what data will those qr code contain so that thing is remaining so let me just uh explain you that thing as well so first of all for creating the qr code you need to go to one website called as qr code monkey.com which is a superb a website where you can design your own customized qr codes absolutely free okay so okay so based on the code we got to know that the appliances will be controlled based on a particular link request for example if the link is led one slash on then led one will be turning on okay so one thing is clear we want to design a qr code which contains the data of a http link okay so let's go back to that qr code monkey website and here i'll stick to url only okay so here i will create one qr code with the link to toggle the led one okay so for that the link will be http colon double forward slash esp dot local again i said this is uh using mdns so i can write esp dot local here forward slash led one forward slash toggle because what i want is once i scan the code the led should turn on the light should get turned on and next time when i scan the code the light should get turned off so i want to toggle this thing hence why i'm requesting this particular link okay so i've written one link okay if i click on the generate qr code a qr code containing the data of that particular url is automatically created okay now you can customize this qr code as well for example you can set a particular color if you want let me just take it to red if i click on create it will turn to red i can even add an icons in between just like if i add the icon off for let's say bitcoin if i click on create code a bitcoin is added in between okay and i can even change the design of this we can say square bracket which is generally called as iframes okay i can choose like this and if i click on create code okay as you can see we can make our customized qr codes and that is absolutely for free okay that's it so once you are like satisfied with your qr code design just click on download png so by clicking that it will download the image of the qr code which will contain the data of that particular url okay as you can see here is that qr code and what i did i also printed out the qr code with the address as esp.local now now one question is what will happen when we request this particular link we are not providing any address further on well by requesting this link what will happen is you will get a whole switchboard onto your phone that means there will be four different uh relays and that on off button will be displayed onto that particular smartphone without any application it will open up in a browser okay so with that you can control all the appliances using those buttons now this kind of qr code i will attach near to the switchboard so what happens is whenever person scan near to the switchboard the switchboard will appear onto the smartphone and whenever the person scan the qr code attached to that particular appliance the appliance will be toggled so these two kind of applications i have entered or i have made in this particular home automation concept now there is really one last thing remaining which is as i previously told this is a local area network-based home automation project and a person need to be connected with their home wi-fi network or the wi-fi router and i also said that the guest coming to the home or studio need not to manually type those commands like ssid name and password to get connected to it it will automatically connect it like how using the same qr code concept yes what you can do is inside this qr code monkey website you can go to wi-fi and here you can enter the ssid name of your wi-fi router and password of the save and after that just click on create qr code it will automatically create a qr code by scanning which that person's smartphone will automatically will get connected with your router without sharing any password or any sid name super cool right that's it i'll download this png file as well now after downloading all these qr codes what i did is i just printed out all the qr codes stick them at the particular place like the wi-fi qr code at the entrance of the door the qr code of switchboard near to the switchboard and the other qr code for appliances onto the no single appliances that's it we are done with all the parts of the project now let's just visualize this project in action as you can see this guy entered the studio and once he scans the qr code for the wi-fi now the smartphone gets automatically connected with the wi-fi router now he can easily control the appliances as you can see as he just scanned the qr code of this big light light got turned on and now as you can see is going towards the switchboard and as soon as he scans the qr code near the switchboard well all the buttons and the lights appear onto the smartphone and he can easily control all the appliances with the help of those buttons so that was a new concept about how to control the home appliances with the help of qr codes without having any application without installing anything nothing just your smartphone and those qr code a paper and you're good to go to control the appliances so let me know in the comments about how how's this concept according to you is it really useful is it interesting how is it according to you let me know your thought about this video about this concept in one single word in the comments of the video let me know also let me know what improvements we can make here well one of the improvement with jayarat suggested me is he told me that there is an intern at techism he told me that rather than qr code nfcs are a very good option like you can just tap and control rather than waiting for scanning that qr code that was a really good idea thanks for it similarly if you have any other idea about interacting with the plants is a new like interesting way to share those ideas in the comment of the video like this video if you really enjoyed this new concept and that being said ending this video here and now just wait for my channel explode and share with me techy sms [Applause] [Music]