Upgrade Your Car With Voice Commands

by rohanbarnwal in Circuits > Arduino

1379 Views, 10 Favorites, 0 Comments

Upgrade Your Car With Voice Commands

Untitled design (2).png

In modern vehicles, infotainment system play a crucial role in enhancing the driving experience. However, many budget-friendly infotainment systems lack voice controlled features, requiring manual interaction that can be distracting while driving.

This project introduces a Smart Car Infotainment Enhancer, which enables hands-free voice control using an Arduino Leonardo and the DFRobot DF2301Q Voice Recognition Module. By setting up a wake-up word and custom commands, users can interact with their infotainment system through voice converting spoken words into keyboard shortcuts that Android-based systems recognize.

How It Started

My father's car initially had a basic infotainment system that only supported FM Radio and Music playback. Later, he upgraded to an Android based touchscreen Infotainment System, which offered more features but lacked voice control. Inspired by high-end cards with built-in voice assistants, I wanted to create a DIY solution using accessible hardware.

By researching keyboard shortcuts that Android systems support, I identified commands like

  1. Windows + M opens Google Maps
  2. Windows + N opens notification
  3. Escape takes back to the home screen
  4. Windows + [ shows background apps
  5. Windows + B Opens the web browser

Using the Arduino Leonardo's HID (Human Interface Device) capabilities, I developed a system where voice commands trigger these shortcuts, enabling seamless hands-free control

Final Thoughts

This project successfully transforms a basic infotainment system into a voice controlled interface making driving safer and more convenient. With the Arduino Leonardo's HID capabilities and the DFRobot DF2301Q's offline voice recognition, users can execute essential infotainment functions hands free.

Supplies

Arduino Leonardo is a game changer in this project due to its built in USB HID (Human Interface Device) functionality allowing it to act as a keyboard. This enabled seamless execution of voice triggered commands by sending keyboard shortcuts directly to the car's infotainment system. Its reliable performance easy programmability and compatibility with the DFRobot DF2301Q Voice Recognition Module made it the perfect microcontroller for implementing hands free control With this we transformed a standard Infotainment system into a smart voice controlled interface enhancing both convenience and safety for further you can check out the documentation .

DFRobot DF2301Q Voice Recognition Module played a crucial role in this project by enabling offline voice control without needing an internet connection. Its custom wake-up word and programmable commands allowed seamless interaction with the car's infotainment system. With its high accuracy and fast response time, the module ensured smooth hands-free operation making driving safer and more convenient. Its easy integration with Arduino Leonardo helped us convert voice commands into keyboard shortcuts, bringing smart infotainment features to any car effortlessly for further information check for the documentation

Wiring the Components

+ -.png

To connect the DFRobot Voice Recognition Module to the Arduino Leonardo follow this wiring setup:

DFRobot DF2301Q to Arduino Leonardo Connection

  1. VCC of DF2301Q to 5v of the Arduino Leonardo
  2. GND of DF2301Q to GND of the Arduino Leonardo
  3. D of DF2301Q to SDA of the Arduino Leonardo
  4. C of DF2301Q to SCL of the Arduino Leonardo

How It Works:

  1. The DFRobot DF2301Q listens for a wake up word (e.g. "Hello i10").
  2. After activation, it listens for specific commands (e.g. "Open Maps").
  3. It sends a Command ID (CMDID) to the Arduino Leonardo.
  4. The Arduino translates CMDID into a keyboard shortcut using its HID capabilities.
  5. The infotainment system executes the command as if a keyboard were connected.

Setting Up the Voice Recognition Module

Learning the Wake-Up Word

  1. Use the default wake up word to initiate setup.
  2. Say "Learning wake word" and follow the prompts.
  3. Speak your desired wake word (e.g. "Hello i10") three times.
  4. Once learning is completed, the module will respond to your chosen wake word.

Adding Command Words

  1. Wake up the assistant by saying your wake-up word
  2. Say "Learning command word" to enter learning mode.
  3. Speak each command phrase (e.g. "Open Maps") three times.
  4. The system assigns a Command ID (CMDID) to each command.
  5. These IDs will be used in the Arduino program to trigger actions

Deleting Commands or Wake Words

  1. Say "I want to delete" to enter deletion mode
  2. Choose from:

Delete wake word (Removes learned wake-up word)

Delete Command words (Remove specific commands)

Delete All (Resets Everything)

Uploading the Arduino Code

Now upload the following code to your Arduino Leonardo. This code initializes the voice recognition module listens for command ids and sends corresponding keyboard shortcuts to the infotainment systems

#include "DFRobot_DF2301Q.h"
#include "Keyboard.h"

DFRobot_DF2301Q_I2C DF2301Q;

void setup() {
Serial.begin(115200);
Keyboard.begin(); // Initialize Keyboard functionality
while (!(DF2301Q.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");
DF2301Q.setVolume(6);
DF2301Q.setMuteMode(0);
DF2301Q.setWakeTime(15);
}

void loop() {
uint8_t CMDID = DF2301Q.getCMDID();
if (CMDID != 0) {
Serial.print("CMDID = ");
Serial.println(CMDID);
switch (CMDID) {
case 5:
Serial.println("Performing: Windows + M");
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('m');
delay(100);
Keyboard.releaseAll();
break;
case 6:
Serial.println("Performing: Escape");
Keyboard.press(KEY_ESC);
delay(100);
Keyboard.releaseAll();
break;
case 7:
Serial.println("Performing: Windows + [");
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('[');
delay(100);
Keyboard.releaseAll();
break;
case 8:
Serial.println("Performing: Windows + B");
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('b');
delay(100);
Keyboard.releaseAll();
break;
case 9:
Serial.println("Performing: Windows + N");
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press('n');
delay(100);
Keyboard.releaseAll();
break;
default:
Serial.println("Unknown CMDID");
break;
}
}
delay(300);
}

Watch Demo Video

Upgrade Your Car with Voice Commands! | Arduino Smart Infotainment Hack

Check out my video demonstration! Don't forget to like share and subscribe me on youtube and follow on instructables for more awesome projects