In this project I make a smart speaker with Alexa built in (Raspberry Pi 3), and an IoT RGB lamp, which connects to the internet. I use speaker to get feedback from Alexa.
We can use Alexa to change the lamp's brightness and color using Philip hue commands:
1. Setting Hue Scenes
Turn on {scene}. For example: Turn on Relax
Scene: sunset, pencils, Deep sea, Kathy, Beach, Sky, Feet up, Blue rain.
2. Color Commands
Change the colors of bulb or rooms using these commands:
- Turn on/off {specific light}
- Set {light} to fifty percent
- Turn my {light} light green.
- Brighten to 60 percent or dim the lights.
This is sample color list (we can expand it easily using color code table):
- "Turn the lights Tomato" – a nice shade of pink (#FF6347)
- "Turn the lights Peru" – nice at-home champagne color (#CD853F)
- "Turn the lights Firebrick" – A dark red warm color scene (#B22222 )
- "Turn the lights Light Salmon" – A warm light pinky red color (#FFA07A)
- "Turn the lights Dark Khaki" – A dark green color (#BDB76B)
All color and scenes are preset. Creating and editing theme will be supported later.
The point is making affordable IoT devices. That's why I used Raspberry Pi 3 (so that I can reuse it later), cheap Arduino mini board and module ESP8266 (ESP-01). Thanks to Amazon for free AWS.
Using Arduino allows easily adding features like some sensors if needed.
How to MakeStep 1: Install Alexa on Raspberry Pi 3:
Follow the instruction here. There are many errors when I tried to install Alexa. After install sample application in my Raspberry Pi, Alexa returns no sound, here is the resolution for me. I hope it can help someone save time.
Step 2: Create a Smart Home Skill and Connected Lambda:
Follow the instruction here. But Alexa couldn't find devices: Alexa smart home discovery is not working. I spent a day to configure out. It was region problem. This is resolution.
Step 3: Create an IoT Thing, Connect your Lambda to your Thing:
You can follow these steps. More information here.
Step 4: Set up your ESP8266 and Arduino mini.
I use Arduino mini + ULN2003A to drive LED. +12V power is required for LEDs, so I put an DC-DC converter to get 3.3V for Arduino and ESP8266 module and put a 470uF tantalum capacitor. I used my CP210x USB-TTL converter to program both ESP8266 and Arduino.
Here are ESP8266 instructions.
Comments