Voice-Controlled Servo Motor in 10 Min - No Code Required

by KimY21 in Circuits > Assistive Tech

150 Views, 7 Favorites, 0 Comments

Voice-Controlled Servo Motor in 10 Min - No Code Required

Voice Controlled Servo Motor - Demo

Introduction

Building voice-controlled hardware traditionally requires complex programming: implementing speech recognition engines, managing audio input streams, handling text parsing and validation, integrating servo motor libraries, and coordinating all these components. With Grablo, you simply arrange visual blocks to make it happen.

This tutorial shows how to build a voice-controlled servo motor system in 10 minutes using drag-and-drop blocks. Using on-device AI speech recognition with Voice Activity Detection (VAD), the system automatically filters out silence and background noise, capturing only actual speech commands without false triggers.


What You'll Build

A complete voice-controlled servo motor system featuring:

  1. AI-powered on-device speech recognition with automatic voice activity detection
  2. Real-time servo motor control responding to spoken angles (0-180 degrees)
  3. Optional LCD display showing recognized speech text
  4. Visual dashboard for command feedback
  5. Zero lines of code required!


Supplies

결선도.png

Required Components

  1. Raspberry Pi (or BeagleBone, Jetson Nano, PC with USB-GPIO)
  2. SG90 Servo Motor (0-180 degrees)
  3. USB Microphone or Bluetooth microphone/headset
  4. External 5V DC power supply (recommended for stable servo operation)
  5. Jumper wires


Optional Components

  1. I2C LCD Display (16x2) for visual feedback


Wiring

Servo Motor (SG90):

  1. Red wire → 5V power (external DC power supply recommended)
  2. Brown/Black wire → GND
  3. Orange/Yellow wire → GPIO 23


Optional - I2C LCD Display:

  1. VCC → 5V
  2. GND → GND
  3. SDA → GPIO 2 (SDA)
  4. SCL → GPIO 3 (SCL)


Microphone:

  1. Connect USB microphone to any USB port on Raspberry Pi
  2. OR use USB audio adapter with 3.5mm microphone
  3. OR connect Bluetooth microphone/headset wirelessly


⚠️ Important Notes:

  1. Raspberry Pi's 3.5mm jack is audio output only - no mic input support
  2. Use external 5V DC power supply for stable servo operation
  3. Single servo + small LCD can run on Pi power, but external power recommended

Quick Start

  1. Install software: Download and install Grablo software on your Raspberry Pi
  2. Set up hardware: Wire servo motor and LCD display (optional) according to circuit diagram above
  3. Connect microphone: Plug in USB microphone or pair Bluetooth microphone
  4. Get this project: Project Link
  5. Connect controller: In your project, go to "Connect Controller" and enter IP address
  6. Hit RUN: Start controlling servo motor with your voice!

💡 Want to build it yourself? Skip to Step 2 and follow the detailed tutorial

Create Project

  1. Go to https://app.grablo.co
  2. Click "Create Project"
  3. Give your project a name

Control 1 - Continuous Speech Recognition

2025-09-30_21-14-55.png

Create a new logic and control that continuously listens for voice commands

  1. Condition (Always): Always running to capture voice at any time
  2. Action (Speech-to-Text):
  3. Use AI-powered on-device speech recognition with built-in model
  4. Command: Listen - captures only actual speech and ignores everything else
  5. Built-in Voice Activity Detection (VAD) automatically filters out silence and background noise

This control runs continuously, waiting for you to speak. The smart VAD system ensures no false triggers from ambient sounds.

Control 2 - Convert Voice to Servo Angle

2025-09-30_21-17-28.png

Create a control that converts recognized speech into servo motor rotation

  1. Condition (Watch Action): Triggers when speech recognition completes
  2. Select the "Listen" action
  3. Status: Complete
  4. Action 1 (Speech-to-Text): Get recognized text
  5. Command: Get Text
  6. Store result in variable: Voice_Text
  7. Action 2 (Set Variable): Convert text to number
  8. Store converted number in variable: Servo_Angle
  9. Action 3 (I/O Device Control): Rotate servo motor
  10. Device: Raspberry Pi Servo Motor Library
  11. Servo type: SG90 (0-180 degrees)
  12. Command: Set Position
  13. Position value: Servo_Angle variable
  14. Action 4 (Optional - I/O Device Control): Clear LCD display
  15. Device: I2C LCD (16x2)
  16. Command: Clear
  17. Action 5 (Optional - I/O Device Control): Show text on LCD
  18. Device: I2C LCD (16x2)
  19. Command: Print
  20. Text value: Voice_Text variable

Create Dashboard

2025-09-30_21-23-13.png

Create a new dashboard with a label widget displaying:

  1. Voice Text Widget: Shows the recognized speech in real-time

This provides visual feedback of your voice commands alongside the physical servo movement.

Launch Your Project

That's It - You're Done!

Congratulations! You've just built a complete voice-controlled servo motor system using only 2 simple controls and zero lines of code. This is the power of visual programming with Grablo - what traditionally requires complex speech recognition and motor control programming is now accomplished with intuitive drag-and-drop blocks.


Expected Results

When you run your project:

  1. Say "45" → Servo rotates to 45 degrees
  2. Say "90" → Servo rotates to 90 degrees
  3. Say "180" → Servo rotates to 180 degrees
  4. Non-numeric speech (like "hi there") is displayed but servo doesn't move
  5. LCD shows recognized text in real-time
  6. Dashboard displays voice commands as they're recognized


Run Your Project:

  1. Install software: Download and install Grablo software on your Raspberry Pi
  2. Set up hardware: Wire servo motor and LCD display (optional) according to circuit diagram above
  3. Connect microphone: Plug in USB microphone or pair Bluetooth microphone
  4. Connect controller: In your project, go to "Connect Controller" and enter IP address
  5. Hit RUN: Start controlling servo motor with your voice!



Video Tutorial

Voice Controlled Servo Motor using AI-powered speech recognition

Watch the complete build process in action! This 7-minute video demonstrates every step from hardware setup to voice recognition configuration and launching your voice-controlled servo system.

Expand Your Project

Add more functionality with additional blocks:

  1. Multiple servos: Control pan-tilt system with "pan 45 tilt 90" voice commands
  2. Natural language commands: Parse phrases like "turn left" or "face forward"
  3. Preset positions: Say "home position" to return servo to 0 degrees
  4. Voice feedback: Add text-to-speech to confirm commands
  5. Voice-controlled robot arm: Expand to 4-6 servos for full robotic arm control
  6. Sequential movements: Chain multiple positions with one command


Troubleshooting

  1. No voice recognition: Check microphone connection in Raspberry Pi audio settings
  2. Servo not moving: Verify GPIO pin number, wiring connections, and power supply
  3. Incorrect angles: Adjust servo pulse width values in device settings based on datasheet
  4. LCD not displaying: Check I2C address and wiring (use i2cdetect -y 1 command)
  5. Recognition errors: Try speaking more clearly, reduce background noise, or download better speech model
  6. Non-numeric speech error: This is expected behavior - servo only moves for valid numbers
  7. Choppy servo movement: Use external power supply instead of Pi power


Resources

  1. Official Website: https://grablo.co
  2. Get started: https://app.grablo.co
  3. Documentation: https://doc.grablo.co
  4. Support: support@grablo.co