Wireless music playback system design controlled by WiFi

Guide: This design is based on the already mature WiFi wireless network, making full use of the advantages of wide coverage of WiFi coverage, fast transmission speed and strong anti-interference ability.

introduction

At present, the music player on the market has various styles, can realize a very rich function, and the appearance design is more beautiful, and can better meet the needs of users. However, most of the existing music playing systems use a keyboard, a touch tablet and the like to control the music playing system. The control terminal can only perform local control, and can not realize remote control, which makes the control method not convenient and fast. Modern people are increasingly demanding quality of life, requiring the operation of the music playback system to be more simplistic and intelligent.

1 system design

There are many advantages to using the STM32F103 as a microcontroller. The STM32F series is a medium-capacity enhancement. It is a 32-bit ARM core-based microcontroller with 64 or 128 KB flash memory. It is a very cost-effective product on the market. This design mainly has control module, WiFi wireless module, audio decoding module VS1003B, SD card, its system structure block diagram shown in Figure 1.

Workflow: Click the play button on the smartphone client software, after receiving the command through the WiFi module, STM32F103 reads the MP3 music file in the SD card, and then transfers the read data to the audio decoding chip VS1003B through SPI, and decodes After conversion, it is sent to the earphone to realize the function of playing music; when the pause button is clicked, STM32F103 stops reading the MP3 music file data in the SD card, so that the function of stopping the music can be realized; clicking other buttons can also realize the corresponding function.

The main features of this design are as follows:

1 Based on the open Android system control terminal, use the support component to reuse and replace the application framework. The use of an interactive graphical interface is clear and beautiful, the operation control is simple, and the designed product is very well reflected by the user experience.

2 This design eliminates the dependence of the traditional music playing system on the dedicated control buttons, and can realize the control of the music player playing, pause, etc. through the user's mobile phone, which greatly facilitates the user's operation. The music playing system designed in this way not only has the function of a general music player, but also has the advantage of separating the control end and the hardware part, and realizes the remote control of the music playing system.

2 hardware circuit design

2.1 audio decoding module

The VS1003B is a single-chip MP3/WMA/MIDI audio decoder and ADPCM decoder. It includes a high-performance, proprietary, low-power DSP processor core, VS_DP4, which provides 5 KB of instruction ROM and 0.5 KB of data RAM for user applications. It also has serial control and data interface, 1 A high quality variable sample rate ADC and stereo DAC, 4 general purpose I/O ports, 1 UART, and 1 ground buffer and headphone amplifier.

The STM32F103 transmits the MP3 audio data stream read from the SD card to the audio decoding module, and the audio decoding module parses and converts the data stream into an analog signal before outputting. The data communication between VS1003B and STM32F103 is performed by the SPI bus method on the J2 Pin Header. The schematic diagram of the audio decoding module circuit is shown in Figure 2.

2.2 SD card interface module

The SD card is the most versatile data storage card. It has the advantages of low price, large storage capacity, convenient use, versatility and security. Therefore, the memory cards on MP3, MP4, MP5, Pad and digital cameras are SD. card. The bus mode supported by the SD card is SD mode and SPI mode. The SPI mode is adopted in this design. Figure 3 shows the interface circuit of the SD card module (SPI mode on the J10 pin).

2.3 WiFi wireless module

The biggest advantage of WiFi (Wireless Fidelity) is that the transmission speed is high, and the bandwidth can be automatically adjusted, which can effectively ensure the stability and reliability of the network. The WM-G-MR-08 module used in this design not only has the function of WiFi, but also provides a small size and high data rate wireless connection for wireless PDA, DSC, media adapter, micro printer, barcode scanner, VOIP. Telephone, etc. The data storage device is a potential application of the WM-G-MR-08, and the embedded application is mainly focused on the mobile device. In the design, the WM-G-MR-08 module communicates with the main control chip through the SPI pin of the J1 pin header on the development board, and the ANT1 SMACON is the wireless network card. The schematic diagram is shown in Figure 4.

3 embedded software design

The design uses RealView MDK development kit as the software development platform, embedded software is written in C language, the operating system adopts μC/OS-II.μC/OS-II is written in C language and assembly language, the structure is simple and concise, readability It is very powerful, and at the same time has most of the functions of the real-time operating system, and after appropriate expansion, can be widely used in a variety of applications.

After the system is started, the STM32F103 is initialized, then the SD card, the audio decoding module, the WiFi wireless module are initialized, and finally the μC/OS-II system is initialized. When the WiFi command is determined to be a play command, the microcontroller sends some basic information of the SD card to the FAT file system interface for reading, and obtains the capacity of the SD card, the FAT table, and the starting sector where the root directory is located. Through this information, it can be determined whether the SD card stores a music file that the audio decoding module can decode and play. If there is the music file, the controller will read the audio information of the file through the SPI bus mode, and send the audio stream information to the audio decoding module, which is decoded by the VS1003B chip, and then passed through the included high quality The stereo DAC and the headphone driver circuit can realize the music playing. The program flow chart is shown in Figure 5.

4 mobile client software design

The development tools used in mobile client software development include Eclipse, JDK, ADT and Andrid SDK. The development environment is as follows: first install JDK, then extract Eclip se and Android SDK respectively, then install ADT plugin for Eclipse, and finally configure Android SDK. Finally, build a good Android development environment.

For the client software, use ImageView+TestView for UI design, select the appropriate image as the background and add ButtonStart, Button Stop, ButtonOff and other function buttons to control the playback, pause and close of the music playback system. After designing the UI interface, respond to user actions by adding a setOnClickListener event to each button. According to the different command buttons, different commands are sent to the slave nodes through the network in the response function to implement the corresponding control functions.

5 Conclusion

This design is to build WiFi on the ARM7 platform, and the cost advantage is obvious. Adopting the newer control method--smartphone software control + wireless network, not only can fully utilize the advantages of fast transmission speed and wide coverage of WiFi, but also the construction cost of Android-based platform is low and easy to use. Android has the advantages of open source, encapsulation, and high cost performance. The client software developed based on Android system has strong portability and high versatility. The mobile phone is used as a control terminal for easy operation. The mobile phone controls the music playing system through the wireless network (WiFi), which can realize the requirements of convenience, speed and intelligence. At the same time, the mobile phone software used in this way has universality, high market application value, easy promotion, and can provide users with high quality. Convenient and fast music playback service.

1 time
Window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": " 0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "Share to:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren" , "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share. Baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Screw Terminal Block

Screw Terminal Connector,Pcb Screw Terminal,Screw Terminal Block Connector,Screw Type Terminal Blocks

Cixi Xinke Electronic Technology Co., Ltd. , https://www.cxxinke.com

Posted on