You are on page 1of 45

VOICE BASED APPLIANCE CONTROL

Project report submitted in partial fulfilment of the requirements For the award
of the degree of
BACHELOR OF TECHNOLOGY In ELECTRONICS AND COMMUNICATION ENGINEERING
By K.Sowjanya(09241A04A6) G.Sowjanya (09241A04A7) M.Sridevi (09241A04B0) K.Sushm
a(09241A04B5)
Under the guidance of Mr.Y.Sudarshan Reddy (Assistant Professor)
Page i

VOICE BASED APPLIANCE CONTROL
Department of Electronics and Communication Engineering GOKARAJU RANGARAJU INSTI
TUTE OF ENGINEERING & TECHNOLOGY, BACHUPALLY, HYDERABAD-72 2013 GOKARAJU RANGARA
JU INSTITUTE OF ENGINEERING & TECHNOLOGY Hyderabad, Andhra Pradesh.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
CERTIFICATE
This is to certify that the project report entitled “IMPLEMENTATION OF DIRECT DIGI
TAL SYTHESIZER AD9850 USING ARDUINO UNO” that is being submitted by k.Sowjanya,G.S
owjanya,M.Sridevi,K.sushmaunder the guidance of Mr.Y.Sudarshan Reddy in partial
fulfilment for the award of the Degree of Bachelor of Technology in Electronics
and Communication Engineering to the Jawaharlal Nehru Technological University i
s a record of bonafide work carried out by them under my guidance and supervisio
n. The results embodied in this project report have not been submitted to any ot
her University or Institute for the award of any graduation degree.
Prof Ravi BillaMr.Y.SudarshanExternal Examiner HOD, ECE Dept, GRIET,Hyderabad (I
nternal Guide) Asst.Professor,ECEDept, GRIET, Hyderabad
Page ii

VOICE BASED APPLIANCE CONTROL
ACKNOWLEDGEMENT
We have immense pleasure in expressing our thanks and deep sense of gratitude to
our guide Mr.Y.SudarshanRedddy, Assistant Professor, Department of Electronics
and Communication Engineering, G.R.I.E.T for his guidance throughout this projec
t.
We also express our sincere thanks to Prof. Ravi Billa, Head of the Department,
G.R.I.E.Tfor extending his help.
We wish to express our profound sense of gratitude to Prof. P. S. Raju, Director
, G.R.I.E.Tfor his encouragement, and for all facilities to complete this projec
t.
Finally we express our sincere gratitude to all the members of faculty and my fr
iends who contributed their valuable advice and helped to complete the project s
uccessfully.
K.Sowjanya G.Sowjanya
(09241A04A6) (09241A04A7)
M.Sridevi (09241A04B0) K.Sushmasree (09241A04B5)
Page iii

VOICE BASED APPLIANCE CONTROL
ABSTRACT
This is a wireless, voice control system. People can control almost all the appl
iances at home including lights, fans or even back ground music. Microphone is i
nterfaced with voice chip to enable voice based recognition.special characters a
re used to control various peripheral devices connected.EasyVR ,The goal of our
project is to design real time voice controlled appliances which brings more con
venience to people's lives.
Hardware:
Aurduino Uno Board Triac Shield EasyVR Shield
Page iv

VOICE BASED APPLIANCE CONTROL Page v .

2 Basic structure of triac……………………………………………… 3. R…………………………………………………………..29 Page vi .2 EasyVR chip…………………………………………………………………………….Triac shield 2.EasyVR Shield 3.VOICE BASED APPLIANCE CONTROL LIST OF FIGURES 1.1 1.Arduino 1.2 ATMEGA 328 pin mapping……………………………………………… 2..1Triac symbol……………………………………………………………………………...1 Arduino board………………………………………………………………………….1 EasyVR module…………………………………………………………………………12 3..7 2.

EasyVR Shield -Introdution………………………………………………………………..Introduction to Arduino……………………………………………………………..VOICE BASED APPLIANCE CONTROL Contents: 1.Triac Shield -Triac…………………………………………………… 3.…11 -Features…………………………………………………………………. Page vii .1 2.

