Introduction: COVID-19 Inspired Voice Controlled Home Automation

About: An avionics engineer by profession. I am a huge DIY freak and my proudest possessions are my tools. Since 2016, I have been interested in Arduino and using them to simplify / automate stuff that can be used …

Over the last 4 years or so, I have tried 3 or 4 different variations of Arduino based home controls. For everyone's convenience here is the chronological history of some of my developments.

Instructable 1 - in October 2015 used IR and RF communication technology to control lights and fans in rooms

Instructable 2 - September 2016 was the next logical step to try and use bluetooth to control the lights and fans in the room

Instructable 3 - October 2016 This instructable (featured on this site) and was the next step there I combined RF and IR communication and made it controllable through an Android app using voice

While it was exciting to achieve that in my early days with Arduino and on instructables.com, this design posed a limitation in that one had to be in the vicinity of the arduino controller with the correct app on an android phone to control the lights and fans by voice.

Naturally the next thing to do was to try and make something I could control over the internet. For me that was entering a new level of IOT automation something that I had not tried earlier. This would mean I would have to try controlling utilities using the Wi-Fi technology and so there was something new in there to learn.

That led me to making this instructable.

Step 1: Interim Improvements at Home

Before I go any further, I think its important to mention that I live in an 85 year old house and for the longest time, we had only a single phase supply from the utility services. This had a severe drawback in that we could not operate more than one air conditioner and other heavy equipment.

Therefore, three years back in 2017, I had that changed to ensure we got three phase supplies. When I got the wiring done by a professional wire man, I also made a provision to include an additional box beneath the main distribution box to cater for a certain automation in the future.

I had also set up a small solar panel cluster up on my own and connected it to my solar inverter which I wrote an instructable about it.

Now, I also added one more 100 watt solar panel taking the total capacity up to 400 (see picture) watts and also relocated and enhanced the structure with a bit of fabrication work with GI members.

I intend to increase further to a 1Kw set up over the next 4 - 6 months.

Step 2: Components Required:

This was when the COVID-19 pandemic happenned and it had us all locked down at home for nearly 3 weeks. With a number of Arduino bits and pieces and with two NodeMCU modules handy, I felt that there could be no better time than this to attempt.

Since in my case I have two seperate modules due to certain space and pre-existing wiring constraints, I have had to use two off of certain items. One of the modules is in the bedroom while the other is in the living room.

Essentially for a single set up you would required the following:-

(a) NodeMCU V1.0 module

(b) 4 or 8 relay module

(c) Power Supply

(d) wires and other bits and pieces to mount etc.

Although you do not require it strictly speaking, I found it convenient to use a spare Arduino Uno board (with the ATMEGA chip removed) with a prototype shield strapped on it . It is on this prototype shield that I have mounted the NodeMCU module and so I include in the list of components

(e) Prototype shield.

Perhaps the biggest advantage with this approach was I could power up the arduino uno board through any standard USB plug rather than having to design/ wire up 3.3 volt supplies to the NodeMCU.

(f) Lastly you need an Amazon Alexa or echo dot with an amazon account for this whole thing to work.

One other difference from my earlier instructables is that I have made the effort to solder most of the connections (most - not all) and this ,though a bit more time consuming, I realised made it more reliable. Well that was my approach, you may adapt it as is convenient to you.

Step 3: Connections

Solder the 3.3 volt and ground pins of the NodeMCU to the pins on the prototype shield.

RELAY to NODEMCU

Relay 1 to GPIO 16

Relay 2 to GPIO 5

Relay 3 to GPIO 4

Relay 4 to GPIO 0

Relay 5 to GPIO 2

Relay 6 to GPIO 14

Relay 7 to GPIO 12

Relay 8 to GOIP 13

Make necessary connection to the fans / lights to the eight relays.

Step 4: Sketch

The sketch is as attached. Make sure you have your own www.sinric.com account and mention your

own unique API key, SSID and Password at appropriate places in the code. Also update the deviceID for each of your SINRIC registered devices.

Step 5: Conclusion

It all worked out just fine and now it is indeed great that when I have my air conditioner on at night with the ceiling fan on initially to circulate the air better, when it grows too cold, I no longer have to get up to turn my fan off. I just say "Alexa turn off the bedroom fan" and no matter how late in the night it is she is always there to say Okay and oblige.

That brings me to the end of this instructable. My next step in this home automation journey will be to learn how to develop Alexa skills and add my custom commands and try and reduce speed of a fan or dim a light etc.

As I mentioned before I started wanting to make that but realised I had bitten more than I could chew. Over the next few weeks I am going to learn to chew harder.

Lastly with the COVID-19 pandemic on, I wish all the readers the very best and stay safe !