How to do Simple Home Automation with Amazon Alexa || ESP8266

The following is the content of an article:

Controlling Micro-Controller Output with Alexa

If you own an Amazon Fire tablet like me or one of the other Amazon devices that are not definitely not surveillance gadgets, then you might be familiar with Alexa. It's an intelligent personal assistant developed by Amazon, which you can interact with verbally to set a timer, hear a funny joke, or control home automation.

In this video, I will present you a simple way on how to control a micro-controller output with Alexa. This allows us, for example, to verbally turn on/off the lights and a corridor.

First things first, we need a microcontroller. I went with the popular ESP8266 since it offers Wi-Fi and is supported by the Arduino IDE once we install its library through the boards manager.

Additionally, we need an electrically controllable switch which should be some kind of relay because I want to let us switch mains voltage with it. While we are at it, we should probably add a voltage regulator circuit for the microcontroller and a transistor will flyback diode for the relay. But before I overcomplicate this project too much. Let's rather order one of those ESP8266 Relay Board. It got everything we need for those projects.

A voltage regulation circuit, A Relay with transistor and diodes as well as slots between its high voltage traces PCB terminals and even an Optocoupler Input as a bonus. If you want more details about the board then definitely check out microcontroller experiments article about it which offers tons of useful information.

For our application though. We only need to know the GPIO pin four of the esp8266 Is connected to the base of the relay transistor. Which means by pulling it high it activates the relay and by pulling it low it deactivates the relay. Which is also indicated by an onboard led. This way the change over contact of the relay which are connected to the upper three PCB terminals can be used to connect our appliance to mains voltage.

To reprogram the microcontroller though. I sold at male headers to all the five solder pads in the down left corner of the PCB then I grabbed a USB to serial converter set to 3.3 volts and Connected its TX pin to RX, RX to TX and ground to ground. Afterwards, I shorted the lower two pins with a jumper and connected the boards to a power supply set to at least 7 volts.

With that been done it was time to program. Since I'm terrible at that. I rather try to utilize the FouxmoESP codes. Which basically emulates a Belkin WeMo device and thus lets you control the ESP8266 through Alexa so after editing the provided example codes Choosing the right upload options and uploading the codes.

I then remove the jumper, restart the boards, and realize that no matter how often I search for the device with the alexa software it never found it. There seems to be lots of problems with incompatible libraries in alexa updates. So I ditched that idea and instead went with a bulletproof method provided by Kakopappao papa.

Firstly I had to create an account on Sinric, which is an IOT site that can connect all kinds of boards with Alexa. Then I added a smart home device to my system.

I still hope that this example gave you lots of ideas on how to utilize Alexa and an esp8266 in order to control all kinds of things, but please handle mains voltage with care.

As always thanks for watching. If you enjoyed the video then don't forget to Like share and subscribe Stay creative and I will see you next time