Introduction: Control the Balance Maze With Alexa
Control the balance maze with Alexa
Move the maze by voice.
First of all, please see the video.
It is a summary of operation.
- Talk to Alexa (Raspberry Pi + AVS)
SAY: Alexa - Start Skill
SAY: BARANSU MEIRO WO KIDOU SHITE - Instruct Skill
SAY: 1 DO, UE NI SHITE - Skill communicates with Raspberry Pi and throws a command
- Raspberry Pi moves servo motor
I will explain how to make it.
Step 1: Prepare Amazon Echo
Let's buy Amazon Echo.
As of January 2018, Amazon echo can not be obtained due to limited sale in Japan.
Therefore, I created an Alexa device using Raspberry Pi.
https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry-Pi
Step 2: Skill Settings
Set up a custom Skill.
1. Create Skills with Alexa Skills Kit
Amazon Alexa Skills Kit
https://developer.amazon.com/ja/docs/ask-overviews/build-skills-with-the-alexa-skills-kit.html
Define four intents and one slot.
2. Custom Skill on IBM Cloud
You can use it for free by using the light account.
https://www.ibm.com/cloud/lite-account
1) Configure Node-RED on the IBM Cloud.
https://nodered.org/docs/platforms/bluemix
2) Install (copy & paste) the flow.
Attachments
Step 3: Hardware Preparation
Create a maze game.
1. Servo and servo folder
Servo uses Tower-pro SG90. Please refer to the URL for details. 3D data can also be downloaded.
https://www.thingiverse.com/thing:746116
2. Maze game (light stuff, made with styrene board)
3. Ball (Light stuff)
4. Raspberry Pi (using Raspberry Pi 3B)
Step 4: Connection
Connect the servo to the Raspberry Pi.
1. Align the direction of the servo.
Connect the upper line to GPIO 12 (32 PIN).
Connect the lower line to GPIO 18 (12 PIN).
2. LED that glows when Skill is activated
Connect an LED with 200 Ω to 330 Ω on the anode. GPIO04(7 PIN)
Connect Graund(9 PIN)
Step 5: Setting Up Raspberry Pi
Install the software on the Raspberry Pi.
1. GPIO
Chattering is done with Rpi.GPIO installed in the standard.
Therefore, I will install pi-gpiod.
This is because the PWM output is stable.
Installation method
sudo apt-get install pigpio python-pigpio python3-pigpio
http://abyz.me.uk/rpi/pigpio/index.html
Start the daemon
sudo pigpiod
2. Node-RED
Install the library for pi-gpiod.
https://flows.nodered.org/node/node-red-node-pi-gpiod
Install the dashboard library for debugging.
https://flows.nodered.org/node/node-red-dashboard
3. Creating flow Please import (Copy & Paste) the following files to Node-RED.
Deploy when you can copy normally.
Attachments
Step 6: I Will Talk to You
Please pronounce to Alexa.
1. Speak as "Alexa, activate the balance maze".
When the skill is activated, the LED turns on.
2. You are in dialog mode and you can talk without saying a wake word.
3. Speak as "Once you speak up", the maze moves in the specified direction.
4. Speak as "Stop", maze stop.
Happy instructables.