16
1 Final Report, Lab 3 Security System—Voice Password Team 2: Alyson Bonk, Richard Pooler, Rhian Kogan EE 300W | Section 1 | Prof. Tim Wheeler | TA Sonny Smith Figure 1: Voice Recognition Circuit

Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

  • Upload
    hakien

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

1

Final Report, Lab 3Security System—Voice Password

Team 2: Alyson Bonk, Richard Pooler, Rhian KoganEE 300W | Section 1 | Prof. Tim Wheeler | TA Sonny Smith

Figure 1: Voice Recognition Circuit

Page 2: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

2

ContentsIntroduction............................................................................................................................................................... 3

Rationale...................................................................................................................................................................... 3

APPROACH................................................................................................................................................................. 3

Implementation....................................................................................................................................................... 4

VERIFICATION TESTING........................................................................................................................................ 4

VALIDATION TESTING........................................................................................................................................... 6

INTEGRATION TESTING RESULTS.......................................................................................................................7

Conclusion................................................................................................................................................................... 7

Appendix...................................................................................................................................................................... 8

APPENDIX A: Financial Page with Bill of Materials...............................................................................8

APPENDIX B: Gantt Chart..................................................................................................................................9

APPENDIX C: LabVIEW Block Diagram....................................................................................................10

APPENDIX D: LabVIEW Front Panel..........................................................................................................11

APPENDIX E: C++ mbed Code.......................................................................................................................12

Page 3: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

3

Introduction

Team “Penn State Lives Here” has created a verbal password recognition security system that grants or denies home access to a user. The security system was created with the three following requirements:

1. The subsystem shall establish a verbal password.2. The subsystem shall permit access when a correct verbal password is given.3. The subsystem shall deny access when an incorrect verbal word is provided.

In 2011, there were 130 burglaries1 in State College, a 20% increase from 2007. With crime rates rising, it is imperative that people take additional steps to protect themselves and their belongings. The verbal password recognition security system provides an extra security blanket to the homestead.

Rationale

The EasyVR voice recognition component has a microphone for the user to verbally input a password. Accompanied with the microphone is software to recognize the word(s). The software is capable of recognizing four languages and over 50 words in each language.

The mbed interfaces with LabVIEW, the EasyVR, and the CAN bus. The mbed runs C++ code, compiled on mbed.org and saved onto the mbed as a .bin file.

APPROACH When the voice recognition module is ready (mbed reset button has been pressed and LabVIEW code is running), the user speaks into the microphone. If the password is recognized by the EasyVR, then the mbed sends an RPC variable to LabVIEW, and LabVIEW allows access for the user. If the user’s password is not recognized, then the mbed must be reset in order to retry the password.

The mbed microcontroller acts as the slave in the fully implemented security system. There is another mbed which acts as the master for the entire class.

The CAN bus transceiver is used for integration. We were given two CAN busses, but only needed one because one CAN has the ability to read and write.

The CAN bus interfaces between the master mbed and the slave mbed. The slave will begin running the module when the master prompts it.

A full Bill of Materials can be found in APPENDIX A.

1 http://www.city-data.com/crime/crime-State-College-Pennsylvania.html

Page 4: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

4

Implementation

VERIFICATION TESTING Verification testing ensured that all engineering requirements were met. This included tests to verify the following:

mbed receives information from EasyVR mbed sends an RPC variable to LabVIEW EasyVR recognizes voice commands EasyVR turns on CAN bus communicates between master mbed and slave.

The mbed successfully received information from the EasyVR. We verified this through C++ code and the LEDs on the mbed. In the test C++ code, we use a while loop that turns on all LEDs if the device is readable.

Figure 1: C++ code testing if the EasyVR is read by mbed.

The design only required LabVIEW to read an RPC variable. The test for this was simple, requiring only an indicator on LabVIEW to show us the value being read by the RPC Read function.

Figure 2: LabVIEW with Indicator verifying the RPC Variable

We had to verify that the EasyVR was not only readable, that the voice commands were recognized. This was difficult because the lab was always loud, so the EasyVR would pick up unrecognizable words. To counter this, we tested using two different methods.

//If the device is readable, turn on all LEDs.

