Turn your Raspberry Pi into homemade Google Home

Google Home is a beautiful device with built-in Google Assistant - A state of the art digital personal assistant by Google -. which you can place anywhere at your home and it will do some amazing things for you. It will save your reminders, shopping lists, notes and most importantly answers your questions and queries based on the context of the conversations.

In this article, you are going to learn to turn your Raspberry Pi into homemade Google Home device which is,

So, let’s get started.


What things will you need?

Once you have all these things, login to Raspbian desktop and go to the following steps one by one.


Step -1: Setting up USB mic.

As you can see your USB device is attached to card 1 and the device id is 0. Raspberry Pi recognizes card 0 as the internal sound card (which is bcm2835) and other external sound cards as external sound cards.

This will set your external mic (see pcm.mic) as the audio capture device (see in pcm!.default) and your inbuilt sound card (card 0) as the speaker device.

Paste above confugrations to this file.

Step -2: Setting up your speaker output.

Step -3: Test the mic and speakers.

Okay. Our hardware is set.

Step -4: Download required packages and configure Python environment:

This will create Python 3 environment (As the Google Assistant library runs on Python 3.x only) in your raspberry pi and install required dependencies.

It should download the Google Assistant Library and the demo.

Step -5: Enabling the Google Assistant cloud project.

homemade-google-home

homemade-google-home

homemade-google-home

homemade-google-home

homemade-google-home

Step -6: Authenticating your Raspberry Pi.

Please go to this URL: https://... Enter the authorization code:

If instead, it displays: InvalidGrantError then an invalid code was entered. Try again.

Step -7: Setting up the LED indicator.

homemade-google-home

Step -8: Initialise on boot complete:

You can run google-assistant-init.sh to initiate the Google Assistant any time. Let’s see how you can start the Google Assistant while booting.

1. Autostart with Pixel Desktop on Boot:

2. Autostart with CLI on Boot:

That’s all!!! You “Homemade Google Home” is now ready. Reboot the device and ask your first question to your Google Assistant.


Conclusion:

You can do many daily stuf with your Google Home. If you want to perform your custom tasks like turning off the light, opening the door, you can do it with integrating Google Actions in your Google Assistant. If you have any trouble with starting the Google Assistant, leave a comment below. I will try to resolve them.

If you liked the article, share it so more people can see it! Also, you can follow me on Medium or on Twitter, so you get updates regarding my future articles!!