Turn any car into a smart vehicle with voice controlled infotainment using Arduino Leonardo & DFRobot DF2301Q hands free futurisitc
Project Overview
This project enables a voice controlled interface for an Android-based infotainment system using an Arduino Leonardo and DFRobot DF2301Q Voice Recognition Module. By setting up a wake-up word and custom defined commands, the system can interpret voice inputs and translate them into keyboard shortcut, which the infotainment system recognizes. This enhances the user experiences by enabling hands-free operation, making it more interesting.
Story
In modern vehicles, infotainment systems have become an essential part of the driving experience. This project introduces a Smart Car Infotainment Enhancer that uses voice commands to control some features of a car's infotainment system, making it more convenient to use. Initially my father's car had a basic infotainment system that only played music and FM radio Later, my father decided to install a touchscreen android based infotainment system. However, it lacked voice-controlled feature, which sparked my idea to create this project. I was further inspired by high end cars with built-in voice-controlled infotainment and wanted to see if I could replicate similar feature using accessible hardware. My first approach was to connect a keyboard via USB and test various keyboard shortcuts, such as Windows+M, Windows+N. Then, I researched which shortcuts worked on android and found some useful commands. These commands were then integrated into the system for seamless control.
This system is built using an Arduino Leonardo (which supports HID functionality) and the DFRobot DF2301Q Offline Voice Recognition Module. It allows users to execute common actions like opening maps, opening the browser, viewing notification and opening the list of apps open in the background through simple voice commands.
Features
Hands free voice control of infotainment functions Custom wake up words to activate the system Custom defined words to trigger keyboard shortcuts Arduino Leonardo as an HID device to send commands to the Android-based infotainment system.
Components Required
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 out the documentation:https://wiki.dfrobot.com/SKU_SEN0539-EN_Gravity_Voice_Recognition_Module_I2C_UART
Arduino Leonardo was 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 Arduino Leonardo, we transformed a standard infotainment system into a smart, voice controlled interface, enhancing both convenience and safety! For further information check out the documentation: https://docs.arduino.cc/hardware/leonardo/ Jumper Wires: Jumper wires are insulated wires with connector pins used to establish electrical connection between components on a breadboard, Arduino, or other circuit boards.
How It Works
1. The DFRobot DF2301Q module is configured with a custom wake-up word ("Hello i10").
2. The module remains in standby mode until the wake up word is spoken.
3. After waking up, the module listens for a command (e.g. "Open Maps").
4. Based on the recognized command, it sends a Command ID (CMDID) to the Arduino.
5. The Arduino Leonardo interprets the command and sends the appropriate keyboard shortcut using its HID capabilities.6. The infotainment system responds by executing the corresponding action.
Setting Up Wake-Up Word & Commands
Learning the Wake-Up Word To configure a custom wake-up word:
Learning the Wake-Up Word
To configure a custom wake-up word:
Use the default wake-up word to initiate the process.Say “Learning wake word” and follow the prompts.Speak your desired wake word (e.g. “Hello I10”) three times.Once learning is completed, the system will now respond to “Hello I10”.
Learning Commands Words
To configure voice commands:
Wake up the assistant by saying your custom word in my case it is “Hello I10”.Say “Learning command word” to initiate command learning mode.Speak each command phrase (e.g. “Open Maps”) three times.The system assigns an ID (CMDID) to each command.These IDs will be used in the Arduino program to trigger specific actions.
Deleting Wake Words or Commands
Say “I want to delete” to enter deletion mode.Choose between: Delete wake word (removes learned wake-up word)Delete command words (removes specific learned commands)Delete all (resets all wake words and commands)
Arduino Code Implementation
The following Arduino sketch demonstrates how the system works. The code
Initializes the DFRobot DF2301Q module.Listens for Command IDsSends HID keyboard shortcuts based on the recognized command#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);
Serial.print("WakeTime = ");
Serial.println(DF2301Q.getWakeTime());
}
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); // Windows key
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);
}
Video of this project
“Check out this video I created for this project! If you enjoy it, please don’t forget to like, share, comment, and subscribe. Your support means the world to me and gives me the motivation to keep creating amazing
Connections
Conclusion
This Smart Car infotainment Enhancer enhances the driving experiences by allowing hands free interaction with an Android-based infotainment system. Using offline voice recognition, it ensures smooth performance without internet dependency. With further refinements, this systems can be great addition to modern smart vehicles, improving both convenience and safety.