while (device.readable()!=0) {

led1=1;led2=1;led3=1;led4=1;

}

Page 5: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

5

The first method uses PuTTy to show if inputs are recognized. If an input is recognized, its decimal value is displayed on the computer. If nothing is recognized, “Nothing Read” is displayed.

Figure 3: C++ Code displayed onto PuTTy

The second method used LEDs to make sure the device could read numbers. The C++ code uses an if-statement to turn on an LED if the numbers 1-8 are spoken into the microphone.

Figure 4: C++ code

Each of the following LED sequences corresponds to the recognition of a user voice input (1-4):

Figure 5: LED Recognition Key

while (1) {if(device.getc()!=0){

rchar=device.getc();pc.printf("Read:", %d, rchar);}

else{pc.printf("Nothing Read");}

wait(0.5);}

while (device.readable()!=0) {} if (device.getc()=='s') { device.putc(' '); rchar=device.getc(); if (rchar=='B') led1=!led1; if (rchar=='C') led2=!led2; if (rchar=='D') led3=!led3; if (rchar=='E') led4=!led4; if (rchar=='F') led1=!led1; if (rchar=='G') led2=!led2; if (rchar=='H') led3=!led3; if (rchar=='I') led4=!led4;

}

Page 6: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

6

To verify that the EasyVR turns on, LED 1 turns on when the device turns on. This verification test code was implemented into the main code for the mbed. It improved the user experience because the user knows when the device is ready to use.

Figure 6: LabVIEW with Indicator verifying the RPC Variable

VALIDATION TESTING Validation testing ensured mission objectives were met. The following mission objectives were validated:

The system shall grant access when the correct password is spoken. The system shall deny access when the incorrect password is spoken. The system shall display the date and time. An LED on LabVIEW must display access granted or access denied. The LabVIEW front panel must display directions on how to use the security system.

The serial RPC variable was used to validate that the system grants and denies access correctly. In the C++ code, an RPC variable was declared to denote the status of access. LabVIEW reads the RPC variable and checks to see if it reads “true” or “false”. If true is read, access is granted. If false is read, access is denied. This is indicated on the front panel with an LED.

Figure 7: C++ Code of RPC Variable

Figure 8: LabVIEW LED Status

