With your Alexa/ Voice Service (AVS) enabled device, you can create Alexa skills that let's you interact with hardware devices, such as reading sensor data or activating a relay, all with the command of your voice!
An Alexa skill converts spoken commands into computing functions, which are defined as an Amazon Web Services (AWS)* Lambda. The computing functions can be used to communicate with your IoT device using AWS IoT features.
- AVS Device (Rasberry Pi* + Intel® Speech Enabling Developer Kit)
- Sensors/Actuators (Arduino 101* (branded Genuino 101* outside the U.S.) + Grove* Starter Kit)
- Alexa Voice Service (brings voice capabilities to your device)
- Alexa Skills Kit (defines the voice interaction model e.g. intents & utterances)
- AWS Lambda (compute functions that execute on defined voice commands)
- AWS* IoT (provides channel to communicate with your IoT device)
- MRAA/UPM (hardware abstraction library for reading/writing to sensors/actuators)
- Follow this tutorial to setup your Intel® Speech Enabling Developer Kit with AVS.
- Plug in an Arduino 101 to your main computer and upload the StandardFirmata sketch.
- Attach a Grove Shield to the Arduino 101:
- Attach a temperature sensor to the A0 port.
- Attach an LED to the D4 port (can also be a relay).
- Plug the Arduino 101 into your Raspberry Pi running AVS.
- Install MRAA & UPM:
npm install -g mraa
npm install -g jsupm_grove
- Note: Make sure you have all dependencies are resolved, such as node-gyp, nodejs-dev, build-essential. etc.
- Identify the serial port where the Arduino 101 is connected (usually /dev/ttyACM0).
- Try some MRAA/UPM code samples to make sure you are able to interact with the Arduino 101.
- We want to send temperature data to AWS IoT so our Lambda function can access it. First, we need to create a new AWS IoT 'Thing'. Follow this tutorial for details.
- With the newly created 'Thing', copy over the certificates and keys to your Raspberry Pi.
- Run '/iot/index.js' and check on the AWS IoT dashboard to ensure the data is being updated.
- Go to to create a new Alexa Skill.
- Fill in the Interaction Model details with the data under
/skill/
e.g. IntentSchema.json, SampleUtterances, Slots. - Save your progress and resume later. You can complete the rest of the configuration after you've created a Lambda endpoint.
- Create a new Lambda function
- Select 'Alexa Skills Kit' as a trigger.
- Upload the Lambda function code:
- Under
/lambda
runnpm install
to install the node_modules. - Zip all the files by running
npm run zip
- Upload the output file
index.zip
to your Lambda and save.
- Under
- Test your Lambda with the Alexa Skill with the Service Simulator e.g. Enter "What's the Temperature" as an example utterance.
- Start the data collection script
node /iot/index.js
- Start your skill by saying 'Alexa, open NAME_OF_SKILL'
- Ask it "What's the temperature?" to get the temperature sensor data.
- Say "Turn On" to turn on the connected LED.
- Enjoy!
- Ensure your security policies have the right permissions.
- Enable AWSIoTFullAccess for your Lambda Execution Role.