Build your own Google Assistant with Raspberry Pi 3

August 30, 2018

Google Assistant with Raspberry Pi 3

MediaBoxent Google Assistant

As voice recognition and natural language analysis have improved, the availability of digital personal assistants, from Bixby to Alexa or Cortana to Google Assistant, all leading technology companies continue to develop digital assistants. Recently, Google released its Wizard API for Raspberry Pi 3.

Google and the Raspberry Pi Foundation launched the “Voice Kit” with a special piece of hardware called Voice HAT (basically a speaker driver and microphone), plus great software to build just that, a Google Home Clone.

However, getting the Voice Kit has been impossible. It was supplied on the cover of MagPi, the official magazine of Raspberry Pi, and was sold in hours.

Let’s do is take the Voice Kit software and modify it to work with the internal sound card of the Pi and a USB microphone.Then we will make a switch (to activate voice input) and put everything in a box.

The first thing to do is download the microSD card from the Voice Kit for the Raspberry Pi. You can download it directly from the Google AIY project site. Once the .img.xz file has been downloaded, you must write it to the microSD card using a card-writing utility. The Etcher.io tool is a good choice for this, as it is available for Windows, MacOS and Linux. You do not need to unzip the image file, Etcher will take care of it for you.

If this is the first time you create a customer ID, you must configure your consent screen by clicking the Configure consent form. You must name your application (this name will appear in the authorization step)

Select Other, type a name to help you remember your credentials, and then click Create.

A dialog box will appear. Click OK. In the Credentials list, find your new credentials and click on the download icon (Download icon) on the right.

Note: If you do not see the download icon, try to widen the browser window or zoom out.

Find the JSON file you just downloaded (client_secrets_XXXX.json) and rename it to assistant.json. Then move it to /home/pi/assistant.json

Start dev terminal:

Double-click the “Start dev terminal” icon on the desktop.In the terminal window, type sudo leafpad/boot/config.txt and delete # in front of the line dtparam = audio = on and insert a # in front of the two lines below it. exit nano.

From the previous step, the last lines of /boot/config.txt should look like this:

Audio

The next step is to get the audio to work. You will need a speaker with a 3.5 mm jack and a USB microphone. I did not have a dedicated USB microphone on hand so I plugged in a spare webcam that I had and the Pi was able to use the webcam microphone as a standalone microphone! If you need a USB microphone, try it. Connect the speaker to the 3.5mm jack on the board and connect the USB microphone to one of the USB ports.

nano /home/pi/voice-recognizer-raspi/checkpoints/check_audio.pyAnd let's change this line VOICEHAT_ID = 'googlevoicehat'THEREFORE: VOICEHAT_ID = 'bcm2835'In case it does not work we will have to do tests following theseConfigure and Test the Audi

Stay Secure Anywhere and Everywhere

The switch

The circuit for the switch is as follows:

Once you have built your circuit, you must connect one side of the switch to GPIO 23 and the other side to ground, which is conveniently located on the next pin to the left of GPIO 23.

If you can not build the switch, even just short circuit GPIO 23 and earth will have the same effect!

LED:

LED negative to GPIO 25 and positive to GPIO + 5v

Try it:

You should now have everything you need to try Google Assistant on your Raspberry Pi. All you need to do is run the following command from the dev terminal:

in this page right here you have all the parts list, all the amazon links.As you see there is a full video that I explain how to do it. I also included some photos on this page, follow the video and you will do it!