device.putc('b'); wait(0.2); while (device.getc()!='o') { device.putc('b'); led1 = 1; wait(0.2);

char ledStat='f';RPCVariable<char> rpcLEDStat(&ledStat, "Status");

Page 7: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

7

The front panel on LabVIEW displays the date and time, accompanied with directions on how to use the security system. A display of the front panel can be found in APPENDIX D.

INTEGRATION TESTING RESULTS The integration testing resulted in successful communication between the slave mbed and the master mbed. To perform the integration testing, a CAN bus was used. The mbed acted as a slave and communicated to a master mbed via CAN bus.

Each team was assigned a device id. When the master mbed calls for the device id, the status (access granted/denied) is sent from the slave to the master. An “if- statement” checks to see if the master mbed is calling for data from the slave mbed. The status is then written to the master mbed. The following code allowed for CAN communication:

Figure 9: CAN C++ code

Conclusion

“Penn State Lives Here” has created a verbal password recognition security system that grants or denies home access to a user. The security system establishes a verbal password and permits or denies home access on the basis of the verbal password accuracy. The EasyVR voice recognition component with preloaded software allows the circuit to recognize words. Using a combination of LabVIEW and C++ to program an mbed microcontroller, the circuit is able to tell the home security system if the user has entered the correct password. In conjunction with the other teams from EE300W section 001, team “Penn State Lives Here” integrated the voice recognition system with several other security systems using the CAN bus.

if(can.read(msg)){if(msg.id == DeviceID){

can.write(CANMessage(1000, &verifymsg, 1));}

}

Page 8: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

8

Appendix

APPENDIX A: Financial Page with Bill of MaterialsItem Part number Quantity Price/unit Price Source

mbed LPC1768 (Cortex-M3) 1 $49.95 $49.95

https://www.sparkfun.com/products/9564?gclid=CNbM5LWzqLsCFclQOgodoEUAaQ

Tranceiver MCP2551-I/P 1 $1.02 $1.02

http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010405#pricindAndSamples

EasyVR RB-Tig-01 1 $49.95 $49.95

http://www.robotshop.com/en/easyvr-speech-voice-recognition-module.html?utm_source=google&utm_medium=base&utm_campaign=GoogleUSA

120 Ω Resistor 291-120/REEL-RC 1 $0.01 $0.01

http://www.mouser.com/ProductDetail/Xicon/291-120-REEL-RC/?qs=sGAEpiMZZMtlubZbdhIBINPiDWYTl17dKgbEey5mzIo%3d

Breadboard w/ wire microtivity IB751 1 $13.49 $13.49

http://www.amazon.com/microtivity-IB751-750-point-Experiment-Breadboard/dp/B008A9UORM/ref=sr_1_2?ie=UTF8&qid=1386773601&sr=8-2&keywords=bread+board

LaborRick Pooler, Rhian Kogan, Alyson Bonk 3 $35.00/hr $2,800

Elizabeth Pooler, Teresa Kogan,Susan Bonk

Total Price= $2,914.42

Page 9: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

9

APPENDIX B: Gantt Chart

mbed Familiarization

EasyVR Familiarization

Circuit Design

Circuit Build

C++ Design

LabVIEW Design

RPC Integration LabVIEW

RPC Integration C++

Verification Test

Validation Test

Integration

Integration Test

Final Report

Week 1 Week 2 Week 3 Week 8Week 4 Week 5 Week 6 Week 7

Page 10: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

10

APPENDIX C: LabVIEW Block Diagram

Page 11: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

11

APPENDIX D: LabVIEW Front Panel

Page 12: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

12

APPENDIX E: C++ mbed Code

#include "mbed.h"#include "SerialRPCInterface.h"#include "CAN.h"// EasyVR Speech Recognition and Speech Synthesis DemoDigitalOut led1(LED1);DigitalOut led2(LED2);DigitalOut led3(LED3);DigitalOut led4(LED4);Serial device(p13, p14); // tx, rxSerialRPCInterface SerialInterface(USBTX,USBRX); //USB virtual com port can be used to watch VR command responsesCAN can(p9, p10);

char ledStat='f';RPCVariable<char> rpcLEDStat(&ledStat, "Status");

char first=0;char second=0;int DeviceID= 1000;

CANMessage msg;

int main() { char verifymsg = 0; char rchar=0; int n=0; int password[4]; //wake up device - needs more work and a timeout device.putc('b'); wait(0.2); while (device.getc()!='o') { device.putc('b'); led1 = 1; wait(0.2); } led2=1; while (1) { wait (1);

//(DeviceID, &canStat, 1) device.putc('i'); //Start Recognition device.putc('D'); //Use Wordset 3 - the numbers 1..10//Use built-in speaker independent numbers (0..10) and listen for a number while (device.readable()!=0) {} if (device.getc()=='s') { device.putc(' '); rchar=device.getc(); if (rchar=='B') led1=!led1; if (rchar=='C') led2=!led2; if (rchar=='D') led3=!led3;

Page 13: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

13

if (rchar=='E') led4=!led4; if (rchar=='F') led1=!led1; if (rchar=='G') led2=!led2; if (rchar=='H') led3=!led3; if (rchar=='I') led4=!led4; if (rchar=='B') { password[n++]=1; } else if (rchar=='C'){ password[n++]=2; } else if (rchar=='D'){ password[n++]=3; } else if (rchar=='E'){ password[n++]=4;} else if ((rchar=='F')|| (rchar=='G')||(rchar=='H')||(rchar=='I')){ password[n++]=5; }

} if ((password[0]==2) && (password[1]==2)){ ledStat= 't'; verifymsg=1; } else{ verifymsg=0; ledStat='f'; } if(can.read(msg)){ if(msg.id == DeviceID) { can.write(CANMessage(1000, &verifymsg, 1)); }

} }

}

Page 14: Introduction - Sites at Penn State - WordPresssites.psu.edu/.../uploads/sites/1662/2012/11/300W-Final …  · Web viewAccompanied with the microphone is software to recognize the

14