[Bi She] Design of voice recognition smart bluetooth speaker based on STM32

Design of intelligent Bluetooth speaker based on STM32 speech recognition

(source program+schematic diagram+PCB+design manual+PPT)

Schematic: Altium Designer

Program compiler: keil4/keil 5

Programming language: C language

Design number: Y002

Design Notes:

This design has produced a bluetooth speaker with the bluetooth receiving module, voice recognition and STM32 microcontroller as the core. The specific requirements for implementation are as follows:

1. Speech recognition:

Using the LD3320 speech recognition scheme based on automatic speech recognition technology, debug the speech module to recognize the specific vocabulary required by this topic. The main control chip STM32F103C8T6 communicates with the speech recognition module LD-V7 through the serial port, and the main control chip processes the message command after receiving the pinyin of the serial port keywords. The keywords needed for this topic include: wake-up word, previous song, next song, louder, quieter, pause, and play.

2. Button control:

In the case of inconvenient voice, you can use buttons to control the speaker. This topic chooses JDY-64 audio receiving module, which integrates SD card function and supports button control. It is necessary to design the peripheral circuit according to the trial manual provided by the original factory manual.

3. Audio reception:

The JDY-64 Bluetooth module selected in this project can realize wireless music transmission of smart devices such as mobile phones and computers by connecting the module to application products. This module uses Bluetooth 4.2 version and supports HFPV1.7, A2DPV1.2, AVRCPV1.5, AVCTPV1.2 and AVDTPV1.2 Bluetooth protocols can receive audio signals from different devices to meet the requirements of daily use.

4. Production and debugging of speakers:

Class D power amplifier processing chip PAM8403 is adopted, which supports two-channel power amplifier with an output power of 3 watts, can directly drive speakers, and supports Bluetooth receiving modules. The speaker adopts a small speaker with a power of 3 watts that is common on the market.

img

schematic diagram

The Bluetooth speaker adopts a modular design idea, and the hardware part is divided into four major modules for design. The four major modules include power supply module, Bluetooth audio receiver, STM32f103C8T6 single-chip control module, voice recognition module and other parts. The block diagram of the working principle of the system is shown in Figure 2.1.

image-20220902001841286

The working principle of the system: Receive audio signals from other Bluetooth devices such as computers and mobile phones through the Bluetooth module, output the received signals to PAM8403, and amplify the signals and output them to 3W speakers to form an ordinary Bluetooth speaker. At the same time, after the microphone of the speech recognition module collects the sound, it triggers the serial port interruption of the STM32 microcontroller through the serial port communication. Go to the next song, pause playback. In this way, a voice recognition smart Bluetooth speaker is formed. The core modules are bluetooth receiving module, speech recognition module and STM32 microcontroller.

The functions of each module are as follows:

a) Power supply module: output 5V and 3.3V regulated power supply to supply power to other modules of the system.

b) Bluetooth receiving module: Receive the Bluetooth audio signal of the target device and provide it to the audio operational amplifier circuit.

c) Audio amplifier module: amplifies the input audio signal and outputs it to the 3W speaker.

d) STM32 control module: the core of the system, the main coordination module works normally.

e) Button module: Play the next song, the previous song, the volume and stop playing through the buttons.

img

PCB diagram

img

source program

img

Program main flow chart

image-20220902001938513

main function

