book collections email follower instructable user
Picture of Voice Controlled Smart Home

Hi everyone, The Internet of Voice has come and now you can monitor and control all various devices in your home by using your voice, Amazing!!! Amazon Alexa and Raspberry Pi made the thing supper easy and now every hobbyist can enter in the era of hands-free home control using Alexa Voice Service.

Project Demo

Getting started with a voice controlled smart home is easier than you might think, and it won’t cost you much money either. You just need a Raspberry Pi with Alexa Voice Service. In this project I will give you complete instruction to convert the dream to reality. I made the project to control 4 appliances and I used a Raspberry Pi to do this. Single Raspberry Pi is used for dual purpose. It is serving as a Alexa Voice Client and Paho MQTT client at the same time. You may use Amazon ECHO device for Alexa Voice Service. If you do so then you can escape first two steps (STEP 1 & STEP 2). For voice interface you will be required Alexa custom voice skill. Don't worried, making Alexa custom voice skill is very easy.

I hope you already watched demo video of my project. If you like it let's start making it. For easy understanding I divided full project documentation into several steps. Follow step by step, I think you will enjoy it. If you have Amazon Echo device and want to use that ignore first two steps.

All necessary files & source code for the project are available here.

Task involved in this project:

1. To run the system you will be required an Alexa Voice Enable device like Amazon Echo or Echo Dot. But good news is that your Raspberry Pi can be used as Amazon Echo! In first two steps I will show you how to setup Raspberry Pi as Alexa Voice Client (Amazon Echo).

2. You will be required a custom voice skill which can understand your own voice command to do a specific task. In step 7 I will explain how to prepare your own Alexa custom voice skill. To make a custom voice skill Lambda is required. Lambda is a platform which can store and run your own code from server. You just need to upload your source code and dependencies. The source code run by lambda is called Lambda function. A Lambda function can be trigger from different source like Alexa Voice Service in our case. In step 6 & 8 I will show you how you can make a Lambda function.

3. To control any device from remote location IoT cloud service is required. I used AWS IoT for my project and in step 5 I will show you how to prepare AWS IoT. Any other IoT cloud service support MQTT with SSL may be used for the project. According to your voice command defined in your skill Lambda function will be executed and send a specific message into IoT cloud.

4. You need to receive message containing control information for your device from the IoT cloud. AWS IoT support MQTT protocol and I used this for my project. To communicate with IoT cloud using MQTT protocol a MQTT client is required. Cloud works as MQTT broker. In step 9 I will show you how you can set up an MQTT client program into your Raspberry Pi so that Pi can communicate and receive MQTT message from AWS IoT server.

You can get a clear understanding how the system works from the following figure.

5. Your hardware and devices must be connected to this Pi installed with MQTT client program. When any new MQTT message is arrived, it is received by the client Pi and control the devices according to the receive message and a python program developed for the system.

Step 1: Hardware components:

Picture of Hardware components:

1. Amazon Echo or Echo Dot (

2. Raspberry Pi 2 or 3 with Raspbian OS (Seeedstudio)

3. Raspberry Pi compatible WiFi module (

3. Relay Module (Seeedstudio)

4. Light & Fan

5. Wires

I am using arduino uno, hc05 and rchannel relay module can u plss send me sketch for voice control