Skip to content

A simple Voice Recognition Hardware implementation demonstrating a system that can be used for smart homes.

License

Notifications You must be signed in to change notification settings

Malayanil/VoiceRecognition-Arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voice Recognition Hardware Implementation using Arduino UNO R3

Welcome to the Voice Recognition Project Repository. This project was implemented on hardware, the details are stated below in this READ ME File.

Index

  1. Introduction
  2. Hardware & Software Requirements
  3. Hardware Assembly
  4. Algorithm and Code
  5. Working Demonstration
  6. Future Scope

                                              ---END OF SECTION---

1. INTRODUCTION

Voice-biometrics refers to the technology or process of speech processing where voice can be used to verify a personal identity, unobtrusively and invisibly. Like other speechprocessing tools, voice biometrics extract information from the stream of speech to accomplish their work. In our model we are focusing on its ability to recognize what is being said. Voice recognition is a biometric modality that uses an individual’s voice for recognition purposes. Our proposed model or program receives and interprets dictation as well as understands and carries out the spoken command. Voice biometric solutions eliminate the need for PIN based password or interrogation–based authentication methods, or can be used to add another level of security to those systems.

The Arduino Uno R3 is an open-source microcontroller board based on the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board is equipped with sets of digital and analog input/output pins that may be interfaced to various expansion boards and other circuits.

Our model uses this board to control the analog signals passed from the mobile app, named Android Meets Robot to the Arduino via the HC05 Bluetooth module. It is programmed as per the need to fulfill the requirements of a Voice Recognition System fitted in smart homes.

We have currently implemented a simpler version of the Home Security System using Voice Recognition and we are aiming to develop it further using Machine Learning to implement only selected users’ voices to be accepted; right now, anyone with the correct “key phrase” can unlock or lock the device.


                                              ---END OF SECTION---

2. HARDWARE & SOFTWARE REQUIREMENTS

  1. Arduino UNO R3
  2. HC05 Bluetooth Module
  3. LCD 16x2 Board
  4. Jumper Wires
  5. Bread Board
  6. LEDs
  7. Resistor
  8. Android App: - Android Meets Robots
  9. Arduino IDE

All the images are representation of the hardware we used.

The Android Meets Robots App helps us to connect to the Bluetooth Module to send instructions and the Arduino IDE is used to program the Arduino UNO R3 Board according to our needs.


                                              ---END OF SECTION---

3. HARDWARE ASSEMBLY

The following connections were done.

  • Bluetooth Pin RX to Arduino TX
  • BT Pin TX to Arduino RX
  • BT Pin 5V to Arduino 5V
  • BT Pin GND to Arduino GND
  • Led1 Positive to Arduino Pin 7
  • Led1 Negative to GND
  • Led2 Positive to Arduino Pin 8
  • Led2 Negative to GND
  • Led3 Positive to Arduino Pin 9
  • Led3 Negative to GND
  • Led4 Positive to Arduino Pin 10
  • Led4 Negative to GND
  • LCD VSS to Arduino GND
  • LCD VDD to Arduino 5V
  • LCD RS to Arduino Pin 12
  • LCD E to Arduino Pin 11
  • LCD V0 to Arduino Pin 6
  • LCD A to Arduino 5V
  • LCD K to Arduino GND
  • LCD RW to Arduino GND
  • LCD D0 to D3 Arduino GND
  • LCD D4 to Arduino Pin 5
  • LCD D5 to Arduino Pin 4
  • LCD D6 to Arduino Pin 3
  • LCD D7 to Arduino Pin 2


                                              ---END OF SECTION---

4. ALGORITHM AND CODE

Algorithm


The algorithm implemented on the working of the hardware is pretty simple and straight-forward. The user has to connect the HC05 Bluetooth Module with the Android Meets Robot App via Bluetooth using a smartphone. The 'key phrase' has to be spoken. The App then forwards the voice data to the HC05 Bluetooth Module. Then it is forwarded to the Arduino UNO R3 Board. The program burned to the Arduino UNO R3 decides if the data matches the 'key phrase' and generates the output accordingly.


Code

