Lesson 8: Intelligent Voice Control System

In today's era of smart technology, voice control has been widely applied in various devices, such as smart homes, smart speakers, and smartphones. With simple voice commands, we can effortlessly control devices to perform diverse tasks. So, can we implement this technology in robotic cars?

Next, we will use the UNIHIKER K10 and a car model to create an intelligent vehicle with "speech comprehension" capabilities. Users can control the car to execute corresponding operations—such as "forward," "backward," "turn left," "turn right," or "turn on the headlights"—through simple voice commands. This is not only an engaging project but also helps us better understand the application of speech recognition technology in robotic control.

Objectives

The robotic car should be capable of recognizing voice commands issued by the user and performing corresponding actions, such as forward, backward, turning left, turning right, and turn on/off headlights.

Key Learning Points

1. Mastering Basic Voice Recognition Functions

2. Implement real-time visualization of recognized voice commands on the UNIHIKER K10 screen.

3. Learning to parse voice content into control commands for robotic car motion control

4. Enhancing Usability and Responsiveness of Voice Interaction Systems

Materials List

Hardware Requirements:

HARDWARE LIST
1 Maqueen Plus V3
1 UNIHIKER K10

 

Software Requirements: Mind+ programming software (Version 1.8.1 RC1.0 or above) ×1

Download Link: https://mindplus.cc/

 

 

Hands-on Practice

In an intelligent voice control system, the idea of "speaking a command to make the robotic car move" sounds both exciting and challenging. This project will guide you step by step to understand how speech recognition works. Through programming exercises, you will build a smart voice control system that can "listen, act, and respond."

 

Task 1: Speech Recognition Initialization

Configure the command vocabulary for speech recognition and enable the voice recognition function. Upon successful recognition, the detected command words will be displayed in real time on the UNIHIKER K10 screen, achieving synchronized voice and visual feedback.

 

Task 2: Motion Control

Enable the robotic car to "understand commands and take action"—by executing corresponding movement instructions (e.g., moving forward, backward, turning left, or turning right) based on the recognized voice commands. This ensures precise alignment between voice control and the car's behavior.

 

Task 1: Speech Recognition Initialization

1. Hardware Connection

Connect the assembled robotic car to your computer using a USB 3.0 to Type-C data cable.

Note: The Type-C end should be connected to the UNIHIKER K10 board.

 

 

2. Software Preparation

Open Mind+ and complete the software setup according to the illustrated procedure below.

 

 

 

3. Programming Implementation

(1) Initialize Voice Recognition Function

Under the "UNIHIKER K10 On Start" section, use the "set speech recognition wake time ms language" command to configure the voice recognition mode as continuous listening. Set the wake time to 6 seconds and select English as the recognition language. This step ensures the voice recognition module initializes correctly and enters listening mode after user activation.

 

 

(2) Add Voice Command Vocabulary

Use the "add voice command id" instruction to assign a unique ID to each voice command for subsequent processing. For example:

Command "Forward" → ID 0

Command "Backward"→ ID 1

Command "Left Turn" → ID 2

Command "Right Turn" → ID 3

Command "Turn On Headlights" → ID 4

Command "Turn Off Headlights" → ID 5

 

 

(3) Detecting Voice Recognition Wake-up Status

Within the "Forever" command block, use the "If...Then...Else" conditional structure to evaluate the "speech recognition awake?" command. When the user speaks the preset wake phrase "Hi, Telly", the voice recognition function enters listening mode and prepares to receive voice commands.

 

 

(4) Command Word Recognition and Display

After the voice recognition function is activated, determine whether the user's spoken command is "Temperature" by checking if the "command id 0 detected?" condition evaluates to true.

 

 

If Command ID 0 is detected (indicating the user said "Forward"), use the "show cached content" command followed by the "cache text at X: Y: font color wrap auto-clear" command to show the recognized command "Forward" on the UNIHIKER K10 screen.

 

 

The same method applies when detecting the command words "Backward", "Turn left", "Turn right", "Turn on headlights", and "Turn off headlights" — the recognized command words will be displayed on the UNIHIKER K10 screen.

 

 

 

 

