What is Google Voice Kit?
Google Voice Kit
Using Google Android SDK and Raspberry Pi, Google Voice Kit enables users to create a Google Assistant device from a cardboard box. Google Voice Kit works online perfectly like any Google assistant and it offers more freedom by enabling developers to program their own commands that they can use to control their own special projects.
Mainly, this kit does support "hotword", which means the top button can be pushed each time you need to say a voice command or you can say "Okay Google" or "Hey, Google". After saying "Okay, Google" you can ask the Google Assistant any question you can think of.
What will you need to make a Google Assistant?
Google Voice Kit Components
- Voice HAT accessory board
- Voice HAT microphone board
- Plastic standoffs
- 3” speaker (wires attached)
- Arcade-style push button
- 4-wire button cable
- 5-wire daughter board cable
- External cardboard box
- Internal cardboard frame
Google Voice Kit Usage
The Google voice kit uses online Google Assistant SDK to recognize speech, in addition to and Google Cloud API and an installed Python application which can comprehend and perform offline commands. Eventually the main use og Google Voice Kit is connecting directly to Google Assistant.
Google Voice Kit Assembly
1 Insert the plastic push-in standoffs into the screw holes of Raspberry Pi 3 which are opposite to the 40 pin header.
2 Attach the Google Voice HAT electronic board directly to the Raspberry Pi 40 pin header and to the spacer standoffs on the other side. Press slowly until the header is firmly connected and the spacers snap into the HAT board screw holes.
3 Connect the speakers’ red and black wires to the board.
The board has a blue and black speaker terminatl; blue is “+” for the red wire and black is “-“ for the black wire.
4 You need to screw the wires firmly in place using a Phillips “00” screwdriver.
5 Plug in the button cable, which has 4 wires separated on one end, to the “Button” white connector on the Voice HAT board.
6 Insert the Microhpone cable, which has 5 wires with plugs on both sides, into the small Microphone board.
7 Plug in the other end of the Microphone cable into the “Mic.” white connector on the Voice HAT board.
Folding the Google Voice Kit Cardboard Box
1 Fold the bottom flaps of large cardboard piece, which has holes on its side, by the numbering order 1,2 and 2.
2 After folding flap 4 make sure to tuck it in under flap one. The main box is ready now.
Folding the Google Voice Kit Inner Cardboard Frame
Make sure the SD card is not yet plugged in, or it might break.
1 Find the inner frame cardboard, which is used to hold the hardware, and fold the flaps 1 and 2 inward.
2 Push out the U-shaped cutout flap, which is above the 1 and 2 flaps.
3 Fold down the U-Shaped flap side and fold up the line labeled “Fold Up” so it will rest on your working area.
4 The U-shaped flap should meet box side, and now the inner frame is ready.
5 Slide the speaker into the U-shaped pocket in the inner cardboard frame.
6 Slide the Pi + Voice HAT boards under flaps 1 and 2 and make sure the Pi USB ports are exposed on the side of flap 2.
Google Voice Kit Final Assembly
1 Making sure the hardware is set properly in the inner frame and the speaker is facing the side with holes; slide the inner cardboard frame into the cardboard box.
2 Check that your Raspberry Pi is on the bottom of the box and wire should still be connected.
3 Check that Raspberry Pi ports are facing the correct cardboard bottom openings.
4 Insert the arcade button into the top flip cover of the cardboard box.
5 Screw the big washer on the button from the inside to secure it in place.
6 Connect the separated ends of the button cable, which is connected to the Voice HAT board.
The colors should be in the order indicated in the picture.
7 Check again the order of the button wires, by looking at the crown logo which should be set as in the picture and the wires order is:
- Blue: bottom left
- Red: bottom right
- Black: top right
- White: top left
8 Apply double-sided tape to hold the microphone board in place or you can use normal tape.
9 Stick the microphone board to the cardboard box cover, and keep it aligned with the Mic. holes.
10 Check the top to make sure the microphones are aligned with the two small holes.
11 Close the top cover and the Google Voice Kit cardboard box is ready.
Connecting and Setting Up Google Voice Kit
1 1- Plug in your voice kit according to the image:<
- USB Keyboard
- USB Mouse
- HDMI Monitor
2 Install the Voice Kit SD image from this LINK onto your SD card and then insert it into SD card slot on you Raspberry Pi, which then you should plug in its power supply and wit for it to boot.
3 On the right top corner of the Raspberry Pi desktop, choose your WiFi connection and make sure you have reached the internet.
Checking Your Google Voice Kit is Working
After booting, the red LED on Raspberry Pi near the power connector should be lit.
Checking the Audio
1 Just double-click the Check Audio icon on your desktop the test script will run and test the speaker and Mic.
By playing and recording sound and asking you to confirm the results.
2 Follow along with the test and if the sound is working correctly, you’ll should see a message that says “The audio seems to be working”.
Otherwise, there will be an error message, through which you will know what to adjust and then try the test again.
Checking the WiFi
1 The Check WiFi script tests that your WiFi is configured and working properly.
Just double-click and it will test your internet connection.
2 If the WiFi is working correctly, you’ll see a message that says The WiFi connection seems to be working.
Connecting Google Voice Kit to Google Cloud API Platform
Google Assistant API requires an active Google Cloud Platform (GCP) account with API option enabled.
Open an internet browser using your voice kit Raspberry Pi.
Go to Google Cloud website using this link.
Creating Project in Goolge Cloud Platform
Google Cloud Platform requires creating projects to keep the account organized.
1 Click the drop-down menu button next to the “Google Cloud Platform” logo.
2 From the pop-up window choose "no organization" and click open.
3 Click "Create" to start a project.
4 Choose a name for your project and click "Create".
5 Make sure the project you created is now in the drop down menu and main dashboard.
Activating Google Assistant API for Google Voice Kit
1 Enable Google API through this link.
2 You should create credentials through the main menu or the following this link.
3 Click Create credentials and select OAuth client ID
4 For the first time you’ll need to go Configure consent screen and enter your email and a product name then click Save.
5 Select Other and enter a name then click Create.
6 Click OK in the pop-up window, and find your new credentials in the list then click to download it.
Not: if you don't see the download icon, try expanding width of your browser window or zooming out.
7 Find the JSON file you downloaded (client_secrets_XXXX.json) and rename it assistant.json Then move it to /home/pi/assistant.json
8 Go to this link to open the Activity Control panel.
Turn the following options ON:
- Web and app activity
- Device information
- Voice and audio activity
9 You can follow the instructions below to see how to use the device.
- You can also SSH from another computer using the ssh -x code.
10 Authorize access to the Google Assistant API, when prompted
- Make sure you're following the manual start instructions the first time - if you run as a service, you won't be prompted for authorization.
11 Try an example question like "What is 4 + 4?" or "what's on my calendar?"-- and Google Assistant will respond!
- If the voice recognizer doesn't respond try to restart the device.
- If the response is Actually, there are some basic settings that need your permission first..., perform step 7 again, being sure to use the same account that you used for the authorization step.
Using Google Voice Kit Assistant
There are three demo apps that demonstrate the voice recognition and Google Assistant with different settings.
When a demo app is running, the LED arcade button light will pulse slowly every few seconds.
|DEMO APP||DESCRIPTION||SUPPORTED PI MODEL|
|assistant_library_demo.py||Demonstrates the Google Assistant Library and hotword detection ("Okay, Google").||Pi 2B, Pi 3B|
|assistant_grpc_demo.py||Demonstrates the Google gRPC APIs and button trigger.||Pi 2B, Pi 3B, ZERO W|
|cloudspeech_demo.py||Demonstrates the Google Cloud Speech APIs, button trigger, and custom voice commands.||Pi 2B, Pi 3B, ZERO W
USING ASSISTANT LIBRARY DEMO APP
To start Google Assistan, start the assistant library demo app by double-clicking "Start dev terminal" on the Desktop and entering:
This assistant library app has hotword detection built-in. You can start a question by saying "Okay, Google" or "Hey Google", and to turn it off poress Ctrl-C.
USING ASSISTANT GRPC DEMO APP
Type the following in the in "Start dev terminal":
This app does not support hotword detection, you need to press the button every time before you ask a question. And you can terminate the app by saying "goodbye".
USING CLOUD SPEECH DEMO APP
You can create your own online voice detection app using the Google Cloud Speech. For more info and instructions, you can follow this link.
LED LIGHT STATUS CODES
To make it easy to comunicate with Google Voice Kit, the LED light in the button lights accoring to its status:
|Slow pulse every five seconds||Device is ready|
|Constant light||Device is listening|
|Quick pulse||Device is thinking|
|Only three quick blinks||There is an error|
Google Voice Kit Example Questions
Google Assistant can answer an endless list of qestions, as long as they are not too complicated. We listed here some of the possible questions that can help you get started.
- What is Raspberry Pi?
- Who is the founder of the Republic of Turkey?
- Where am I?
- Which is the most wining team of the champions league?
- Which food has the highest calories?
- Who is the first person to travel into space?
- How many songs did Elvis Presley have?
- What is the resolution of the human eye?
- Which movies had the most Oscars?
- How many Turkish Liras does a Bitcoin do?
- Can you sing?
- Repeat After Me ....
- Change My Voice .....