The best tools to make your project dreams come true

Login or Signup

By Team

A Better Understanding the Google Assistant and Nordic Thingy

A Better Understanding the Google Assistant and Nordic Thingy

This project makes use of the Google Voice Hat and a Nordic Thingy to help you to better understand how the two products interact with the Raspberry Pi 3 B+.

The first issue at hand is to replace the fragile cardboard case that comes with the Voice Hat with a strong wooden case. This is essential for when the family cat tests gravity by knocking the device off of whatever surface it is sitting on. The case is designed with extra internal and external space to accommodate a battery pack to make the device completely wireless.

Wooden Case
Wooden Case holds Raspberry Pi, Speaker, Microphone, and Google AIYHat

The case holds the speaker in a horizontal position, elevated above an acoustic cutout. Several mounting holes and cutouts in the side of the case accommodate the Raspberry Pi SD Card, RJ45, and USB access. Power for the Pi is provided via a right-angle micro-usb adapter that connects to the pi inside the case and extends to an external battery pack. There is room inside the case for a battery if you wish to add one.

While painting and raster engraving are optional, vector cuts by a laser in ⅛” baltic-birch plywood or MDF are required to assemble the design.  The speaker and MEMS microphone are connected to the wooden exterior with 1.5mm closed-cell craft foam and spray adhesive.

The cost to laser cut parts is typically quoted by the laser runtime. To decrease the cost of the first prototype, I elected not to do the background pattern engraving. This worked out as I initially located the raspberry pi to close to the top and did not provide enough room for the power entry cable. In the design provided, the pi has been shifted as close to the speaker as possible. That makes attaching power and video cables as easy as possible.

Wooden case shown with optional engraving
Wooden case shown with optional engraving. The cost of raster engraving is this design is decreased with a horizontal alignment. It takes time for the laser to slow and then again reach speed after each line of print. Allowing the laser more time at constant speed and fewer accelerations reduces print time.

To decrease mechanical vibrations that would negatively impact the MEMS microphones, both the speaker and the microphones are isolated from the case with commercially available closed-cell craft foam. The microphone is glued to the foam, which is glued to the case, and the four holes are used for alignment. Avoid contaminating the microphone holes by spraying both sides of the foam away from the microphones, allow the adhesive to become tacky and then use M3x10mm hardware to align the foam, microphone, and case. The hardware can be removed or left in place after the glue dries. Holes made in the case should be between 1.0 mm and 1.5 mm in diameter, and holes in the foam should be ~25% larger. If you use the laser to pierce the foam, drill an undersized hole, as the melting foam will shrink away from the laser beam.

A slightly oversized foam ring is attached
A slightly oversized foam ring is attached with spray adhesive to the bottom speaker panel.

The speaker is bolted to the bottom panel
The speaker is bolted to the bottom panel with M3x10mm hardware. #4-40 hardware should also fit.

These pieces create a retaining fixture
These pieces create a retaining fixture for the M3 nuts. Glue these to the top section with the nuts sandwiched between the top section and the bottom, smaller hole.

After all the parts are laser cut, deburred, and lightly sanded, apply glue to all the joints and assemble. Use tape or rubber bands to hold the pieces together while the glue dries. If you are going to paint the wood, do it prior to the laser engraving. If you pain after the final assembly, you risk fouling the microphone holes.

See the video that accompanies this article if you need help understanding how to assemble the wooden case.

Software Options for the Raspberry Pi

There are two main ways to get the project going quickly. The first method is to download a custom sd card image. The second method is add the software to an already existing installation by following the directions in at the project’s github page.

The project is undergoing continuous improvement and revision and I chose not to duplicate that effort here, but instead will help you understand a few of the commands you are being asked to follow.

Understanding The Commands That You Are Using

sudo apt-get install git’ -- This command uses administrative privileges to install the software package git

  • sudo’: This command escalates a user’s privileges on a linux-based operating system. It is used when updating system software or making changes to protected areas of the system.
  • apt-get install’: apt-get install searches available software repositories for software-packages and installs the software on a local machine. It is always a good idea to run the command ‘apt-get update’ prior to running the ‘apt-get install’ command.
  • Git’: Git is a software package that usually communicates with the website Github is used around the world to create, edit, and maintain software.

git clone AIY-projects-python’

Once git is installed, the command clone creates an exact copy of the aiyprojects-raspbian project in the newly created directory AIY-projects-python

cd ~/AIY-projects-python’ -- This command navigates to the newly created AIY-projects-python folder.

Cd stands for "change directory". It is a terminal command that allows navigation within the current directory structure. It is followed immediately by the directory you want to change to.

‘~/’ is a shortcut for the home directory of the current user -- in this case it stands for the directory location ‘/home/pi’.

source env/bin/activate’

Source is a command that reads and executes the contents of a file in the current environment. There is a file named activate in the subdirectory ~/AIY-projects-python/env/bin. In that file are several variables that create a temporary, specialized environment that is later required to run the AIY program files.

The Google Assistant Library

The Google Assistant Library for the Python programming language is currently in its second alpha release. It will increase in functionality and be rewritten to a point that the google engineers will promote it to the beta stage, and eventually release it for broader use. But for now, it is in a stage where things are bound to change, and a script that you write using the current functions might not work in a week, a month, or a year.

You might be able to do things with a Google Home that you cannot do with your own project right now. Be patient -- these frustrations always happen when you are working with cutting edge technology.

Once you have installed, tested, and have the Raspberry Pi running with the Google Voice Hat, play around or go on to add the Nordic Thingy.

About the Nordic Thingy

The Nordic Thingy houses a full suite of sensors as well as microphone, speaker, and support for IFTTT connectivity through Bluetooth Low Energy. A javascript library from Nordic allows all aspects of the device to be accessed from the Raspberry Pi.

Install Software to run the Nordic Thingy

The Nordic Thingy has a built in microphone and speaker. The speaker in the Thingy is a fraction of the size of the speaker that comes in the Google AIY kit, so do not expect the same sound quality. The Nordic engineers have created their own code that has nothing to do with the AIY project. The Nordic Thingy can be used with the Raspberry Pi whether or not you have the AIY Hat.

Follow the installation guide at the project’s github page. You will see some familiar commands, and some new ones as well. NPM is a software package manager for the javascript programming language.

If you are using the Voice Hat, one thing to keep in mind is around step 9, the instructions ask you to overwrite your sound configuration file (stored in /etc/asound.conf). This will adversely affect the functionality of your voicehat. You might want to create a backup of the file before you overwrite it, you can do this by typing: ‘cp /etc/asound.conf ~/asoundconfAIYHAT.conf’ to restore it later type: ‘sudo cp ~/asoundconfAIYHAT.conf /etc/asound.conf’

Key Parts and Components

Add all Digi-Key Parts to Cart
  • 1490-1061-ND