How to Build Your Own Google Home Raspberry pi

build Google Home Raspberry pi

A working home companion connected to your Google account and constrained by voice orders can be made with just a few pieces of equipment and arrangements.

Follow the steps below to install the Google Assistant SDK on your Raspberry Pi and configure it to accept voice commands.

The equipment is as follows

  1. You will need the following to configure a Raspberry Pi to work with Google Assistant:

Hardware

  • In the first place, you need Raspberry Pi 2 or Pi 3
  • Secondly, you require Force Supply
  • This is the third item: A microSD card with NOOBS 
  • The fourth point is. You need a Receiver for the USB
  • The fifth point is important. The speaker
  • And lastly Wireless and Ethernet connections
  • Install NOOBS on your SD card to introduce a spotless adaptation of Raspbian. Connect peripherals to your Pi for setup and utilize the NOOBS picture to get started.
  • Once you have set up Internet access and a Raspbian installation on the Pi, you can proceed to set up the sound gadgets.

Sound

  • Connect your USB receiver and speaker, and test to see if the gadgets are working properly.
  • Open the Terminal application on your Pi. Through this interface, all arrangements will be made.
  • Contribute the accompanying to the terminal to verify whether your speaker is working:

speaker-test - t wav

  • To check if your receiver is working appropriately, input the accompanying to record a short clasp:

arecord –format=S16_LE –duration=5 –rate=16000 –file-type=raw out.raw

  • To playback the recording, input the following command:

aplay –format=S16_LE –rate=16000 out.raw

  • If your Raspberry Pi is connected to an HDMI display, you may also choose to play audio out to the monitor.

The following is needed for the Developer Project

  1. Setting up a Google Developer Project is the first step to introducing the Google Assistant SDK.
  2. Set up a Developer Project by following the steps below.
  3. Access your Google account by opening a web browser on any gadget.
  4. You can create another project by going to Google Cloud Platform and selecting the possibility to do so.
  5. Then you will choose the Google Assistant API and enable it for your project.
  6. Give your product a name and click on the OAuth consent screen tab.
  7. An OAuth ID must be created.
  8. Put a name on your client ID by choosing the other option.
  9. Close the dialogue that appears after selecting Create.
  10. Right next to the OAuth ID, click the Download JSON button.
  11. Move this file to your Raspberry Pi’s local storage under “/home/pi” to authorize it to use the Google Assistant SDK.
  12. The Google Assistant SDK requires you to share the activity data of the Google account you want to use with it.
  13. Make sure the following options are enabled in your account’s Activity Controls.
  14. Web and App Activity
  15. Google Chrome website and app history is included, as well as history from Google services using websites and apps
  16. Information about the device
  17. Voice and audio activity
  18. As soon as your account is set up, you can return to your Pi terminal and prepare to install the Assistant SDK.

Setup of the SDK

Run the following commands in order in a terminal on the Pi:

git clone https://github.com/google/aiyprojects-raspbian.git ~/voice-recognizer-raspi

cd ~/voice-recognizer-raspi

scripts/install-deps.sh

sudo scripts/install-services.sh

cp src/assistant_library_with_local_commands_demo.py src/main.py

sudo systemctl enable voice-recognizer. service

You should now have Google Assistant SDK installed and it will run automatically when the Pi boots up.

Run the following commands to enable wake word detection and voice recognition:

cd ~/voice-recognizer-raspi

source env/bin/activate

python3 src/main.py

Once you have configured Google Assistant, you can simply say “OK Google” and issue it commands.

Post Written by

An undergraduate student pursuing Peace and Conflict Studies; while juggling writing gigs as a side hustle.