IoT based projects using ESP32 Alexa Home Automation | Enter WiFi Credentials Over the Air

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends welcome to Tech study cell in most of my previous video I used to hard code the Wi-Fi credential in the code but after watching this video you don't have to hard code any Wi-Fi credential in the code whenever required you just have to scan a QR code from a mobile app and update or enter the Wi-Fi credential to esp32 from that mobile app to add these features you just need a Wi-Fi probe library and ESP ble provisioning app both are absolutely free during the video I have explained all the steps so after watching the complete video you can Implement these features to any iot application for demonstration I have used one of my previous ESP Alexa project you just need a esp32 any coder to make a complete Alexa home automation project you don't require any third party iot application here you can see I have made a complete circuit without using any PCB first let me control the appliances with the Amazon Alexa app turn on Studio light you can see the light turns on now I will use the IR remote to turn off this light now let me use manual switch to control these appliances and I can also monitor the real-time feedback if I turn on the studio light you can see the light turn on and here I can monitor the real time feedback now let me turn off the Wi-Fi after turning off the Wi-Fi you can see the blue LED automatically turns off so now I can only control the appliances manually with switch and with the IR remote now let me turn on the Wi-Fi the esp32 will automatically reconnect with the Wi-Fi here you can see the blue LED is on so it is now connected with the Wi-Fi so it is a very useful project so without any further delay let's get started these are the required components for this project now you have to connect all these components as per the circuit diagram in the circuit I have given the 5 volt DC Supply and here I have used active low relay module so for the low signal the relay will turn on as you can see the circuit is very simple you can easily make it without using any PCB but just to make the circuit compact I have designed a PCB for this project and order it from the jlc PC in jlc PCB you can also use their PCB assembly service absolutely free recently I have used their PCB assembly service after making the circuit you can easily convert the circuit into a PCB now to use their PCB assembly service you have to generate three file you have to generate the PCB Java file then bom file and at last weekend Place file then visit the jlc PCB you can find a link in the description then I will click on this quote Now button then you have to upload the Gaba file after that I will scroll down now I want all the components should be shouldered on the top side of the PCB so I will select this now I have to upload the bom file and pick and place file so here you have to confirm all the component that you want to use for the smt service so you can see they are showing approx footprint and you will get all the details here after checking all these click on save to card and place the order and in my case I have received this PCB from from jlc PCB within a week and as you can see the packing is really good and also the quality is very premium in this affordable price for this project you can use both the PCB here I have used smt components you can download the Gaba file and other required details from the description let me connect the esp32 on this PCB and here I have to connect the IR receiver now let me connect it with the laptop these are the source codes for this project to download the codes first visit our website iot circuit hub.com you will get the article Link in the description then you can download the code from these buttons after that I will open this code for the switch so in this code first you have to download the esp32 board and all the required libraries then this is the pop or proof of position or it is like a pin and this is the device name so this device name should start with Prov you can get the details here and this is the PIN so these two details required when you try to enter the Wi-Fi credential through the mobile app and I have make these variable false as I don't want to delete the Wi-Fi details after resetting the esp32 so I make it false after that here you have to enter the device name here I have used four relay so I have entered phone name you can give any name as per your requirement and if you want to control the appliance with IR remote then you have to update the hex code of your IR remote and if you are not using any IR remote then keep it as it is then these are the gpio pins I use for the relays and switches and to reset the Wi-Fi credential I have used the boot Button so here I mentioned gpio 0 before scrolling down let me go to file example and from here you will get this wi-fi probe open this example code with the help of this example code you can easily enter the Wi-Fi credential through the expressive mobile app so here you can see again this pop and service name is here which I have just shown then there is one function which indicates whether it is connected with the Wi-Fi or it is disconnected or what is the current state so again I have copied this function then in the setup you will find this block of code again I have copied this here you can see this is the function is here in the example code uh just copied the function in the main code from that example code let me show you so here you can see this is the function I have copied from the example code then in the void setup again I have copied this piece of code from that example code so so after copying this block of code now I can able to change the Wi-Fi credential from the mobile app I don't have to hard code any Wi-Fi details in the code and then in the loop we are just checking whether it is connected with the Wi-Fi or not if it is not connected we are turning off the Wi-Fi LED otherwise we will turning on the Wi-Fi LED and if the add device flag is false we will add the device we'll call this function otherwise we will just call ESP Alexa dot Loop function and again here you can see I am calling this function to reset the Wi-Fi details let me go to that function in this function we are just checking if the boot button is pressed we have already shown this indicates gpio 0 so if you press the boot Button more than 5 second then it will call this function to reset the Wi-Fi details which we will see later on so in this code you just have to change change this name and this hex code after doing that go to tools select the board ESP module and in the partition scheme you have to select huge app 3MB and then select the proper Port then hit the upload button after uploading the code I will open the serial monitor then select the broad rate 115200 then I will press the reset button of the microcontroller so here we will get the QR code but I cannot scan it from here so I will just copy the QR code then paste it in notepad plus plus you can use any other ID now I can scan the QR code from the expressive app now here you can see no blue LED is glowing so it is not connected with any Wi-Fi Now we will download the ESP ble app so I will go to Google Play Store and search ESP ble provisioning then I have already downloaded it I will just open it then I have to turn on the Bluetooth and location on your mobile phone on the mobile phone then I will click on here then scan the QR code from the notepad plus plus then I have to enter the Wi-Fi credential so I want to connect this wi-fi so I will tap on it then enter the Wi-Fi password then click on provision so here you can see now the blue LED is glowing we have successfully entered the Wi-Fi credential in the esp32 I will click on ok now you have to add the devices in the Amazon Alexa app and here you can see this blue LED is glowing which indicates now it is connected with the Wi-Fi during this step the echo Dot esp32 and your mobile app should be connected with the same Wi-Fi network now let me open the Amazon Alexa app then I will go to device then tap on this plus icon select add device then select light then here I have to select other then tap on Wi-Fi then tap on discover devices now it will take some time so here you can see four devices found and connected so if I tap on next so these are the device we have given this name in the code so you can either set up devices one by one or you can skip it now I will go to lights and here you will find all the device added now let me turn on some appliances from the Amazon Alexa app you can see the relay turned on now what I will do I will turn on the mobile data and turn off the Wi-Fi from the mobile as the device already added so I can control this relays from any other network from the mobile app so let me turn on the room light can see room light turns on let me turn on the studio light you can see it is turned on only the esp32 and Echo dot must be connected with the same Wi-Fi network but you can control the appliance from different network from the Amazon Alexa app now again if I want to change the Wi-Fi credential in the esp32 I have to connect it with the laptop let me connect it with the laptop then here you can see it is connected to the Wi-Fi but I want to change the Wi-Fi details so I will open the serial monitor select the broad red 115200 then I'll press the boot Button for 5 Second so here you can see reset button pressed and again I received the QR code on the serial monitor I will just copy it and paste it in a notepad plus plus or it or you can use any other ID then I will open the ESP ble probe app then scan the QR code and here you can see the blue LED is not glowing so it is in setup mode so from this menu I can select the Wi-Fi name so again I am selecting this name then enter the Wi-Fi password then tap on provision and in this way again I have updated the Wi-Fi details into esp32 so I hope after watching this video you can Implement these features to any other iot platform please let me know if you have any question if you find this video 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
Info
Channel: Tech StudyCell
Views: 15,610
Rating: undefined out of 5
Keywords: esp32, home automation, Alexa, iot, esp32 alexa, espalexa, iot based projects, alexa home automation, wifiprov, wifi provisioning, amazon echo home automation, esp32 projects, esp ble provisioning, esp32 alexa control, amazon alexa app, iot projects, internet of things, esp32 home automation, alexa esp32, iotproject, alexa automation, homeautomation, smart home, alexa with esp32, smart home automation, home automation system, amazon echo dot, amazon alexa, projects, TechStudyCell
Id: xTcsIIKROI4
Channel Id: undefined
Length: 12min 32sec (752 seconds)
Published: Sat Aug 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.