VOICE BASED APPLIANCE CONTROL Page viii .

a USB connection. The Arduino Uno is a microcontroller board based on the ATmega328.1 Arduino Board Page 1 . It contains everything needed to support the microcontroller. simply connect it to a computer with a USB cable or power it with a AC-to-DC ad apter or battery to get started. 6 analog input s. a 16 MHz ceramic resonator. a power jack. a nd a reset button. an ICSP header. It has 14 d igital input/output pins (of which 6 can be used as PWM outputs). Fig 1.VOICE BASED APPLIANCE CONTROL Introduction to Arduino .

5 KB used by bootloader 2 KB (ATmega328) 1 KB (ATmega328) 16 MHz Page 2 . The adapter can be connected by plugging a 2. 6-20V 14 (of which 6 provide PWM output) 6 40 Ma 50 mA 32 KB (ATmega328) of which 0. Extern al (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or batte ry.1mm center-positive plug into t he board's power jack. Leads from a battery can be inserted in the Gnd and Vin p in headers of the POWER connector.VOICE BASED APPLIANCE CONTROL Features of Uno board Microcontroller Operating Voltage ATmega328 5V Input Voltage (recommended) 7-12V Input Voltage (limits) Digital I/O Pins Analog Input Pins DC Current per I/O Pin DC Current for 3.3V Pin Flash Memory SRAM EEP ROM Clock Speed POWER The Arduino Uno can be powered via the USB connection or w ith an external power supply. The power source is selected automatically.

3 Arduino Programming Window Page 3 .2 ATmega Pin Mapping Arduino programming Click on the Arduino executable w hich has the Arduino logo The following screen com Fig 1.VOICE BASED APPLIANCE CONTROL Fig 1.

For the sketch to work on your Arduino Uno. From the menu select Uno.VOICE BASED APPLIANCE CONTROL The programs written for Arduino are called sketches. it will be map ped as a serial port.4 Arduino Port selection When you connect your Arduino Uno to the USB port of your laptop. there are two hardware related settings you need to make in th e Arduino IDE – Board Serial Port For selecting the board. select the Device Manager Page 4 . Fig 1. f ollow the following procedure Right click on My Computer Select the Manage option In the pop up screen for Com puter Management. go to the Tools tab and select Board. To know the serial port to which your Arduino is mapped.

5 Checking for connected Port In the Arduino IDE. select the Serial Port a s the port to which the Arduino is mapped.VOICE BASED APPLIANCE CONTROL Expand the Ports item. the Arduino Uno will appear as one of the drop down items Fig 1. Page 5 .

} Where setup( ) is the preparation. } void loop() { statements. loop() is the execution. Both functions are required for t he program to work.VOICE BASED APPLIANCE CONTROL The basic structure of the Arduino sketch is fairly simple and has two required functions: void setup() { statements. Page 6 .

Because of its bidirectional conduction property. triac is a thr ee terminal.1 Triac symbol Construction of a Triac: As mentioned above. It incorporates two SCRs connected in inverse parallel with a common gate terminal in a single chip devi ce. four layer bidirectional semiconductor device that controls ac power whereas an SCR controls dc power or forward biased half cycles of ac in a load. four layer bilateral semiconductor device. The triac also differs from the SCR in that either a positi ve or negative gate signal triggers it into conduction. „Tri‟-indicates that the device has three terminals and „ac‟ indicates that the dev ice controls alternating current or can conduct in either direction. Unlike the SCR. the triac conducts in either direc tion when turned on. Thus the triac is a thre e terminal. As seen. The gate terminal G makes ohmic contacts with both the N and P materials . Fig 2.VOICE BASED APPLIANCE CONTROL INTRODUCTION TO TRIAC SHIELD Triac shield consists of triac and opto-isolator wh ich are explained below: Construction and Operation: The triac is another three- terminal ac switch that is triggered into conduction when a lowenergy signal is applied to its gate terminal. it has six doped r egions. “Triac” is an abbreviation for three terminal ac swi tch. The arrangement of the triac is shown in figure. This Page 7 . Triacs of 16 kW rating are r eadily available in the market. the triac is widely used in t he field of power electronics for control purposes.

Electrical equival ent circuit and schematic symbol are shown in figure. As in case of SCR. (MT1). the smaller the supply voltage at which the triac is turne d on. Cons equently four different possibilities of operation of triacexists. the lar ger the gate current. main terminal 2 (MT2) and gate G.b and figure.VOICE BASED APPLIANCE CONTROL permits trigger pulse of either polarity to start conduction. it has become common practice to specif y all voltages and currents using MT1 as the reference.c respectively . Fig 2. Since the triac is a bilateral device. the term “anode” and ”cathode” has no meaning. Terminal MT2 and gate are positive with respect to terminal MT1 Page 8 . To avoid confusion. here too. and therefore. Triac can conduct current irrespective of the voltage polarity of terminal s MT1 and MT2 with respect to each other and that of gate and terminal MT2. terminals are designated as main terminal 1. They are: 1.2 Basic Structure of Triac Operation and Working of a Triac: Though the tr iac can be turned on without any gate current provided the supply voltage become s equal to the breakover voltage of the triac but the normal way to turn on the triac is by applying a proper gate current.

it require s a positive gate trigger.VOICE BASED APPLIANCE CONTROL When terminal MT2 is positive with respect to terminal MT1 current flows through path P1N1-P2-N2. The two junctions P2-N1 and P1 . forced commutation by reverse-biasing cannot be employ ed. for bidirectional control and uniform gate t rigger modes 2 and 3 are preferred. Generally. The triac is now said to be neg atively biased. the current flow path is P2-N1P1-N4. it has replaced S CR by virtue of its bidirectional conductivity. phase control circuits. 4. 2. A posit ive gate with respect to terminal MT1 forward biases the junction P2-N2 and the breakdown occurs as in a normal SCR. Thou gh the triggering mode 1 is more sensitive compared to modes 2 and 3.N4 are f orward biased whereas junction N1-P1 is blocked. trigger mode 4 should be avoided especially in circuits where h igh di/dt may occur. which is usually impracticable. are some of its main applications. current carriers are injected and therefore. Te rminal MT2 is negative but gate is positive with respect to terminal MT1 Though the flow path of current remains the same as in mode 3 but now junction P2-N2 is forward biased. the triac is the most widely used member of t he thyristor family. However. The triac is now said to be positively biased. 3. Terminal MT2 is positive but gate is neg ative with respect to terminal MT1 Though the flow path of current remains the s ame as in mode 1 but now junction P 2-N3 is forward biased and current carriers injected into P2 turn on the triac. Motor speed regulation. in many of control applications. power switches etc. temperat ure control. the triac is turne d on. However.Terminal MT2 and gate are negative with re spect to terminal MT1 When terminal MT2 is negative with respect to terminal MT1 . The sensitivity of triggering modes 2 and 3 is high and in case of marginal triggering capability negative gate pulses should be used. So turn-off is either by current starvation. A negative gate with respect to terminal MT1 injects current car riers by forward biasing junction P2-N3 and thus initiates the conduction. illumination control. Applications of Triac Next to SCR. In fact. liquid level control. the triac is le ss versatile than the SCR when turn-off is considered. Page 9 . Because the triac can con duct in either direction. The two junctions P1-N1 and P2-N2 are forward biased whereas j unction N1 P2 is blocked.

The first is the frequency handling capability produced by the limiting dv/dt at which the triac remains blocking when no gate signal is applied. control . This beam travels across a transparent gap and is picked up b y the "receiver. while keeping those circuits or systems electrically isolated from each other. Optoisolators are used in a wide variety of communications." which converts the modulated light or IR back into an electric al signal. and monitoring systems. or laser diode for si gnal transmission. although the input and output amplitudes (signal strengths) often diffe r. also known as an optical coupler or optocoupler. and has the appearance of a n integrated circuit (IC) or a transistor with extra leads. The electrical output waveform is identical to the electrical input w aveform. an optoisolator consists of an l ight-emitting diode (LED). and a photosensor for signal reception. There are two limitations enforced on the use of triac at present state of commercially available devices (200 A and 1. so that the limitation of frequency is at the power level of 50 Hz. In its simplest form.000 PRV). The "transmitter" tak es the electrical signal and converts it into aa beam of modulated visible light or infrared (IR). is a semiconductor device that allows signals to be transferred between circuit s or systems. The optoisolator is enclosed in a single package. This dv/dt val ue is about 20 Vmicros-1 compared with a general figure of 200 Vmicro s-1 for th e SCR. When high frequencies and high dv/dt are involved then the backto-back SCRs cannot be replaced by the triac. The s ame dv/dt limitation means the load to be controlled is preferably a resistive o ne.VOICE BASED APPLIANCE CONTROL or else by ac line commutation. Opto-isolator: An optoisolator. Page 10 . IRED (infrared-emitting diode).

Alternatively.) Photodiode opto-isolators Diode opto-isolators employ LEDs as source s of light and silicon photodiodes as sensors. The energy is harvested by draining the charge through an exte rnal high-impedance path. Page 11 . it modu lates the flow of energy from an external source.2%. When the photodiode is reverse-bi ased with an external voltage source. If a transient occurs on the telephon e line (and these are common). Two opto isolators are employed in the analog section of the device: one for upstream sig nals and the other for downstream signals.7 V.3 Optoisolator A common application of an optoisolator is in a specialized modem that allows a computer to be connected to a telephone line without risk o f damage from electrical transients (also called "surges" or "spikes"). The rate of charge is proportional to the intensity o f incoming light. The diode itself does not generate energy. modems that use optoi solators provide superior protection against transients compared with modems inc orporating electrical surge suppressors alone. For this reason. (An electrical surge suppressor s hould be installed between the optoisolator and the telephone line for optimum p rotection. in the absence of external bias the diod e converts the energy of light into electric energy by charging its terminals to a voltage of up to 0. the computer will be unaffected because the optic al gap does not conduct electric current.] This mo de of operation is called photovoltaic mode. incoming light increases the reverse curre nt flowing through the diode. the ratio of current transfer can reach 0.VOICE BASED APPLIANCE CONTROL Fig 2. This mode of operation is call ed photoconductive mode.

The EasyVR module can be used with any host with an UAR T interface powered at 3.3V – 5V.VOICE BASED APPLIANCE CONTROL INTRODUCTION TO EASYVR: EasyVR is the second generation version of the successfu l VRbot Module. Some application examples include home automation. It is a multipurpose speech recognition module designed to easil y add versatile. Fig 3. such as voice controlled light switches.1 EasyVR Module Page 12 . or adding “hearing” to the most popular robots on the market. robust and cost effective speech recognition capabilities to vi rtually any application. lock s or beds. such as PIC and Arduino boards.

Module can be used with any host with an UART interface (powered at 3 .5V) Simple and robust documented serial protocol to access and program throug h the host board 3 GPIO lines (IO1.VOICE BASED APPLIANCE CONTROL EasyVR Features: A host of built-in Speaker Independent (SI) commands for ready to run basic contr ols. Easy -to-use and simple Graphical User Interface to program Voice Command s and audio. in the followings languages: o English (US) o Italian o German o French o S panish o Japanese Supports up to 32 user-defined Speaker Dependent (SD) triggers or commands as well as VoicePasswords. PWM audio output that supports 8Ω speakers. IO2. SD custom commands can be spoken in ANY l anguage. IO3) that can be controlled by new protoc olcommands. Sound playback of up to 9 minu tes of recorded sounds or speech. Page 13 .3V.

2 EasyVR Chip Page 14 .VOICE BASED APPLIANCE CONTROL Technical specifications Physical dimensions and pin assignment Fig 3.

VOICE BASED APPLIANCE CONTROL Page 15 .

3 Serial Data Frame Format Page 16 .VOICE BASED APPLIANCE CONTROL Fig 3.

so they are referenced to the internal 3. It could also be connected to an external audio amplifier to drive lower impedance loudspeakers It is possible to connect higher impedance loads such as headphone s. Audio Output The EasyVR audio output interface is capable of directly driving an 8Ω speaker. General Purpose I/O Since the EasyVR communication interface takes two pins of the host controller.2K Operating Voltage 3V Almost flat frequency response in range 100Hz– 20kHz I f you use a microphone with different specifications the recognition accuracy ma y be adversely affected. If you need to interface to circuits using adifferent supply. Some of these are outlined below (here Ionindi cates any one of the three I/O pins of the EasyVR). that can be controlled with the communication protocol.VOICE BASED APPLIANCE CONTROL Microphone The microphone provided with the EasyVR module is an omnidirectional electret co ndenser microphone (Horn EM9745P-382): Sensitivity -38dB (0dB=1V/Pa @1KHz) Load Impe dance 2. provided that you scale down the output power according to the speaker rating s. to get those pins back for basic tasks. No other kind of microphone is supported by the EasyVR. a few spare I/O pins are provided. Page 17 . The exact resistor value depends on the headphone power ratings and the desired output volume (usually in the order of 1 0kΩ). there are a n umber of solutions you can adopt. The three I/O pins IO1–IO3 are connected directly to the embedded microcontroller on t he EasyVR module. such as lighting an LED.0V regulated power sup ply. for example using a series resistor.

Bridge mode – You can control the module using a software serial library and conne ct to the module with the EasyVR Commander from your PC.VOICE BASED APPLIANCE CONTROL Quick start for using the module EasyVR on Arduino You can connect the EasyVR module to an Arduino board basically in two ways: 1. since it allows simple communication with both the Arduinomicrocontroller and the PC.4 Bridge Mode Connection Page 18 . All the provided examples for Ardui no manage the bridge mode automaticallywhen the EasyVR Commander requests a conn ection. but you need to change the connections o nce you want to control the module from the microcontroller Bridge mode This is the preferred connection mode. Fig 3. Adapter mode – You can use the Arduino board as a USB/Serial adapter b y holding the microcontroller in reset. with the same pin confi guration 2.

Connect the EasyVR module to your Arduino board as outlined before Page 19 . it does not rely on the AVR microcontroller to do any software b ridge between communication pins. Using this method also allows you to download a Sound Table to the EasyVR module. provided you alsoconfigure the module to start in bo ot mode Fig 3. with Reset shorted to GND. soit can be used to check your hardware in cas e of connection problems. you need to remove the short (yellow wire) and move the ETX/ERXco nnection to other pins.5 Adapter Mode Connection This configuration. like the above bridgemode. To use themodule from the Arduino mi crocontroller. The example code uses pin 12 for ETX and pin 13 for ERX. so it should work on all Arduino boards. The latest version of EasyVR Commander (sinc e 3.1) does not rely on thatfeature anymore. Adapter mode This connection scheme has the advantage of working with any Arduino board that has an on-boardUSB/Serial adapter and not needing a spare input pin to enter bri dge mode.VOICE BASED APPLIANCE CONTROL Automatic bridge mode used to be supported only on Arduino boards with a bootloa der implementingEEPROM programming. i s for connection with the EasyVR Commander.x) and Arduino libraries (since 1. Arduino software Follow these few steps to start playing with your EasyVR module and Arduino: 1.1. Also.

Connect the /XM pin of J4 on the EasyV R module for boot mode (see Flash Update for a possible circuit) 3.6 EasyVR Library Installation To check everything is working fine: 1. Make sure you activate bridge mode (either manually or automatically) or you use ada pter mode 2. Open the EasyVR Commander and select the Arduino serial port Page 20 . Fig 3. connect an 8Ω speaker to J2 header 3. Open the EasyVR Commander and connect to the Arduino serial port (s ee Getting Started) To download a new sound-table: 1. Power ON aga in the EasyVR module and the Arduino board (reconnect the USB cable) 4. If you want audio output. Make sur e you activate bridge mode (either manually or automatically) or you use adapter mode 5. Connect your Arduino board to your PC via USB . Power OFF the EasyVR modul e (for example removing the USB cable) 2. Connect the sup plied microphone to the MIC (J3) connector 4.VOICE BASED APPLIANCE CONTROL 2. Copy the EasyVR library to your Ar duino “libraries” folder on your PC 5.

Fig 3.7 Testing EasyVR Programming on Arduino To test the EasyVR module with your Arduino programming IDE: 1. See comments on top of the sketch for usage details Page 21 . Make sure you di d not activate bridge mode manually 2. Open the example sketch TestEasyVR from y our IDE menu “File” > “Examples” > “EasyVR” 3. While disconnected choose “Update Sound Table” from the “Tools”menu . Upload the sketch and open the “Serial Monitor indow 4.VOICE BASED APPLIANCE CONTROL 6.

Page 22 . that willuse the provided libraries .VOICE BASED APPLIANCE CONTROL When the EasyVR Commander is connected. you can also generate a template code fo r Arduino.

8 Pin Structure of EasyVR Shield Page 23 .VOICE BASED APPLIANCE CONTROL Technical specifications Physical dimensions and pin assignment Fig 3.

oSW – Software serial mode Page 24 .VOICE BASED APPLIANCE CONTROL Jumper settings J12 – Operating mode This jumper selects the operating mode of the EasyVR Shield a nd it can be placed in one of four positions: oUP – Flash update mode Use it for f irmware updates or to download sound table data to the on-board flash memory fro m theEasyVR Commander. oPC – PC connection mode Use it for direct connection with the EasyVR Command er. In this mode. oHW – Hardware serial mode Use it for controlling the E asyVR module from your Arduino sketch through the hardware serial port(using pin s 0-1). the Arduino controller is heldin reset and only the embedded U SB/Serial adapter is used. The EasyVR module is set in boot m ode. In this mode. the Arduino controller is held in reset and only the embeddedUSB/Serial adapter is used.

If you want audio outpu t. that willuse the provided libraries . LEDs A green LED (D6) is connected to IO1 pin and can be controlled by the user‟s progr am to show feedbackduring recognition tasks. you can connect theEasyVR Commander leaving the jumper in the SW position. Connect the supplied microphone to the MIC IN (J 11) connector. Copy the EasyVR library to your Arduino “libraries” folder on your PC 5.VOICE BASED APPLIANCE CONTROL Use it for controlling the EasyVR module from your Arduino sketch through a soft ware serial port(using pins 12-13). either wire an 8Ω speaker into the screw terminals (J10) or connectheadphones t o the 3. for example. you can also generate a template code for Arduino. Page 25 . Connect your Arduino board to your PC via USB. provided that therunning sketch implements bridge mode (see librarie s). Set the jumper (J12) in the SW position 2. Open t he example sketch TestEasyVR from your IDE menu “File” > “Examples” > “EasyVR” 3. You can also connect the EasyVR Commander in this mode. just make sure the monitor window is closed. Upload the sketch and open the “Serial Monitor” window 4. All you need is to write actions for each recognized co mmand. When the EasyVR Commande r is connected.The red LED (D5) lights up when you set the shield t o flash update mode (see Jumper settings). See comments on top of the sketch fo r usage details Keep in mind that if you have a “bridge” code running (all examples do) on Arduino. This LED is on by defa ult after reset or power up. Quick start for using the Shield Follow these few steps to start playing with your EasyVR Shield and Arduino: 1. Insert the EasyVR Shield on top of your Arduino board 2.5mm output jack (J9) 3. To test the Shield with yo ur Arduino programming IDE: 1. 4.

115200 b aud. 10 . with zero or more additional argument bytes. Each co mmand sent on the TX line. Since the EasyVR serial interface also is software-based. respectively on the TX and RX lin es. and 100 ms . That accountsfor slower or fas ter host systems and therefore suitable also for software-based serial communica tion (bitbanging).9 ms. again on the TX and RX lines.VOICE BASED APPLIANCE CONTROL EasyVR Programming Communication Protocol Introduction Communication with the EasyVR module uses a standard UART interface compatible with 3. receives an answer on theRX line in the form of a status byte followed by zero or more a rguments.90 ms.1 s. A typical connection to an MCU-based host: The initial configuration at power on is 9600 baud. chosen among lower-caseletters. accordin g to the powering voltage VCC. to allow the EasyVR to get backlistening to a new character. 1 bit stop. that is initiallyset to 20 ms and can be selected later in t he ranges 0 . a v ery short delay might be needed beforetransmitting a character to the module. No parity. There is a minimum delay before each byte sent out from the EasyVR mod ule to the RX line. which can be divided in two main groups: Command and status characters. 8 bit data. The baud rate can bechanged later to operate in the range 9600 .3-5V TTL/CMOS logical levels. Command arguments or status deta ils. es pecially if the host is very fast. The communication protocol only uses printable ASCII characters. Page 26 . spanning the range of capitalletters.

The reply is aborted if any other characteris received and so there is no need to read all the bytes of a reply if not required. using the space ch aracter. andthen check that all devices are properly turne d on and start the EasyVR Commander. Page 27 . EasyVR Commander The EasyVR Commander software can be used to easily configure your EasyVR module connected to yourPC through an adapter board. but the template conta ins all thefunctions or subroutines to handle the speech recognition tasks. or by using the microcontroller h ost board with the provided “bridge” program(available for ROBONOVA controller board . and then go with the “Connect” command.VOICE BASED APPLIANCE CONTROL The communication is host-driven and each byte of the reply to a command has to be acknowledged by thehost to receive additional status data. You can define groups of commands or passwords and generate a basic code template to handle them. Gett ing Started Connect the adapter board or a microcontroller host board with a run ning “bridge” program1 to your PC. Invalid combinations o f commands or arguments are signaled by a specific status byte. Arduino 2009/UNO. It isrequired to ed it the generated code to implement the application logic. Parallax Basic Stamp). Select the serial port to use from the tool bar or the “File” menu.

Trigger words are used to start the recognition process Group .where you may add user-defined SD commands Passwor d .9 EasyVR Commander There are four kinds of commands in the software (see Figure 3 and Figure 6): Tri gger .built-in set of SI commands (for instance in Figure 3 above.is a special group where you have the built-in SI trigger word "Robot" an d you may add one user-defined SD trigger word. the Wordset 1 is selected) Page 28 .VOICE BASED APPLIANCE CONTROL Fig 3.a special group for "vocal passwords" (up to five). using Speaker Verificati on (SV) technology Wordset.

it reads back al l the user-defined commands andgroups.VOICE BASED APPLIANCE CONTROL Speech Recognition The recognition function of the EasyVR works on a single group at a time. When EasyVR Commander connects to the module. Fig 3. so tha t users need to grouptogether all the commands that they want to be able to use at the same time. there is too much background noise or whe n the second word heard is too different from thefirst one. You can add a new command by first selecting the group in wh ich the command needs to be created andthen using the toolbar icons or the “Edit” me nu. A command should be given a label and then it should be trained twice with t he user's voice: the user will beguided throughout this process (see Figure 4) w hen the "Train Command" action is invoked. Page 29 . command training will be cancelled.10 Training Phases of EasyVR Guided training dialog After clicking on Phas e 1 or Phase 2 buttons. Errors may happen when the user‟s voice is notheard correctly. which are stored into the EasyVR module n on-volatile memory. remember to start speaking only when you see this little window: If any error happens.

they have been trained with a similarpronunciation). by using the icon on the toolbar or the “Tools” menu. For example.to make sure the trained commands can be recognized successfully. The selected group of comma nds can also be tested. Page 30 .VOICE BASED APPLIANCE CONTROL Alert dialog in case of conflictThe software will also alert if a command is too similar to an existing one by specifying the index of theconflicting command in the "Conflict" column.e. The current status is displayed in the EasyVR Commander list view where groups t hat already containcommands are highlighted in bold. in the following Figure 6 the command"TEST_ CMD_ONE" sounds too similar to "TEST_CMD_ZERO" (i.

VOICE BASED APPLIANCE CONTROL PROJECT PROGRAM: #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino. idx.13).use modified NewSoftS erial #include "WProgram. }. }.h" SoftwareSerialport(12. G1_LIGHTS_OFF = 1.h" #include "SoftwareSe rial.h" NewSoftSerialport(12. #else // Arduino 0022 .h" EasyVReasyvr(port). enum Group1 { G1_LIGHTS_ON = 0.h" #include "NewSoftSerial. Page 31 . #endif #include "EasyVR.13). //Groups and Commands enum Groups { GROUP_1 = 1. int8_t group. EasyVRBridgebridge.

group = GROUP_1. port.loop(0.setLanguage(0). easyv r. bridge. } // run normally Serial.OUTPUT). 12.HIGH). di gitalWrite(A5. for (.OUTPUT). 13).check()) { cli()..setPinOutput(EasyVR::IO1. digitalWrite(A4. LOW).detect()) { Serial.HIGH). //<-. Serial.). pinMode(A5.println("EasyVR not detected!").VOICE BASED APPLIANCE CONTROL void setup() { pinMode(A4.begin(9600). Page 32 . } easyvr.begin(9600). // bridge mode? if (bridge.start group (customize) } void action(). easyvr. 1.setTimeout(5).println("EasyVR detected!"). if (!easyvr.

if (idx> = 0) { // print debug message uint8_t train = 0.print("Co mmand: "). <-. // LED on (listening) Serial.println(group). LOW). if (idx>= 0) { // built-in trigger (ROBOT) // group = GR OUP_X. easyvr. HIGH).setPinOutput(EasyVR::IO1. do { // can do some processing while waiting for a spoken command } while (!easy vr.getWord().recognize Command(group). easyvr.VOICE BASED APPLIANCE CONTROL void loop() { easyvr.print("Say a command in Group "). Serial. Serial. Page 33 . char name[32].hasFinished()). } idx = easyvr. // LED off idx = easyvr.setPinOutput(EasyVR::IO1.jump to another group X return.getCommand().

} else // errors or timeout { if (easyvr.isTimeout()) Serial. idx.VOICE BASED APPLIANCE CONTROL Serial.").pri nt(" = ").print(idx). int16_t err = easyvr. easyvr. train)) { Serial.print("Error ").println(name).. HEX). Serial. if (err >= 0) { Serial.println(). } } } void action() { switch (group) { case GROUP_1: switch (idx) Page 34 .println("Timed out.getError().. // perform some action action().println(err. name. } else Serial.playSound(0. Serial. try again. if (easyvr.dumpCommand(group. Ea syVR::VOL_FULL).

HIGH). digital Write(A5. digitalWrite(A4. } // write your action code here // group = GROUP_X. case G1_LIGHTS_OFF: { Serial.or jump to another grou p X for composite commands break.VOICE BASED APPLIANCE CONTROL { case G1_LIGHTS_ON: {Serial. digitalWrite(A5. <-. digitalWrite(A4.LOW).or jump to another group X for composite commands break. } } Page 35 .println("lights off ").LOW).HIGH). } // write your action code here // group = GROUP_X. } break. <-.println("lights on").

wikipedia.sparkfun.com/products/10963 http://www.co m/ProductDetails.eu/products /easyvr/ http://en.org/wiki/Voice_recognition http://www.epictinker.veear.VOICE BASED APPLIANCE CONTROL References: https://www.asp?ProductCode= VAR-01770 Page 36 .