This project is a simple and primary example of home automation using NodeMCU and Google Assistant, through activated voice. I am a linguist and I am very interested in any project with which language has an active role in. My intention has been to learn programming, while learning the ways in which various technological tools, aplatforms, apps etc. are connected and work together in an IoT environment. This project has two aims that tried to be completed in four steps. If everything works well while performing this project, it can take some time between 4 to 8 hours to complete this project. However, such a thing did not happen in my case. I encountered a few problems that made me spent a few days on this project. The steps that were taken and the problems that occured during this project, are explained in greater detail below. Below is a diagram of the whole project. The method, coding and the process were learned and duplicated from instructables.com and arduino.cc. (and when I was finished with everything and wanted to upload, I saw that there is almost the same project on the course room instructions!)
The reason to choose this project as mentioned above was its highly relevance to language and language use. Voice automated home appliances are becoming more and more popular and advanced and from very simple appliances such as the one in this project to very advanced ones are becoming a part of everyday life nowadays. My main purpose is to try to learn and perform more advanced appliances, which can bring more fun and joy to my own life and maybe even the lives of others.
list of materials:
I bought a few of them online from Findiq and m.nu, and a few of them from Kjell & Company. Since my basic intention was to make a voice activated project, first I wanted to use Raspberry pi, but I was advised by the TAs to go for something less complicated. So I decided to start with an Arduino, and the simplest Arduino product (as a wifi module) was Nodemcu, which is a bit easier to program and work with, and also looks simpler for a starting project. It is a well designed device that can be programmed with Arduino IDE, in which the instructions needed are simply described.
I used Arduino IDE for programming. For this project there were few steps taken as the bellow:
Below is the circuit diagram of the project.
The voltage that can be used for Nodemcu is 12 and the diodes are also 12 volt each, with a built in resistor. Below is how it looks when assembled.
I need to mention that as it is shown in the picture both of the diodes are red, these were what I had already bought. So I differentiated them by using different wire connections, in which the one that is connected with a green wire is identified as the green LED.
The platforms that were used are Blynk (app and cloud), google assistant and IFTTT cloud, which are connected as shown in the first picture above. Google assistant was my first choice, as I wanted to do a project on home automation. Then through the project I got familiar with Blynk and IFTTT.
All the lines and codes that are presented here, had to be added, in order to connect Nodemcu and Blynk together through Arduino IDE. The first two lines are the libraries belonging to the two parties. Then there is the code from the Blynk project that was created, and internet information. The rest of the links are for the operation, i.e. what to run and in what order.
The data is communicated through wifi. The means to communicate are Blynk app, IFTTT and Google Assistant. Webhook was also used as the transport protocol. As it was mentioned earlier, the project has two aims, first to turn the lights (LEDs) from your phone using the Blynk app, and the second aim was to do the same thing by voice command through Google Assistant. The first aim of the project was fulfilled successfully. But because of a very small problem, unfortunately the second aim was not fulfilled. So the basic part of this Iot project is done and will be shown through a video. Yet, here is what happened with the more advanced level of this project:
For activating the sound command, the platform is IFTTT, which is the abbreviation for "IF This Then That", and this is how the commands are created through IFTTT.com: Google Assistant is chosen, a command such as "Turn the red light on" is written, then webhooks is chosen to transform the command through internet to Nodemcu. Here you need to add a Blynk URL for Sweden, and as much as I searched I was not able to find that, I could find the URLs for India or Russia, but not Sweden. However, I have asked for it through a website and most probably will receive it soon. Here is the problem that occured:
The dashboard is presented above in the assembled picture. The data for the manual application i.e turning on/off from the phone, is permanently saved, unless it is changed. The data in IFTTT has the same situation. However, the data on google assistant is transformed every time the command is made and will not be saved.
I will upload a video presenting the way the project works. It was a pity that just because of a link, the second part of the project did not work (although the programming and everything worked pretty well). My aim is to solve this problem and try to go for more complicated voice commands, as my main interest is language.