This project is an extension of the previous project (Custom Wake Word for Google Assistant on Raspberry Pi). The previous project showcased the triggering of Google Assistant on Raspberry Pi using a pushbutton and a custom wake word. This project shows how to trigger google assistant SDK on Pi using an ultrasonic sensor, HC-SR04.
Modified Rasbian ImageI had modified a Raspbian image for the custom wake word to work efficiently which can be found here.
If you are using that image, download the following zip file. It contains all the codes and scripts that are required.
- Install the audio drivers.
- Get the google assistant up and running ( Should hardly take 10 mins if using Pi3 or about 45 mins is using Pi Zero as most of the installation has been already done. Only Authentication is required).
- Wire the ultrasonic sensor to Pi as shown in the schematic.
- Start the script to start google assistant and then start the ultrasonic trigger script.
If your Pi is already running a Google Assistant, then download the following zip file https://goo.gl/HWxo6M.
- Extract the contents to any directory.
- Wire the ultrasonic sensor to Pi as shown in the schematic.
- Move into /home/pi/env/lib/python3.4/site-packages/googlesamples/assistant/grpc folder and replace the existing pushtotalk.py file with the pushtotalk.py given in the zip.
- Copy the trigger folder into any directory and update it's location in the HCSR04-Trigger.sh script.
- Start the script to start google assistant and then start the ultrasonic trigger script.
- Make the gassist-start.sh and HCSR04-Trigger.sh executable and use it to start the Google Assistant and ultrasonic trigger respectively.
Comments
Please log in or sign up to comment.