Main Content

Voice Recognition Using PSoC6 BLE Pioneer Kit

A device which can detect voice commands and takes action.

Overview
Voice recognition has played an important role in home automation and robotics to control systems. It helps in to create a touch-less, non-mechanical and low-cost controller. Until recently doing voice recognition on a limited resource microcontroller was not possible but after Tensorflow Lite and other similar efforts has made it possible. I could not found any ready to use example application which uses machine learning on a PSoC6 MCU with ModusToolBox. So I decided to port the Tensorflow Lite Micro SDK to the PSoC6 MCU with ModusToolBox using a PSoC6 BLE Pioneer Kit. I have built two applications. First application is used to collect data only and the second application is the main final application which takes voice commands and trigger some action.

Setup Development Environment
I am using macOS Catalina for the development. First of all we need to download ModusToolBox from this link: https://www.cypress.com/products/modustoolbox-software-environment. Please choose the bundle for your OS and follow the instructions given in the link above to install.

Data Collection
The data collection application uses the PSoC6 BLE Pioneer Kit with the Eink Display which has a PDM microphone on-board. The Eink Display is used to show the audio recording status. The SW2 button is used to initiate recording. Since the development board has 288 KB SRAM we can record at most 7 seconds of PDM/PCM audio with 16KHz sample rate. We can record at most 4 instances of almost 1 second long commands with some gaps. Later we will split the 4 instances into 4 training examples. The code for the audio data collection can be found at the GitHub repository (Please see the link in the Code Section). We have collected 204 examples for each of the following classes:

AC On
AC Off
Temperature Up
Temperature Down
Noise (Random background sounds)
Unknown (Any keywords which are not the four commands above)
The recorded audio data is sent to Computer over UART serial connection and the PDM/PCM data is converted to the WAV file format. For the data collection PSoC6_Audio_Data_Collection_Project is created using the Hello world example as a starting point. To create a project in the ModusToolBox click on the New Application link as shown below.”

Link to article