Home >
Microcontroller >Interface Circuits > Improvement of microcontroller-driven piezoelectric buzzer
Improvement of microcontroller-driven piezoelectric buzzer
Source: InternetPublisher:酷到被通缉 Keywords: Piezoelectric drive Updated: 2023/11/22
This article focuses on how to use a microcontroller to drive a piezoelectric buzzer with a large AC voltage. It uses a four-MOSFET circuit connected to two I/O pins of the microcontroller (Reference 1). The following is a modification and expansion of this circuit in this article, which can save the I/O pins of a microcontroller. The gate of Q4 is connected to the drain of Q2, not the second I/O pin (picture). The microprocessor applies a high logic level to the I/O pin, causing Q2 to conduct, pulling Node A to a low logic level. This action opens Q3 and closes Q4. The voltage on Node B goes to 15V and Q1 turns off. The voltage on the piezo element is now 15V.
A microcontroller I/O pin drives this circuit, producing an AC voltage across the piezoelectric buzzer
The microcontroller then switches the I/O pin low and Q2 turns off. Q1 is also off, so Node A slowly rises to a high logic level through pull-up resistor R1. When the voltage on Node A reaches the switching threshold of the inverter formed by the pair of Q3 and Q4 tubes, Q3 turns off quickly and Q4 turns on quickly. As a result, the low logic level on Node B turns Q1 on and accelerates the voltage rise on NodeA. Now, the 15V voltage on the piezoelectric buzzer is of opposite polarity.
R2 weakens the coupling between the output and input of Q4 due to the presence of the piezoelectric element. An R2 value of 330Ω is usually sufficient to suppress high-frequency oscillations caused by feedback. If the resistance of R1 is small, it will increase the power pulled from the power supply. If the value of R1 is too large, it will also increase power consumption, because it will prolong the switching time of the transistor and increase the related through current. The optimal value for R1 is around 1kΩ.
This design saves an I/O pin, but at the expense of increased power consumption. Therefore, the power consumption of the circuit is an order of magnitude higher than that of the circuit described in the previous design example.
Latest Microcontroller Circuits
- Analysis of circuit design of MCU controlled relay
- AD8351 and SAW filter interface circuit
- How to use ESP8266 to make a mini fully functional clock
- How to make a simple quadcopter using ESP8266
- How to use ESP8266 to design a portable air quality monitoring station
- Make a capacitive soil moisture sensor using ESP32
- Experiment on using 51 microcontroller to drive relay
- Use microcontroller to make simple timing controller for electric fan
- 815ept motherboard
- Decoding infrared remote control using microcontroller