The code is uploaded in the file 'minor_project.ino'.

The first line indicates the inclusion of LiquidCrystal.h library for use in the Arduino to display in the 16x2 LCD Board.

       #include<LiquidCrystal.h>

A few global variables are defined for varid use in the programming of Arduino.

       String voice;
       int
       led1 = 7, //Connect LED 1 To Pin #7
       led2 = 8, //Connect LED 2 To Pin #8
       led3 = 9, //Connect LED 3 To Pin #9
       led4 = 10; //Connect LED 4 To Pin #10

User Defined functions for the key phrases.

       void turn_on()
       {
            digitalWrite(led1, HIGH);
            digitalWrite(led2, HIGH);
            digitalWrite(led3, HIGH);
            digitalWrite(led4, HIGH);
       }
       
       void turn_off()
       {
            digitalWrite(led1, LOW);
            digitalWrite(led2, LOW);
            digitalWrite(led3, LOW);
            digitalWrite(led4, LOW);
       }

       const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

The HIGH and LOW parameters specify the switch ON and OFF factors.

       void setup() 
       {
        lcd.begin(16,2);
        analogWrite(6,15);

        Serial.begin(9600);
        pinMode(led1, OUTPUT);
        pinMode(led2, OUTPUT);
        pinMode(led3, OUTPUT);
        pinMode(led4, OUTPUT);
        lcd.print("Password Please");
       }

Initializing the LCD to display something after the device is powered on and defining the OUTPUT modes for the Arduino.

        void loop() 
        {
          // Print a message to the LCD.

          while (Serial.available()){  //Check if there is an available byte to read
          delay(10); //Delay added to make thing stable
          char c = Serial.read(); //Conduct a serial read
          if (c == '#') {break;} //Exit the loop when the # is detected after the word
          voice += c; //Shorthand for voice = voice + c
          } 
          if (voice.length() > 0) {
            Serial.println(voice);
            lcd.setCursor(0, 1);
        //-----------------------------------------------------------------------//   
          //----------Control Multiple Pins/ LEDs----------// 
               if(voice == "*turn on") 
               {
                turn_on();
                lcd.clear();
                lcd.print("Accepted");
               }  //Turn On All Pins (Call Function)
          else if(voice == "*turn off"){turn_off(); lcd.clear();lcd.print("Accepted");} //Turn Off  All Pins (Call Function)

          //----------Turn On One-By-One----------//
          else if(voice == "*TV on") {digitalWrite(led1, HIGH);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*fan on") {digitalWrite(led2, HIGH);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*computer on") {digitalWrite(led3, HIGH);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*bedroom lights on") {digitalWrite(led4, HIGH);lcd.clear();lcd.print("Accepted");}
          //----------Turn Off One-By-One----------//
          else if(voice == "*TV off") {digitalWrite(led1, LOW);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*fan off") {digitalWrite(led2, LOW);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*computer off") {digitalWrite(led3, LOW);lcd.clear();lcd.print("Accepted");}
          else if(voice == "*bedroom lights off") {digitalWrite(led4, LOW);lcd.clear();lcd.print("Accepted");}
        //-----------------------------------------------------------------------// 
        voice="";}
        delay(2000); //Delay 
        lcd.print("Password Please"); //Reset the LCD display
        }

The comments explain the working of the code.


                                              ---END OF SECTION---

5. WORKING DEMONSTRATION

The working demonstration video is uploaded, named as Demonstration.mp4.
Turned On with "Key Phrase": 'turn on'.

Turned Off with "Key Phrase": 'turn off'.


                                              ---END OF SECTION---

6. FUTURE SCOPE

This can be actively implemented in Smart Home Security solutions after being improved with a Machine Learning model design. The Arduino cannot be re-programmed unless a USB is inserted to it and burned accordingly after being fitted into a working device. The bluetooth discovery of the HC05 can be programmed and hidden; providing access to only one client once paired. Moreover, this is cheaper than other alternatives available in the market. Approximate expense of this project was around Rs.800 only.


                                              ---END OF SECTION---

About

A simple Voice Recognition Hardware implementation demonstrating a system that can be used for smart homes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages