Without some form of feedback, it is impossible to know whether the speaker is listening or not, and whether your command worked! So, we wanted to add both sounds and some LEDs to reflect that confirmation from spkr to the user. For the LEDs, there are multiple options available. The simplest is to hook up some LEDs to the GPIO pins of the Raspberry Pi. There is a built in framework for command of the pins in Python, and we had this running within a few hours.
While this gave us some fun results, we wanted more LEDs (they are limited to 8 on the GPIO). So we choose to go withe a NeoPixel ring controlled by an Arduino. The ring we used has far more lights, and has a great deal of expressivity even without the same intricacy of animations.
a. Configure the Arduino and the NeoPixel ring
We made a library to use the arduino micro as an actuator of the Raspberry Pi here are the steps to configure it:
You install the Arduino IDE (here) it will help you upload the code into the Arduino.
Clone/Download the Neopixel Ring library into the Arduino library folder.
Clone/Download our Snips_lights library into the same Arduino library folder
Open the Snips_lights library example called Home.ino
Plug your Arduino Micro and upload the exemple via the Arduino IDE.
b. The sound library
In order to communicate the state of the speaker to the user, such as “started listening” or “error”, we wanted to play some custom sounds, without disrupting the music. We explored various text-to-speech solutions, and found some very impressive offerings, all of which were too expensive. Instead, we found some royalty-free sounds, similar to those made by R2-D2, that communicated the state well enough. And that, of course — was cool!