This project utilizes the Arduino Nano 33 BLE Sense microcontroller to create a voice-controlled light switch. The built-in microphone captures audio signals, and a pretrained word detection model identifies the words "Yes" and "No." The LED light is switched on when "Yes" is detected and off when "No" is heard.
- Explore machine learning applications using Arduino Nano 33 BLE Sense.
- Implement voice recognition on microcontrollers.
- Test the microphone capabilities of the Arduino Nano board for real-world applications.
- Debug and modify in-built libraries and code.
- Deploy the Micro Speech application to the Arduino Nano 33 BLE Sense.
- Arduino Nano 33 BLE Sense board
- Micro USB cable for connecting the Arduino board to a desktop machine.
- Arduino IDE for programming the board.
- Use the Arduino IDE to connect the microphone and deploy the Micro Speech application to the microcontroller.
- Install the Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled library and select the micro_speech example.
- Modify the code in arduino_command_responder.cpp to implement the desired functions.
// ... (Previous code)
void RespondToCommand(tflite::ErrorReporter* error_reporter,
int32_t current_time, const char* found_command,
uint8_t score, bool is_new_command) {
static bool is_initialized = false;
if (!is_initialized) {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LEDG, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(LEDG, HIGH);
is_initialized = true;
}
static int certainty = 220;
if (is_new_command) {
error_reporter->Report("Heard %s (%d) @%dms", found_command, score,
current_time);
if (found_command[0] == 'y') {
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(LEDG, LOW); // turn on LED
}
if (found_command[0] == 'n') {
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(LEDG, HIGH); // turn off LED
}
}
}
// ... (Remaining code)
-
TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers by Pete Warden and Daniel Situnayake.
-
Voice-Controlled Light Switch Project on Arduino Project Hub.
Feel free to reach out for any additional information or assistance!