This paper is based on the design of small music fountain control system of microcontroller. It mainly introduces the realization principle and method of small music fountain control system with microcontroller as the core of internal control. The system design has the following functions: 1. realizing the functions of continuous water spraying and music playing; 2. music playing can realize such operations as the previous song, the next song, playing, pausing, adding sound and reducing sound; 3. the height of fountain water column will jump with the level of music sound; 4. there are LED lights around fountain, and the brightness of the lamp will change with the change of music. In this system, the analog volume of music is converted into digital volume by AD conversion of MCU, which is used for MCU to know the change of music volume. Through the analysis of the design function, the small music fountain control system mainly completes the real-time connection among fountain, music and light, which makes the fountain water column and light change with the beat of music and realizes the beautiful scenery of the three interconnections. First of all, music is played by music module, the light is realized by LED, and the spray of fountain water column is controlled by water pump. The height of water column is proportional to the water column. The sound level of music is the voltage level. Through the AD conversion of microcontroller, the analog volume of sound is converted into digital volume so that the single chip computer can identify the music volume level. As we all know, motor rotation has inertia.
As long as the frequency of PWM is high, it is equivalent to an integral circuit. Adjusting duty cycle is equivalent to adjusting analog voltage, so as to control the speed of motor and control the height of water column by controlling the speed of motor. The brightness of the LED lamp is proportional to the speed of the motor [1]. According to the above design ideas, thermostatic element the hardware system consists of microcontroller, MP3 module, power amplifier module, driver module, etc. The program adopts modular structure to facilitate program modification and debugging. The small music fountain control system is powered by DC5V. The hardware system mainly includes microcontroller module, key module, music module, power amplifier module, driver module and so on. For the small music fountain control system, the microcontroller is the central component of the system function. Its working efficiency is related to the system efficiency and the stability of the system operation. By checking the microcontroller manuals and comparing the performance-price ratio of various microcontrollers, can STC12C2052AD microcontrollers have simple structure, fast speed, 12 times faster than ordinary 8051, and the voltage width, 3.4 to 5.5V can work normally, providing AD, PWM registers and so on, which fully meet the requirements of this design. STC12C2052AD series microcontroller is a single clock/machine cycle (1T) microcontroller produced by Red Crystal Technology. It is a new generation of 8051 microcontroller with high speed/low power consumption/super anti-interference.
The music module is mainly composed of GD5800 chip, power amplifier, key module and speaker. GD5800 is an MP3 chip with serial port, which integrates the hard decoding of MP3 and WMV perfectly. Supporting the computer to update the content of SPI flash directly, through a simple serial command, it can complete the functions of playing specified music and how to play music. It does not need complicated underlying operation, easy to use, stable and reliable is the biggest feature of this product. In addition, the chip is also a deeply customized product, which is a low-cost solution specially developed for the field of fixed voice broadcasting. PAM8403 power amplifier board has excellent noise suppression. Without receiving input audio, the ear can not hear any noise. Dual-channel stereo, 5V power supply can output 3W 3W power. It can directly drive 4Omega and 8Omega speakers, with high output power, sufficient energy and good sound quality. The unique class D digital power board without LC filter can directly use the computer’s USB power supply. Using TIP 3055 power transistor, the limit operating voltage of the transistor is high and the allowable overcurrent is high. In order to meet the demand of driving small motor, the triode is controlled to work in cut-off and saturation state by PWM wave of single chip computer, so that the output can get a PWM wave with strong driving ability. The program is designed in C51 language. The C51 language of MCU is inherited from C language.
The difference between C51 and C is that C51 runs on microcontrollers, while C runs on common desktop platforms. C51 language has the advantages of clear structure and portability of C language, so it is easy to write. At the same time, it has the hardware operation ability of assembly language.
In this program design, modular design structure is mainly used, which is convenient for program modification, debugging and upgrading. This program controls the MP3 module through serial instructions, and then converts analog to digital through AD of single chip computer. After internal processing, the PWM waveform function is embedded in the form of real parameters, which makes it easy for the motor speed change to keep up with the change of music sound level. Among them, attention should also be paid to the following aspects in programming [2]. By configuring each register in the register data manual of STC12C2052AD microcontroller, the analog amount of music can be directly transformed into the digital amount that can be recognized and processed by the microcontroller. STC12C2052AD microcontroller has its own PWM function. It can output the desired duty cycle PWM waveform only by configuring the corresponding registers. So it is very simple to write and debug the program. In the small music fountain controller system composed of microcontrollers, the work of single-chip computer is often disturbed by the outside world, such as the sudden increase of music sound, the power of loudspeakers, motors and LED lights, thus lowering the voltage of the system, causing the running of the program to fall into a dead cycle, and the normal operation of the program is interrupted. Because the single-chip computer can not work normally, the whole system will occur.
Error. Therefore, the design of watchdog is of great significance. If the program runs or crashes, it will not be able to feed the dog properly, so the MCU automatically resets and starts working again [3]. This program design adopts modular design structure, among which AD data reading and control of pump motor PWM wave generation is the most important module. AD data reading design. By configuring each register in the register data manual of STC12C2052AD single-chip computer, the analog amount of music can be directly transformed into the digital amount that can be recognized and processed by the single-chip computer. PWM wave generation method. STC12C2052AD microcontroller has its own PWM function. It can output the desired duty cycle PWM waveform only by configuring the corresponding registers. So it is very simple to write and debug the program. With the continuous improvement of people’s living standards, music fountain has become an important product in leisure and entertainment with its unique charm. Small music fountain is very designed for family applications, and has high practical and applied value. The innovation of this project is mainly reflected in two aspects. One is to change the problem that music water column can not be integrated with MP3.
The other is to reduce the cost and price of music water column, making it very suitable for home use.