Arduino Voice-Controlled Car
by unikeyelectronics in Circuits > Arduino
48 Views, 0 Favorites, 0 Comments
Arduino Voice-Controlled Car
Arduino-based applications are widely popular among open-source hardware enthusiasts. Today, we will introduce an interactive Arduino voice-controlled car. The HLK-V20 is the voice-controlled module we will be using today. We chose the HLK-V20 because it is affordable. Of course, its voice recognition functionality is still quite good. In this case, the car's wheels produce a lot of noise during operation. Even under such interference, commands can still be heard within a short distance. The biggest drawback of this module is that the command words cannot be customized. You need to contact the original manufacturer's customer service for setup. Due to time constraints, we did not contact the original manufacturer to set the command words for moving forward and backward. We arbitrarily selected "turn on the heater" and "turn on the fan" to represent "forward" and "backward," respectively, and "turn off the heater" and "turn off the fan" to represent "stop."
Supplies
When building interactive robots like this, the stability of the hardware circuit is critical. For example, if you want to add short-term trigger functions, such as temporarily lighting an indicator light, a monostable multivibrator is highly suitable. It outputs a fixed duration of high voltage after triggering, perfectly meeting the control requirements for short-term actions, and its circuit structure is simple, making it easy to integrate with the Arduino system.
Introduction to the Small Car Motor
MX1508-2-channel DC motor drive module with forward/reverse PWM speed control
Hardware Setup
Required materials:
Understand the Key Hardware Parameters
According to testing, the microwave has excellent directionality
Detection range: 2–16 meters, continuously adjustable. The farthest distance I tested was 5 meters.
When preparing the hardware, identifying the parameters of components like inductors used in the circuit requires understanding the inductor color code. For example, filter inductors used in the power supply section of a small vehicle can be quickly identified by their color rings to determine their inductance value and tolerance range, preventing parameter selection errors that could affect the circuit's voltage regulation performance. This is crucial for ensuring stable power supply to the motor drive module.
Share Some Hardware Images to Provide a Visual Reference
Introduction to the Program Section
#include <SoftwareSerial.h>int IN1 = 6;int IN2 = 7;int IN3 = 8;int IN4 = 9;
SoftwareSerial mySerial(10, 11); // RX,TX
String receive_data;
void setup() {
mySerial.begin(115200);
Serial.begin(115200);
receive_data = "";
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT); }
void loop() {
while (mySerial.available() > 0) {
receive_data = String(receive_data) + String(char(mySerial.read()));
}
// digitalWrite(IN1, LOW); //OFF
// digitalWrite(IN2, LOW);
if (String(receive_data).indexOf("dakainuanqi") >= 0) {
Forward();
Serial.println("Turn on the heater");
receive_data = "";
} else if (String(receive_data).indexOf("guanbinuanqi") >= 0) {
stop();
Serial.println("Turn off the heater");
receive_data = "";
}}
Serial port settings for the voice-controlled module
SoftwareSerial mySerial (10,11); //RX.TX
String receive_data;
Voice-controlled module signal reception settings
while (mySerial.available() > 0) {
1.receive_data = String(receive_data) + String(char(mySerial.read()));
================
Command word settings
(String(receive_data).indexOf("dakainuanqi") >= 0) {
Forward();
Serial.println("Turn on the heater");
1.receive_data = "";
======================
Car Function Module Settings
void Forward()
{
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
Serial.print("Motor 1 Forward");
Serial.println();
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
Serial.print("Motor 2 Forward");
Serial.println();
}
Wiring Diagram
Limitations: The voice-controlled module may be affected by external noise. Using the voice-controlled module in combination with Bluetooth or other modules may yield better results.
Additionally, besides pairing with a Bluetooth module, you could try adding a simple filter circuit to the voice control module. For example, connect a small capacitor in series at the signal input end of the module to filter out some high-frequency noise. Combined with adding command word recognition verification in the program (e.g., executing the action only after the same command is recognized twice in a row), this can reduce the probability of false triggers and make the car's response to commands more reliable. If possible, consider switching to a voice-controlled module that supports customizable command words. This would make the system more intuitive to use, eliminating the need to memorize alternative command words.