Home Automation with IOT (using Google Assistant)

Lakshyajit Laxmikant
5 min readDec 23, 2018
Home automation

Well, the first week of December marked the end of my 7th semester in engineering and with that, I also completed my Minor Project, which is of course a part of our course curriculum. It was a project which aimed to control different home appliances (lights, fans, ACs, etc) through google assistant along with plotting real time temperature and humidity data on Blynk App. For display and simplicity purposes (since configuring real life equipments like led tubelights, or even air conditioners would require connecting relays to switch boards), this project was implemented by connecting an LED along with a 9V fan. This article contains a brief overview of the implementation.

Apparatus Used:

NodeMCU( wifi module), DHT11( temperature and humidity sensor), LED, Fan ( 9V), Connecting wires, a registor and a transistor.

Detailed process of execution:

  1. The nodeMCU was connected to the laptop which acted as a platform to push the code as well as a power source.
  2. The Arduino IDE was used to program the nodemcu with the help of the header files for Blynk and DHT11(Temperature and humidity Sensor)
  3. An Led and a fan was also connected to the nodemcu.
  4. The fan was given a power source with the help of a 9V battery which in turn was connected to the nodeMCU through a transistor ( which acted as a switch ) and the LED was given power source from the nodeMCU itself.
  5. Following is the idea of the circuit connection used:
Rough Circuit Configuration

6. After that the Blynk App was downloaded from google playstore. It helps to plot real time data from DHT11 sensor (also from various other sensors) and to assign buttons for the required pins from nodemcu.

The Blynk App

7. A new project was started on the app, which then sent a auth token to our registered email. There were different buttons and gauges available to configure devices through blynk app. Two buttons, two gauges and a graph module were brought in and configured.

Auth token from Blynk App ( to be used in the code inside arduino IDE)

8. One button was configured for the LED and another for the Fan by assigning the respective pins from nodeMCU.

9. Out of the two gauges one was configured for temperature and another for humidity. They were given the respective units of measurement. (Celsius for temperature and % for humidity). After that an email push notification module was brought in, which helps us to send an email, when the temperature exceeds a certain value.

10. The graph module was configured to match the temperature gauge ( coloured red ) and the humidity gauge ( coloured blue )

11. The app was then run by clicking on the play button on the top right corner and the LED and Fan were controlled using the push buttons. By holding the DHT11 sensor lightly we were successfully able to produce a variation in temperature and humidity values which was evident from the live graph obtained.

Real time Temperature and Humidity Plot

12. To control the LED and Fan through Google assistant we signed up on the IFTTT(If This Then That) website.

13. After signing up, we created a new applet with google assistant and configured it for the ON/OFF commands. For each applet we created a webhook, which would trigger the google assistant to control our project as soon as we tell them to the assistant. These webhooks needed a URL which was of the form:

http://188.166.206.43/84053d3d6f3241a78aee100cf1ac7d1a/update/D13.

Here 188.166.206.43 represents the IP Address for Blynk apps in India. After that the number 84053d3d6f3241a78aee100cf1ac7d1a is our blynk auth token which we received on our mail when we created a project on blynk. It helps the assistant to uniquely identify our project. The update query in the URL, as the name suggests, represents an update command in our app. The last part of the URL (D13 in the above case) represents the respective pin number for Arduino (As each pin in case of nodemcu maps to a particular pin in arduino, that’s how the blynk app functions, it assumes that it’s sending data to an arduino).

14. Following picture depicts the cofiguration on the IFTTT website.

15. Following is the code which was uploaded to the nodeMCU.

So this concludes the description of the project. If you liked it, don’t forget to give it some claps! and share it with your friends too :-)

--

--

Lakshyajit Laxmikant

A tech-geek, curious creature, willing to learn new technologies to build interesting and intelligent systems...