When the voice recognition status is in the wake-up state, the recognized voice command words will be displayed on the UNIHIKER K10 screen. Otherwise, the screen will show the prompt:"Please say the wake phrase 'Hi Telly' to activate voice recognition."The complete program is as follows:

 

 

4. Program Execution

Before executing the program, please ensure the UNIHIKER K10 is properly connected to your computer via USB cable. Once confirmed, click the "Run" button in the software. After successful program upload, activate the voice recognition by saying the wake-up phrase "Hi Telly" , then speak your command words - the recognized commands will be displayed on the UNIHIKER K10 screen.

 

 

Task 2: Motion Control

1. Programming

In Task 1, we have implemented basic voice recognition functionality. Now, let's expand this capability by adding motion control programs based on Task 1.

 

When Command ID 0 (Forward) is detected, use the "set all motors direction rotate forward speed 100" and "wait 1 second" commands to make the car move forward for 1 second. Then use the "set all motors stop" command to pause the car.

 

 

When Command ID 1 (Backward) is detected, use the same method, set the car to move backward for 1 second, then stop.

 

 

When Command ID 2 (Turn Left) is detected, use the "set right motor direction rotate forward speed 200", "set left motor direction rotate forward speed 0", and "wait 1 second" commands to make the car turn left for 1 second. Then use the "set all motors stop" command to pause the car.

 

 

When Command ID 3 (Turn Right) is detected, use the same method as for left turns, control the car to turn right for 1 second, then pause.

 

 

When Command ID 4 (Turn on Headlights) is detected, use the "RGB Led all color" command to control both front headlights, displaying red color to turn on the headlights.

 

 

When Command ID 5 (Turn off Headlights) is detected, use the "RGB Led all color" command to control both front headlights, displaying black color to turn off the headlights.

 

 
2. Program Execution

Prior to running the program, ensure the UNIHIKER K10 is properly connected to your computer via USB cable. After verification, click the "Run" button in the software.

 

 

Knowledge Base

1. The Cutting-Edge Technologies Behind Speech Recognition and Synthesis

In Lesson 4, we learned the common voice control workflow: recognition → matching → playback. Recognition refers to speech recognition, while playback means speech synthesis. But do you know the advanced technologies behind these processes? What we commonly describe as "understanding speech" and "producing speech" actually correspond to these two core technologies: speech recognition and speech synthesis.

 

Speech Recognition

This refers to the process of converting speech signals into text. The underlying technology typically employs Deep Neural Networks (DNN) or Recurrent Neural Networks (RNN), training models to comprehend pronunciation characteristics of human language. Modern speech recognition systems also incorporate voice activity detection, speech segmentation, and contextual recognition, enabling the system to "understand you" more accurately.

 

Speech Synthesis (Text-to-Speech, TTS)

Speech synthesis is the technology that "reads out" text. Early TTS systems sounded mechanical and monotonous. Today's next-generation TTS systems (such as WaveNet and FastSpeech) can generate more natural speech patterns, even imitating different genders, ages, or speaking styles - allowing your smart car not just to "speak," but to "have personality."

 

2. Voice vs Buttons: Which is Better for Future Interaction?

While we're accustomed to pressing buttons or swiping screens, voice interaction as a "zero-contact method" demonstrates unique advantages in many scenarios:

Driving: Voice-controlled navigation and calls keep hands free for safety

Smart Homes: Voice-operated lights, AC and curtains enable smarter living

Elderly/Accessibility: More user-friendly than visual buttons for seniors or visually impaired

Special Work Environments: Labs, hospitals, and workshops where manual operation is inconvenient

 

Food for thought:

Could your voice-controlled car project incorporate a "silent mode" or hybrid "voice+button" control?

Should future robots recognize different users' voices for personalized interaction?

 

Challenge Yourself

We have mastered the skills to control the car's movements through voice commands. Now, try adding the "play built-in music in background" command to implement sound feedback functionality. For example, when the "forward" command is recognized, the car first executes the forward movement, then activates the sound feedback function to make the interaction more natural and vivid.

Tip: The voice playback should be executed after the car completes the corresponding operation.

 

icon Lesson8 program.zip 504KB Download(0)
License
All Rights
Reserved
licensBg
0