By vivek | July 8, 2017 | 0 Comment
This is one of my favorite projects. I was successfully able to control my RGB led using google home. I used esp8266 for controlling the LED strip. Recently I got one google home. I already have an echo and echo dot at my home. And I love making skills for them. But Google home was new to me. As soon as I got Google home, I started playing with it.
I fell in love with it 🙂 . I already had controlled my RGB led strip mounted to my ceiling using Amazon echo. But hey, who doesn’t wants to control his home with Google home 🙂 . To be honest, there is almost no example of doing such thing.
Since I used esp8266 with arduino along with an IR led to send signal to my led strip, I had to write the code for everything from scratch. Just figuring out the process was bit tricky. So I created a circuit with arduino pro mini, esp8266, ir led and other discrete components on breadboard(disclosure : I love breadboard. Check out my tutorial on 8051 microcontroller).
I wrote a php api that will give color name in json format. My esp8266 was polling from the api for getting the updated color. And again I wrote update api, which will update the color name which was done by my Google home when it received instructions from me.
I bought the LED Strip and remote from amazon which is generic china made led. Here is the receiver of the same:
After making the above breadboard circuit, the first things which I did was to use TSOP1738 and receive the signals coming out from LED remote. I used this library for that : https://github.com/z3t0/Arduino-IRremote
I recorded and copied the signals coming out from remote after pressing each button and made functions like red, blue etc . In these functions, I put my IR send code. If my esp8266 gets “red” keyword from my api then it will send the signal “red” cloned from remote to my led strip receiver. I created these functions for all the codes.
Now, after this I had to make a project in api.ai, create intents and utterances for what user might say, and what intent it would mean. After that I created webhook in heroku, so if any intent is identified, my python code in heroku will then take the actions defined in the intent. Lets say for example : if the user says “turn on red color”, then the intent will be “red” and the action will be to go the update api and set the color to red via get request.
Check my blog post here where I integrated google home with tensorflow.
Hope, you liked my project. Cheers!