Things used in this project

Hardware components:
Pi 3 02
Raspberry Pi 3 Model B
×1
Adafruit usb speaker
×1
usb microphone
×1
08377 02 l
Resistor 330 ohm
×1
09590 01
LED (generic)
×1
Software apps and online services:
raspbian
Logo assistant kvfq4j72g6 yciz8pmvwr
Google Assistant SDK

Code

hotword.py.patchDiff
Used to patch hotword.py to control the LED via the GPIO pins.
--- hotword.py.old	2017-08-04 19:16:18.699604629 +1000
+++ hotword.py	2017-07-02 00:56:30.749997722 +1000
@@ -27,6 +27,12 @@
 from google.assistant.library.event import EventType
 from google.assistant.library.file_helpers import existing_file
 
+import RPi.GPIO as GPIO
+import time
+GPIO.setmode(GPIO.BCM)
+GPIO.setwarnings(False)
+GPIO.setup(18,GPIO.OUT)
+
 
 def process_event(event):
     """Pretty prints events.
@@ -39,12 +45,18 @@
     """
     if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
         print()
+        GPIO.setup(18,GPIO.OUT)
+        print("LED on")
+        GPIO.output(18,GPIO.HIGH)
+        
 
     print(event)
 
     if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and
             event.args and not event.args['with_follow_on_turn']):
         print()
+        print("LED off")
+        GPIO.output(18,GPIO.LOW)
 
 
 def main():

Credits

Youutbeiconfix2 flqqgju0oc
Andrew Jones

Maker, youtuber and woodworker

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Horus: The Weather Station
Intermediate
  • 139
  • 4

Full instructions

A Raspberry Pi-based weather station that measures temperature, humidity and pressure using the Astro Pi Sense HAT and uploads the data.

How To Configure Moonlight For Steam Using JustBoom
Intermediate
  • 36
  • 2

Full instructions

This guide will show you how to install Moonlight for Raspbian and configure it for your JustBoom to stream games from your PC.

Reducing Arduino Power Consumption
Intermediate
  • 162
  • 5

Full instructions

One the most important feature of portable electronics should be long battery life. We can reduce the current drawn by several ways.

DIY Patient Thermometer for Healthcare Training
Intermediate
  • 66
  • 2

Work in progress

DIY thermometer, IR remote controlled. 9 different temperatures. For use in healthcare simulation training. Cost-effective solution.

Raspberry Pi Motion Tracking Gun Turret
Intermediate
  • 6,973
  • 16

Full instructions

A motion tracking airsoft or Nerf gun turret with autonomous and manual operation modes, controlled by a Raspberry Pi.

Particle Photon Based Security System with Alerting
Intermediate
  • 1,377
  • 20

Full instructions

Be alerted to any door or window opening and closing in your house on your smart phone.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog