How to Design a Low-Cost Buzzer

Publisher:asa1670Latest update time:2014-10-23 Source: 互联网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In actual applications, although active buzzers are easy to control, their disadvantages are that they are relatively expensive and are easily damaged after being used for a long time in a humid environment. Passive buzzers make up for the shortcomings of active buzzers, but the problem is that passive buzzers require PWM drive. In system design, the PWM resources of microcontrollers are often tight, and the use of PWM drive also increases the difficulty of software development. Next, the author will lead everyone to learn how to design a low-cost circuit that can drive a passive buzzer without PWM.

1.1 Passive buzzer conventional drive circuit

Figure 1.1 Conventional passive buzzer drive circuit

As shown in Figure 1, this is a conventional driving circuit for a passive buzzer. A certain frequency PWM signal needs to be input at the input end to make the buzzer sound. In order to free up PWM resources and achieve simple control, an oscillation circuit must be provided like an active buzzer. Active buzzers mainly use LC oscillation. If you want to actually build this circuit, the inductance parameters are difficult to control and the cost is high. At this point, you will naturally think of a simple RC oscillation, and the RC multivibrator circuit composed of transistors is obviously a good choice.

1.2 Transistor multivibrator circuit

Figure 1.2 Transistor multivibrator circuit

The general circuit of transistor multivibrator is shown in Figure 2. The principle of oscillation of this circuit is mainly to make the transistor alternately turned on through the charging and discharging of resistors and capacitors . First, when the circuit is powered on, capacitors C1 and C2 are charged through R1 and R4 respectively. Since the parameters of transistor components cannot be completely consistent, it can be assumed that transistor Q1 is saturated and turned on first. Since the voltage across the capacitor cannot change suddenly, the B pole of Q2 becomes negative voltage at this time, Q2 is cut off, and the Vo terminal outputs a high level; C1 is charged through R2, and when the potential of C2 makes the BE pole forward biased, Q2 is turned on, and the Vo terminal outputs a low level; similarly, the voltage across the C2 capacitor cannot change suddenly, and the B pole voltage of Q1 becomes negative voltage, and Q1 is cut off at this time. This cycle is repeated, so that a square wave signal of a certain frequency is output at the Vo terminal. As shown in Figure 3, the author used an oscilloscope to intercept the waveforms of the B pole and E pole of Q1 and Q2, and it can be found that it is consistent with the above analysis.

Figure 1.3 Multi-vibrator circuit charging and discharging waveforms

From the above analysis, it can be seen that the output signal frequency of Vo is controlled by the charging and discharging speed of R2 and C1, R3 and C2. Assuming that the C pole of Q2 is used as the output of the signal, the charging time T1 of R2 and C1 determines the high level time of the output signal, and the charging time T2 of R3 and C2 determines the low level time of the signal output. The frequency of the signal is: f=1/(T1+T2). From this, the formula of the output signal can be derived. Due to the RC charging time formula: t=R*C*Ln[(E-V0)/(E-Vt)], in this circuit, E is VCC, V0 is -(VCC-Vbe), and Vt is Vbe, then the final formula is: t=R*C*Ln[(2*VCC-Vbe)/(VCC-Vbe)].

Next, we can design the circuit parameters. The oscillation frequency of the buzzer in my hand is all 2.4KHz, so only the parameters of this frequency are calculated here. Assuming the capacitor C1=C2=0.1μF, VCC=5V, Vbe=0.63V, the resistance parameter can be calculated: R=1/(2*10-7*2.4*103*Ln[(2*5-0.63)/(5-0.63)])=2.7KΩ. As for the values ​​of R1 and R4, they only need to be smaller than R2 and R3. The steepness of the edge of the signal output is affected by these two resistors. The smaller the resistance, the steeper the edge. The circuit is built according to the calculated parameters. The test frequency is shown in Figure 4. The actual frequency is close to the theoretical value.

Figure 1.4 Actual output signal of multi-vibrator Vo 1.3 Improvement of passive buzzer drive circuit

The oscillation circuit above is already there, so how to drive and control the passive buzzer? In fact, you only need to make a simple modification to the circuit to achieve your goal.

First, replace R4 in the original circuit with a buzzer, and connect a diode in parallel at both ends of the buzzer . Careful readers who have read "EasyARM-iMX283 Teaches You How to Design a Buzzer Circuit" will find that there is no parallel capacitor at both ends of the passive buzzer . Through actual circuit measurement, the passive buzzer does not generate a spike pulse, so remove this capacitor, as shown in Figure 5.

