Introduction: How to Control Light/Home Lights Using Arduino and Amazon Alexa
I have explained how to control light which is connected to UNO and controlled by Alexa.
Step 1: Components Used
HARDWARE USED
- Arduino UNO & Genuino UNO
- Resistor 221 ohm
- LED (generic)
- Raspberry Pi 3 Model B
SOFTWARE REQUIRED
- Arduino IDE
Amazon Alexa Alexa Skills Kit
Step 2: Setting Up Raspberry Pi & Arduino IDE
1.First install binaries
sudo apt-get install python-pip
pip install flask
pip install flask-ask
sudo apt-get install pyserial
sudo apt-get intall libpython2.7-dev
2. Installing Arduino IDE on RPi
To install Arduino in RPi
1. Go to official site and download previous release. https://www.arduino.cc/en/Main/OldSoftwareRelease...
After that unzip it and go to directory of arduino and start it with ./arduino
Step 3: Upload Program
After uploading program,open serial terminal.
When you write N led will turn on.
When you write F led will turn off.
Attachments
Step 4: Make a Python Script
Run it using python lighcontrol.py
Attachments
Step 5: Download Ngrok
Ngrok is secure tunneling platform to make your device online. With this platform you can make your web application or any application goes online with a very simple way. For download go to official site and download for ARM.
Unzip it and go to directory where you extract it. Run it using command
./ngrok http 5000
Step 6: Setting Up Alexa
1. Login to Amazon account.If you have an account then login it, if not signup there and login.
2. Go to Developer Console on top right side.
Step 7: Go to Alexa ==> Alexa Skill Kit ==> Add New Skill
You will see page like this. On this page it will ask skill type,
name, language and invocation name .You can give any name, in invocation name you have to give name which you say while giving command to Alexa.
Please note select appropriate language which is used in you country if you select different language while creating skill. It will not work.
At the end update it ,save it and press next.
Step 8:
Step 9:
On next page, it will ask intents.An intent represents an action that fulfills a user’s spoken request. For more information
https://developer.amazon.com/docs/custom-skills/de...
If there is any error you will see in red color.
Write below code in the box
{
"intents": [
{
"intent": "LightOn"
},
{
"intent": "LightOff"
} ]
}
save it and move to next page.
Step 10: On Next Page It Will Ask Two Option for End Point One Is AWS and HTTPS
Select HTTPS & save it and move to next page.
Step 11: For SSL Certificate Choose Second Option. Save It and Move to Next Page.
Step 12: Checking Service "on"
To test whether service is working or not . Make sure your Ngrok server is working and Python script also running otherwise it will not work.
You can see servers are getting request and post it.
Step 13: Servers Getting Requests
Step 14: Requested Are Posted
Step 15: Schematics Arduino
Step 16: Schematics LED
Hope you all like it.

Participated in the
Raspberry Pi Contest 2017

Participated in the
Arduino Contest 2017

Participated in the
Remote Control Contest 2017
7 Comments
5 years ago
i have come across very much difficult alexa project.
your project is so much i have ever seen.
i am gonna try this...
Reply 5 years ago
Thank you appreciate it.
5 years ago
I am going to do this project.
Reply 5 years ago
Good
Reply 5 years ago
Thank you very much. Please let me know for any queries. And do vote if you liked it..
Reply 5 years ago
in python script what is 6th line.
where it will be save.?
Reply 5 years ago
It is the port address from where the data will be transfer and also the 9600 describes the baud rate.
do let me know for your queries if found any.