Stay organized with collections
Save and categorize content based on your preferences.
Now that you have the Assistant running on the device, it is time to extend it
with Device Actions. Device Actions allow you to control your device via voice.
For this example, you will be using a Built-in Device Action
to turn a light on and off.
Follow these instructions to install an LED on the Raspberry Pi 3 Model B. In a
later step, you will modify the sample code to light the LED by voice command.
Hardware requirements
Before you begin this example, you'll need the following components:
A breadboard
An LED
A series resistor
Two jumper wires, both with a male and female connector
The electrical resistance of the resistor should be tied to the specific LED.
To find the correct value, you can use an online calculator (or purchase a kit).
Connect the components
Connect GPIO output pin BCM25
to one side of a series resistor. Note that this is physical pin 22 on the
Raspberry Pi 3.
Connect the other side of the resistor to the anode side (longer lead)
of the LED.
Connect the cathode side (shorter lead) of the LED to ground.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["This guide explains how to extend Google Assistant on your device with Device Actions, enabling voice control for tasks like turning on/off a light using a built-in Device Action."],["You will need a breadboard, LED, resistor, and jumper wires to connect an LED to your Raspberry Pi, enabling physical interaction with the Device Action."],["The guide involves connecting an LED to a specific GPIO pin on the Raspberry Pi and registering device traits to control it via Google Assistant, even if you don't have an LED you can still set up a Device Action."],["While an LED and physical setup are recommended for practical demonstration, the core functionality of Device Actions can be explored through terminal output if you don't have an LED at the moment."]]],[]]