The selection of the freewheeling diodes at both ends of the buzzer is very important. If the diode is not selected properly, it may cause instability in the buzzer circuit. The commonly used 1N4148 switching diode may make the charging circuit of the circuit unstable and make the buzzer sound hoarse. In this circuit, the author recommends that the diode should be a Schottky type diode.

Figure 1.5 Passive buzzer drive circuit

Second, a control terminal is added to the circuit. In the actual circuit, the buzzer cannot be kept beeping, so it needs to be controlled. The author has thought of two control circuits, and readers can also use their imagination to improve the circuit.

(1) Connect the B pole of Q to the IO port of the microcontroller through a small resistor , but this method requires the IO of the microcontroller to be in an open-drain or weak pull-up state. When the microcontroller outputs a low level, the voltage of the B pole is very low and will not be saturated and turned on, so the oscillation stops and the buzzer does not sound; when the IO outputs a high level, due to the weak pull-up (internal pull-up resistor is generally tens of K ohms) or open-drain state, it has almost no effect on the charging and discharging circuit of the circuit, the circuit starts to oscillate, and the buzzer sounds. The circuit is shown in Figure a of Figure 6.

(2) Use a diode to isolate the circuit. If the MCU IO is accidentally in the push-pull output state, the frequency of the circuit will be changed using the first method. If a diode is used for isolation, there is no need to worry about circuit abnormalities, and the same simple control as (1) can be achieved. However, it should be noted that the conduction voltage drop of the diode must be smaller than the Vbe of the transistor , so that the transistor is in the cut-off state. The circuit is shown in Figure 6 (b).

By comparing the two methods, we can find that adding a small resistor is a simple and cheap control method, but if you want to be "lazy", diode isolation is a good choice.

Figure 1.6 Passive buzzer control circuit

1.4 Passive buzzer circuit compatible design

Figure 1.7 Passive buzzer compatible design circuit

In order to design the circuit for compatibility, that is, to drive both passive and active buzzers, the author designed an improved circuit as shown in Figure 7. Compared with the circuit shown in Figure b of Figure 6, two resistors and two capacitors are mainly added. In actual use, the appropriate driving circuit can be selected according to the actual engineering application.

If you want to drive a passive buzzer, as shown in Figure 7a, the components marked in red do not need to be soldered. If you want to use an active buzzer in the circuit during the design process, you can modify it to the circuit shown in Figure 7b. Similarly, the components marked in red do not need to be soldered.

1.5 Analysis of driving circuit limitations

In fact, a careful analysis of this circuit also shows certain limitations. Since the oscillation frequency of this triode multivibrator circuit is mainly determined by the charge and discharge time of RC. Therefore, the selection of resistors and capacitors is particularly important. In most environments, the stability of resistors is relatively good, and capacitors are most susceptible to temperature changes. In this experiment, the author used a 100nF capacitor. According to the device manual provided by the manufacturer, the error is ±10% in the range of -55~+125 degrees. In other words, if the frequency is 2.4KHz at normal temperature (25 degrees), the oscillation will be in the range of 2.16KHz~2.64KHz in a harsh temperature environment. Therefore, the tone may change to a certain extent in high and low temperature environments.

In order to verify the conjecture, the author also did a simple experiment as a verification. The author controlled the temperature of the circuit board to about 85 degrees, and then used an oscilloscope to capture the output waveform of the transistor at this time. Through the oscilloscope, it was found that, as expected, the oscillation frequency had changed to about 2.7KHz, which was close to the estimated frequency. Then, in order to test the low-temperature characteristics of the circuit, the temperature of the circuit board was controlled to about -40 degrees. At this time, the output frequency of the test buzzer was about 2.25KHz. This data is also within the initial expected range. Interested readers can also try it out by themselves.

1.6 Product Recommendations

As shown in Figure 3.1, this is the M283 industrial-grade core board designed by Guangzhou Zhiyuan Electronics. This product is based on the Freescale i.MX283 ARM9 high-performance processor design, with a frequency of up to 454MHz. The power management unit integrates high-efficiency on-chip DC/DC, extremely low power consumption, and supports lithium-ion battery power supply. The M283 core board is suitable for the rapid development of a series of the most innovative applications, such as smart gateways, handheld devices, scanners, and portable medical devices.

Figure 3.1 M283 core board

Reference address:How to Design a Low-Cost Buzzer

Previous article:Watch the design of ARM controlled inverter power supply circuit
Next article:Design a PSR primary feedback switching power supply transformer together

Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号