AIY_Kit-LED-Servo
Using the AIY Voice Kit with LEDs and Servo Motors
There are 3 projects in this repository.
- Turn on and off 4 LEDs
- Control 2 Servo motors
- Control 2 Servo Motors and 4 LEDs
https://aiyprojects.withgoogle.com/voice-v1/#makers-guide-change-to-the-cloud-speech-api
Pre-Requisite #1: Please enable billing by completing the Cloud Speech API tutorial first.Pre-Requisite #2: Create a directory called 'src'
mkdir src
Project 1 - Turn on and off 4 LEDs
YouTube Tutorial Video Here
Materials: You will need 4 LEDs (red, blue, green, and yellow), 4 resistors of 330 ohms, wires, and a breadboard (or soldering iron).
- Connect the Red LED to GPIO26, Blue LED to GPIO6, Green LED to GPIO13, and Yellow LED to GPIO5. Wiring Diagram below.
- Use your favorite text editor to create your new file:
nano src/4led.py
-
Copy the code from 4leds.py and paste into your 4led.py file.
-
Save and close 4led.py by:
Ctrl-X
y
[Enter]
- Make the file you just created executable.
chmod +x /src/4led.py
- Run the file you just created.
src/4led.py
You should be able to command your AIY Kit with the following commands:
Ok Google, Red light on.
Ok Google, Red light off.
Ok Google, Blue light on.
Ok Google, Blue light off.
Ok Google, Green light on.
Ok Google, Green light off.
Ok Google, Yellow light on.
Ok Google, Yellow light off.
Ok Google, Primary colors on.
Ok Google, Primary colors off.
Ok Google, All lights on.
Ok Google, All lighs off.
Project 2 - Control 2 Servo Motors
- Connect one servo motor to GPIO26, and the second servo motor to GPIO6. You may need to solder header pins to the AIY Voice Hat. Wiring Diagram shown below.
I purchased servo motors here.
- Use your favorite text editor to create your new file:
nano src/servo.py
-
Copy the code from servo.py and paste into your servo.py file.
-
Save and close servo.py by:
Ctrl-X
y
[Enter]
- Make the file you just created executable.
chmod +x /src/servo.py
- Run the file you just created.
src/servo.py
You should be able to command your AIY Kit with the following commands:
Ok Google, wave.
Project 3 - Control 2 Servo Motors and 4 LEDs
Materials: You will need 4 LEDs (red, blue, green, and yellow), 4 resistors of 330 ohms, wires, soldering iron, and 2 servo motors. You may need to solder header pins to the AIY Voice Hat.
I purchased servo motors here.
-
Connect one servo motor to GPIO26 (left), and the second servo motor to GPIO6 (right). Connect the Red LED to GPIO13, Blue LED to GPIO65, Green LED to GPIO12, and Yellow LED to GPI24. Wiring Diagram shown below.
-
Use your favorite text editor to create your new file:
nano src/ledservo.py
-
Copy the code from servo-led.py and paste into your ledservo.py file.
-
Save and close ledservo.py by:
Ctrl-X
y
[Enter]
- Make the file you just created executable.
chmod +x /src/ledservo.py
- Run the file you just created.
src/ledservo.py
You should be able to command your AIY Kit with the following commands:
Ok Google, wave.
Ok Google, wave right arm.
Ok Google, wave left arm.
Ok Google, Red light on.
Ok Google, Red light off.
Ok Google, Blue light on.
Ok Google, Blue light off.
Ok Google, Green light on.
Ok Google, Green light off.
Ok Google, Yellow light on.
Ok Google, Yellow light off.
Ok Google, Primary colors on.
Ok Google, Primary colors off.
Ok Google, All lights on.
Ok Google, All lighs off.