Voice Activated Multiple Relay Controller
This is a voice activated relay controller using the MAX78000FTHR development board. 9 LEDs are used in the project to simulate 9 relays. The relays can be individually turned ON or OFF using voice commands. Also, it is possible to turn ON/OFF all the relays by giving voice commands
Note: This project is built,, tested and is FULLY WORKING.
Project video link: https://www.youtube.com/watch?v=w0gkD5dh4vU
The designed voice activated multiple relay controller: This project is based on the concepts of artificial intelligence where a voice activated intelligent relay controller is designed using the MAX78000FTHR microcontroller development board, At the heart of the MAX78000FTHR is a MAX78000 Cortex-M4 ARM based microcontroller with FPU. Additionally, the board contains 512KB flash memory, 128KB SRAM, 16KB cache, Convolutional Neural Network Accelerator, VGA image sensor, digital microphone, RGB LED, pushbuttons, microSD card adapter, microUSB connector, stereo audio CODEC, SWD debugger, virtual UART port, and many I/O ports.
The project designed here can be used in many many applications where it is required to control a relay.
Block Diagram: Figure 1 shows the block diagram of the project. A 2.4 inch ILI9341 controller based TFT FeatherWing 240x320 pixel touch-screen TFT display is used at the front end of the project to display the user commands and responses. 9 LEDs are connected to the MAX78000FTHR I/O ports. These LEDs can easily be replaced with relays if desired and various AC operated devices can be controlled with the relays, such as home appliances, lights, etc etc. These relays are numbered from 1 to 9 and are controlled (activated and deactivated) by user voice commands.
Circuit Diagram: Figure 2 shows the circuit diagram of the project. 9 LEDs are connected to the I/O ports through 1K current limiting resistors. As mentioned earlier, the LEDs are used for testing the project, but they can very easily be replaced with 3.3V operating relays and used to control e.g. AC devices.
The TFT display is connected to the MAX78000FTHR via the SPI bus interface. Pins MISO, MOSI, SCK and CS of the SPI bus are connected to pins P0_6 (MISO), P0_5 (MOSI), P0_7 (SCK), and P0_11 (CS) of the development board. Pin D/C of the TFT display is connected to pin P0_8, and Vcc and GND are connected to +3.3V and GND pins of the MAX78000FTHR.
The circuit was built on a breadboard and connections were made using jumper wires. Figure 3 shows the project built on a breadboard.
Power is supplied to the circuit through its mikroUSB cable which should be connected to the USB port of a computer during the program development.
Operation of the project: The operation of the project is shown in Figure 4 as a state diagram. The following sounds are recognized by the project (invalid spoken commands are rejected by the project):
SHEILA: Attention sound. When this sound is spoken, a prompt will be displayed on the TFT telling
the user that he/she can speak a valid command. You should wait until the prompt is
displayed at the bottom of the screen before saying another command.
ON: Sound to turn ON one or all relays.
OFF: Sound to turn OFF one or all relays
STOP: Used after an ON or OFF voice command
Numbers 1 to 9: Used to select a relay
Some example voice commands are given below:
ON 1 Turn ON relay 1
ON 3 Turn ON relay 3
ON 9 Turn ON relay 9
ON STOP Turn ON all relays (1 to 9)
OFF 1 Turn OFF relay 1
OFF 8 Turn OFF relay 8
OFF STOP Turn OFF all relays (1 to 9)
Activating an individual relay does not affect the state of the other relays.
The TFT display will show both the user commands and the state of the activated relays as a verification. A small delay (few seconds) is inserted after each command so that the user can see the commands and responses on the TFT display.
Program listing: The 20 keywords in the supplied Maxim project kws20_demo has been changed to include the word SHEILA. The CNN training program was ran on a Linux Ubuntu operating system after creating a WMware virtual machine on a Windows 10 machine with an i7 CPU, 100GB disk space, and 12GB free memory, without a special GeoForce GPU. After training the new words, the created cnn.c, cnn.h files and the weights.c and weights.h files were copied to the workspace and program main.c under folder kws20_demo was modified for this project. The full main.c program listing is given in Figure 5 as a PDF file.
Function Detected_Word detects the spoken word and returns an integer number which is used to identify the detected sound. Number 100 is returned if a non-valid sound is detected by the program. The temperature control cycle is entered every time the program goes round its loop.
Function ALLON activated all the relays. Similarly, function ALLOFF deactivates all the relays. Function ONOFF activates or deactivates a single relay depending on the voice command.
The ELEKTOR lego was converted into a bitmap image and then into a c file, and is displayed when the project is started (see the section on running the project).
Figures 6.1 to 6.8 show snapshots of the TFT display from the beginning to giving commands to turn ON or OFF all or a single relay.
Example run of the project: An example run of the project is shown in the You Tube video link. Notice that the ELEKTOR logo is displayed when power is applied to the project, or when the Reset button is pressed. Then, a short screen is displayed as a header which gives very brief information about the project. The user is then prompted to speak the required valid commands to activate or deactivate one or all the relays.
Suggestions for future work:
The project can be upgraded such that the command acceptance and the state of the relays can be spoken on a speaker. This will make the project more fun and also more professional.
Project video link: https://www.youtube.com/watch?v=w0gkD5dh4vU
References
https://datasheets.maximintegrated.com/en/ds/MAX78000.pdf
https://www.maximintegrated.com/en/design/technical-documents/app-notes/7/7417.html
https://www.maximintegrated.com/en/design/videos.html/vd_1_rtp4xipe#popupmodal
https://datasheets.maximintegrated.com/en/ds/MAX78000FTHR.pdf
https://www.maximintegrated.com/content/dam/files/design/tools/ev-kits/schematics/max78000-fthr-schematic.pdf
https://www.maximintegrated.com/en/design/software-description.html/swpart=SFW0010820A
Project video link: https://www.youtube.com/watch?v=w0gkD5dh4vU
The designed voice activated multiple relay controller: This project is based on the concepts of artificial intelligence where a voice activated intelligent relay controller is designed using the MAX78000FTHR microcontroller development board, At the heart of the MAX78000FTHR is a MAX78000 Cortex-M4 ARM based microcontroller with FPU. Additionally, the board contains 512KB flash memory, 128KB SRAM, 16KB cache, Convolutional Neural Network Accelerator, VGA image sensor, digital microphone, RGB LED, pushbuttons, microSD card adapter, microUSB connector, stereo audio CODEC, SWD debugger, virtual UART port, and many I/O ports.
The project designed here can be used in many many applications where it is required to control a relay.
Block Diagram: Figure 1 shows the block diagram of the project. A 2.4 inch ILI9341 controller based TFT FeatherWing 240x320 pixel touch-screen TFT display is used at the front end of the project to display the user commands and responses. 9 LEDs are connected to the MAX78000FTHR I/O ports. These LEDs can easily be replaced with relays if desired and various AC operated devices can be controlled with the relays, such as home appliances, lights, etc etc. These relays are numbered from 1 to 9 and are controlled (activated and deactivated) by user voice commands.
Circuit Diagram: Figure 2 shows the circuit diagram of the project. 9 LEDs are connected to the I/O ports through 1K current limiting resistors. As mentioned earlier, the LEDs are used for testing the project, but they can very easily be replaced with 3.3V operating relays and used to control e.g. AC devices.
The TFT display is connected to the MAX78000FTHR via the SPI bus interface. Pins MISO, MOSI, SCK and CS of the SPI bus are connected to pins P0_6 (MISO), P0_5 (MOSI), P0_7 (SCK), and P0_11 (CS) of the development board. Pin D/C of the TFT display is connected to pin P0_8, and Vcc and GND are connected to +3.3V and GND pins of the MAX78000FTHR.
The circuit was built on a breadboard and connections were made using jumper wires. Figure 3 shows the project built on a breadboard.
Power is supplied to the circuit through its mikroUSB cable which should be connected to the USB port of a computer during the program development.
Operation of the project: The operation of the project is shown in Figure 4 as a state diagram. The following sounds are recognized by the project (invalid spoken commands are rejected by the project):
SHEILA: Attention sound. When this sound is spoken, a prompt will be displayed on the TFT telling
the user that he/she can speak a valid command. You should wait until the prompt is
displayed at the bottom of the screen before saying another command.
ON: Sound to turn ON one or all relays.
OFF: Sound to turn OFF one or all relays
STOP: Used after an ON or OFF voice command
Numbers 1 to 9: Used to select a relay
Some example voice commands are given below:
ON 1 Turn ON relay 1
ON 3 Turn ON relay 3
ON 9 Turn ON relay 9
ON STOP Turn ON all relays (1 to 9)
OFF 1 Turn OFF relay 1
OFF 8 Turn OFF relay 8
OFF STOP Turn OFF all relays (1 to 9)
Activating an individual relay does not affect the state of the other relays.
The TFT display will show both the user commands and the state of the activated relays as a verification. A small delay (few seconds) is inserted after each command so that the user can see the commands and responses on the TFT display.
Program listing: The 20 keywords in the supplied Maxim project kws20_demo has been changed to include the word SHEILA. The CNN training program was ran on a Linux Ubuntu operating system after creating a WMware virtual machine on a Windows 10 machine with an i7 CPU, 100GB disk space, and 12GB free memory, without a special GeoForce GPU. After training the new words, the created cnn.c, cnn.h files and the weights.c and weights.h files were copied to the workspace and program main.c under folder kws20_demo was modified for this project. The full main.c program listing is given in Figure 5 as a PDF file.
Function Detected_Word detects the spoken word and returns an integer number which is used to identify the detected sound. Number 100 is returned if a non-valid sound is detected by the program. The temperature control cycle is entered every time the program goes round its loop.
Function ALLON activated all the relays. Similarly, function ALLOFF deactivates all the relays. Function ONOFF activates or deactivates a single relay depending on the voice command.
The ELEKTOR lego was converted into a bitmap image and then into a c file, and is displayed when the project is started (see the section on running the project).
Figures 6.1 to 6.8 show snapshots of the TFT display from the beginning to giving commands to turn ON or OFF all or a single relay.
Example run of the project: An example run of the project is shown in the You Tube video link. Notice that the ELEKTOR logo is displayed when power is applied to the project, or when the Reset button is pressed. Then, a short screen is displayed as a header which gives very brief information about the project. The user is then prompted to speak the required valid commands to activate or deactivate one or all the relays.
Suggestions for future work:
The project can be upgraded such that the command acceptance and the state of the relays can be spoken on a speaker. This will make the project more fun and also more professional.
Project video link: https://www.youtube.com/watch?v=w0gkD5dh4vU
References
https://datasheets.maximintegrated.com/en/ds/MAX78000.pdf
https://www.maximintegrated.com/en/design/technical-documents/app-notes/7/7417.html
https://www.maximintegrated.com/en/design/videos.html/vd_1_rtp4xipe#popupmodal
https://datasheets.maximintegrated.com/en/ds/MAX78000FTHR.pdf
https://www.maximintegrated.com/content/dam/files/design/tools/ev-kits/schematics/max78000-fthr-schematic.pdf
https://www.maximintegrated.com/en/design/software-description.html/swpart=SFW0010820A
Discussie (2 opmerking(en))