Coder Social home page Coder Social logo

awesome04 / arduino-voice-controlled-light-switch Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 86 KB

This project involves deploying a program to the micro-controller. The LED light will be switched on when we say “Yes”, and switched off when we say “No”.

Home Page: https://create.arduino.cc/projecthub/boys/voice-control-light-switch-f2749a?ref=part&ref_id=107215&offset=60

C++ 95.14% C 4.86%
arduino sensors voice-control

arduino-voice-controlled-light-switch's Introduction

Arduino Voice-Controlled Light Switch

Voice-Controlled Light Switch

Project Overview

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.

Goals and Objectives

  • 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.

Hardware and Software Required

  • Arduino Nano 33 BLE Sense board
  • Micro USB cable for connecting the Arduino board to a desktop machine.
  • Arduino IDE for programming the board.

Procedure

  1. Use the Arduino IDE to connect the microphone and deploy the Micro Speech application to the microcontroller.
  2. Install the Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled library and select the micro_speech example.
  3. Modify the code in arduino_command_responder.cpp to implement the desired functions.

Code Modification Example

// ... (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)

Schematics and Flow Chart

Schematics

Schematics

Flow Chart

Flow Chart

Results

Results

References

  1. TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers by Pete Warden and Daniel Situnayake.

  2. Voice-Controlled Light Switch Project on Arduino Project Hub.

Feel free to reach out for any additional information or assistance!

arduino-voice-controlled-light-switch's People

Contributors

awesome04 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.