Nowadays, the single chip computer is occupying the dominant position of the intelligent control system at the speed of rapid speed. Various kinds of color lights are also accompanied by our life. The music color lamp controller is made by AT89C51 single chip computer. Because the frequency of the single chip computer is different, when the music is output to the loudspeaker, the color lamp will be on and off rhythmically with the change of the music.
This paper mainly describes the structure and connection method of the hardware circuit of the system, and also introduces the program design of the application software.
In terms of hardware design, we first design the DC power supply circuit, reset circuit, clock circuit and sound drive circuit, then connect all the module circuits, and determine the hardware circuit through simulation software debugging. When designing software, we first design the program of note frequency occurrence, color lamp program, counter/timer program, then integrate each program block, and finally debug the program through software simulation. Nowadays, MCU has been applied in various fields. For example: the security system of private high-end cars, industrial control, missile navigation devices, intelligent meters, a variety of widely used smart IC cards, computer networks and communications applications, as well as programmed toys, electronic pets and so on. With the development of science and technology, there are more and more intelligent things. Therefore, it can be said that learning the knowledge, research and development and application of SCM will inevitably become a trend of social development. In the 1980s, MCU first appeared in China, and then the first national exchange meeting on the development and application of MCU was held. In some places, even associations related to it were founded. This is the first upsurge of MCU in China.
Nowadays, the fastest development is the application technology of single-chip computer. As long as the three words of “single-chip computer” are input into the Internet for search, tens of thousands of websites related to single-chip computer can appear. According to the survey, the number of MCU practitioners in China has reached more than 1 million by 2010, and the demand for talents ranks first.
According to statistics, the annual production capacity of single-chip computer has reached 300 million pieces, growing at a rate of about 20% annually, but China’s global market share is less than 1% relative to the world market.
Therefore, the knowledge learning of single-chip computer in our country is a good development prospect. Therefore, with the development of society, single-chip technology will be more popular. So far, there are many design schemes of music color lamp controller, such as using single chip computer to control, using sensors to control, using EDA to control and so on. In the case of saving experimental equipment and simplifying design steps, in order to simplify the hardware circuit, PLCS7-20CN can also be used to control.
Although the hardware circuit is relatively simple compared with other control systems, the experimental procedure is complex and the experimental process is complex.
It is a difficult problem to write the program.
Therefore, we often choose MCU to design music color lamp controller, through the MCU port to control music playback and color lamp flashing, this program is more simple, compilation is better. This design is based on AT89C51 chip to achieve the effect of music color lamp. We use a constant current source to supply power, use single chip to produce different frequencies and some peripheral auxiliary circuits, and then play music through buzzer. When buzzer plays music, the color lamp changes with the change of music rhythm, so as to achieve sound. The effect of music lanterns. This design needs to realize two working modes: playing music mode and pattern lamp mode. Play music mode: Play music, eight-way LED changes with the change of music. Each data is then sent to the corresponding points of the LED array to complete the synchronous control of music and color lights. The scheme has clear idea, simple circuit, easy operation and low cost. The second scheme has high sensitivity, but its structure is complex, thermostatic element power consumption is high, and control is not simple. Combining their advantages and disadvantages, we choose the first scheme. Press K2 key to select and debug. After pressing the K2 key again, the buzzer plays the song of Millennium Love, and the color lights change with the rhythm of the music. The program of this circuit only needs about 1K. We can write more music and colorful lamp patterns to make the system more powerful. This paper mainly introduces the design and connection of the hardware circuit, the working principle of the hardware circuit module and the functions it can achieve.
The whole module of the design consists of MCU module, color lamp module, reset module, clock module, power module, key module, communication module and audio module. The block diagram of the system module is shown in Figure 1. Because the current driving ability of 51 series MCU is weak, and the working current of loudspeaker needs tens of milliamperes, we need to use a PNP transistor to drive loudspeaker. If the chip is given a low level of P3.0, the buzzer will work; otherwise, if the chip is given a high level, the buzzer will not work. The LED is connected to the PI port of the single chip computer, which lowers the IO port level and makes the LED light up. The ports of the two keys are connected with the I/O port and the ground of the single chip computer respectively. If the button does not move, the I/O port connected with it is raised by the pull-up resistance inside the chip. If we press the button, the I/O port connected with it becomes low level and triggers interruption.
In order to realize the function of pattern lanterns, we need to light and extinguish eight patterns of flowing lanterns. At the same time, we also need to pay attention to one point, because the MCU executes each instruction for a very short time, and the human eye has a visual temporary effect, so we should delay the instruction for a period of time when the color lights are on or off, otherwise we will not see the effect of the pattern color lights. Therefore, this circuit also needs delay module. In order to achieve all functions successfully, we must have a more reliable hardware circuit. Of course, it is also unsuccessful to design software programs without hardware circuits. After the design of music color lamp controller based on MCU, we not only deepen our understanding of the theoretical knowledge and apply it to the actual situation, but also show our own shortcomings, whether in theory or in the ability to solve problems, which also inspires us to go forward. Then study hard. The knowledge we learned from this design will benefit me all my life.
It will benefit from my future work and life to discover, raise, analyze and solve problems and improve my practical ability.