Since the self-excited buzzer is driven by DC voltage, it does not need to be driven by AC signal. It only needs to output the driving level to the driving port and amplify the driving current with a transistor to send out the buzzer. Because it is very simple, the self-excited buzzer is not described here. Only other excitation buzzers driven by square wave signal with 1 / 2 duty cycle are described here.
There are two ways to drive the buzzer by single chip microcomputer: direct driving by PWM output port and driving the buzzer by using the driving waveform generated by I / O timing reversal level.
The PWM output port is directly driven. Using the PWM output port itself, a certain square wave can be output to directly drive the buzzer. In the software setting of the single chip microcomputer, there are several system registers for setting the output of the PWM port, which can set the duty cycle, cycle, etc. after setting these registers to generate the waveform of the frequency that meets the requirements of the buzzer, the PWM output is output. For example, in the drive of the buzzer with the frequency of 2000Hz, it can be seen that the cycle is 500s, and only the PWM cycle is set to 500s When the level of the duty cycle is set to 250s, a square wave with a frequency of 2000Hz will be generated, and the square wave will be reused through the transistor, so that the buzzer disappears
On the other hand, it is troublesome to use the timing reversal level of I / O to generate the driving waveform. When the timer is used to obtain the timing, the timing reversal level can be used to generate a waveform consistent with the frequency required by the buzzer, and the waveform can be used for the driving of the buzzer. For example, in the drive of a 2500 Hz buzzer, it can be seen that the cycle is 400 S. as long as the I / O port of the buzzer is reversed every 200 s, a square wave with a frequency of 2500 Hz and a duty cycle of 1 / 2 will be generated. The buzzer can be driven by transistor amplification.
Well, today's SMD buzzer factory will explain it here. I believe you must have a new understanding of this time and will not be blind when choosing next time. In addition, you can pay attention to our SMD buzzer factory. If you have any problems you don't understand, please contact our customer service personnel at any time. The world pays off those who have a heart. I wish you a good mood every day and everything goes well!