int main(void)
{	
	 delay_init();	    	 //延时函数初始化	  
	 NVIC_Configuration(); 	 
//设置NVIC中断分组2:2位抢占优先级,2位响应优先级 	 
uart_init(9600);//初始化串口1
	 buletooth_init();//蓝牙控制部分初始化
	 int rec;
	while(1) 
	{		
		rec=ld3320_uart_receive();
//循环得到接受函数的字符串数组
		printf("接收到 = %d\r\n",rec);
		switch(rec)
		{
			case 1: break;//小杰
			case 2: printf(" play :2\r\n");playorpause();break;//播放
			case 3: printf(" stop :3\r\n");playorpause();break;//暂停
			case 4: printf(" last :4\r\n"); last();break;//上一首
			case 5: printf(" next :5\r\n");next();break;//下一首	
			case 6: printf(" up :6\r\n"); volume_up();break;//大声点
			case 7: printf(" down :7\r\n");volume_down();break;//小点声
			case 8: printf(" reset :8\r\n");break;//预留
			case 9: printf(" again :9\r\n");break;//请重新识别发口令
			case 10: printf(" one more time :10\r\n");break;//请说出一级口令
			//case 11: printf("11\r\n");break;//
			default:break;
		}

img

design manual

img

1.1 Research background and significance

Since the birth of Bluetooth technology, major technology companies such as CSR, Texas Instruments, and Broadcom have continuously invested in research on it. One of the derivatives of Bluetooth technology, the design level of the Bluetooth speaker industry has also advanced by leaps and bounds. Looking back at the current Bluetooth speaker products, it is not difficult to find that the innovation of Bluetooth products has made great progress from sound quality to appearance. It can also be seen that the development of Bluetooth speakers has encountered a bottleneck today. Except for professionals, the vast majority of consumers are satisfied with the sound quality of today's common Bluetooth speakers, and the profits and driving consumption ability brought about by sound quality innovation are obviously unsustainable. The battery life of Bluetooth speakers obviously depends on the development and breakthrough of micro batteries. At present, the most differentiated and most recognizable Bluetooth speaker is its shape. However, no matter how strange the shape design is, consumers' aesthetics will be tired. The future development of Bluetooth speakers must be diversified. Shape design, miniaturization, and intelligence are all the expansion directions of Bluetooth speakers.

From the initial appearance of the speech recognition system at Bell Labs in the 1950s to the introduction of application-level products by companies represented by Google, Microsoft, IBM, and iFLYTEK in the industry, speech recognition has gone through a glorious journey[1] ]. The development of speech recognition technology has reached a mature stage today. Voice assistants such as Cortana built into the Windows system, Siri on Apple phones, and Xiao Ai on Xiaomi phones are all voice recognition interactive technology applications that can be seen everywhere in our lives.

Based on the above background, combined with a large number of applications of speech recognition technology, this project adopts an offline speech recognition chip, obtains the sound source through Bluetooth technology, uses the speech recognition chip to identify keywords to control the working status of the speaker, and realizes the smart Bluetooth speaker. Starting from the direction of intelligence, explore the expansion direction of Bluetooth speakers. This topic mainly studies the offline state, the smart speaker connects to the mobile phone through Bluetooth to obtain the sound source, and realizes the application of the voice smart speaker in the offline situation. Through the application research of specific speech recognition, human-computer interaction other than buttons and touch screen is realized, and the interaction process is natural, smooth and convenient. Compared with the existing Bluetooth speakers, the excellent effect of this application is that the voice interaction effect increases the interest and intelligence of the product, and the control method is not only interactive voice but also button control, which is more concise and convenient. Therefore, the design of intelligent Bluetooth speakers based on speech recognition is of great practical significance.

1.2 Research status at home and abroad

Bluetooth technology was originally invented by Ericsson. In view of the objective application prospects of Bluetooth technology, Ericsson, Intel, IBM, Toshiba and Nokia established the Bluetooth Special Interest Group (SIG for short) in 1998 after consultation, and adopted a new approach to the industry. The measure of free transfer of bluetooth technology has realized the global unified standard of bluetooth technology [2].

Since then, domestic and foreign research institutions have been very active in the application research of Bluetooth technology. Bluetooth products such as Bluetooth speakers, Bluetooth headsets, Bluetooth wireless mice, and Bluetooth Internet of Things are derived. The latest version "Bluetooth 5" has a longer transmission distance, faster transmission speed, and larger transmission data volume than previous versions, and has improved the coexistence with other wireless communication technologies including Zigbee and Wifi. While the performance is more powerful, the size of the Bluetooth chip becomes smaller. At present, the smallest Bluetooth chip BES2000H in the world has a chip size of only 2.7*4.4mm. In addition to being equipped with Bluetooth 4.2, the chip also integrates low power consumption, timers, IIC, and SPI communication protocols. Practitioners were surprised.

In my country, there are also many experts and manufacturers who have done in-depth research on Bluetooth technology, and the research results have been fruitful. Sun Yansen, a scholar of Beijing Institute of Technology, researched and designed point-to-multipoint audio and video transmission technology based on the Bluetooth standard, which studied a major direction of the development of Bluetooth audio and video at that time. The China Bluetooth Technology Development and Application Forum, initiated by leaders, experts, and professors from national authorities, business circles, academia, and research and production institutions, has attracted many people from all walks of life who are concerned about Bluetooth technology. Representatives of SIG, the World Bluetooth Organization, had a serious discussion on issues of concern to both parties [3]. Generally speaking, domestic Bluetooth research still cannot keep up with foreign development for a while.

In 1995, Silezhi Company first proposed the concept of Bluetooth speakers, after which Bluetooth speakers began to develop slowly. Due to the immature technology and Bluetooth was not understood and accepted by the public at that time, the development of Bluetooth speakers was very slow. Until 2006, popular science articles about Bluetooth speakers and Bluetooth audio receivers began to appear one after another. In the article "CELL Bluetooth Stereo Kit Audio-Visual Experience" published in 2006, it can be seen that the computer at that time did not integrate a Bluetooth module, and the transmission of Bluetooth audio signals was realized through a USB external Bluetooth module. After 2012, with the rapid popularization of smart phones and laptops equipped with Bluetooth modules. Bluetooth speakers have caught up with the popularization of Bluetooth technology, and have won the favor of consumers by virtue of their portability, wireless, fashion and other elements. In 2016, Apple removed the 3.5mm headphone jack from its then-newest phone, the iPhone 7. This move indicates that wireless earphones will be the development trend of smart phones. As expected, the earphone jacks have been canceled in the new mobile phones that have been launched later, and Bluetooth earphones and Bluetooth speakers have been further popularized.

With the rise of voice-interactive smart speakers, the Bluetooth speaker market has been impacted, and future Bluetooth headsets will also develop in this direction. In 2014, some scholars proposed to use Mel frequency cepstral coefficients for feature extraction to improve the accuracy of Bluetooth speech recognition [4]. At present, there are already mature Bluetooth-based AI smart speakers. This topic explores voice-interactive smart speakers based on voice recognition-based Bluetooth speakers. At the same time, Bluetooth headsets will continue to dig deeper into low-power consumption and portable functions. The latest foreign research uses the audio cable as the design of the earphone antenna to further improve the compactness of the earphone and improve portability [5].

Device list

img

data list

img
Data download link

Guess you like

Origin blog.csdn.net/weixin_52733843/article/details/126653768