Detailed explanation of AT89C52 control buzzer circuit diagram

Publisher:sheng44Latest update time:2023-03-28 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  Introduction to buzzer

  1. The function of the buzzer The buzzer is an electronic buzzer with an integrated structure. It is powered by DC voltage and is widely used in computers, printers, copiers, alarms, electronic toys, automotive electronic equipment, telephones, timers and other electronics. The product is used as a sound-generating device.

  2. Classification of buzzers Buzzers are mainly divided into two types: piezoelectric buzzers and electromagnetic buzzers.

  3. Buzzer circuit graphical symbols The buzzer is represented by the letter "H" or "HA" in the circuit (the old standard is represented by "FM", "LB", "JD", etc.).


  Buzzer classification:

  Buzzers are divided into piezoelectric buzzers and electromagnetic buzzers according to different structures; whether they are piezoelectric buzzers or electromagnetic buzzers, there are active and passive distinctions. Among them, "active" "Source" means that the buzzer itself has a built-in driver, and it can sound directly by giving it a certain voltage; "passive" means that it needs an external driver to sound.


  The structural principle of the buzzer:

  Piezoelectric buzzer: uses the piezoelectric effect of piezoelectric ceramics to drive the vibration of metal sheets to produce sound. It is mainly composed of a multivibrator, a piezoelectric buzzer, an impedance matching device, a resonance box, and a shell. Some piezoelectric buzzers are also equipped with light-emitting diodes on their casings. Multivibrators are constructed from transistors or integrated circuits. When the power is turned on (1.5~15V DC working voltage), the multivibrator starts to oscillate and outputs an audio signal of 1.5~2.5kHZ. The impedance matching device drives the piezoelectric buzzer to sound.


  The piezoelectric buzzer is made of lead zirconate titanate or lead magnesium niobate piezoelectric ceramic material. Silver electrodes are plated on both sides of the ceramic sheet, and after polarization and aging treatment, they are bonded together with brass or stainless steel sheets.


  Piezoelectric buzzers require relatively high voltage to have sufficient sound pressure, and it is generally recommended to be above 9V. Some specifications of piezoelectric can reach more than 120dB, and larger sizes can easily reach 100dB.


  Electromagnetic buzzer: Using the principle of electromagnetism, the metal vibrating diaphragm is sucked down when energized, and rebounds according to the elasticity of the vibrating diaphragm when not energized. It is composed of an oscillator, electromagnetic coil, magnet, vibrating diaphragm and shell. After the power is turned on, the audio signal current generated by the oscillator passes through the electromagnetic coil, causing the electromagnetic coil to generate a magnetic field. The vibrating diaphragm periodically vibrates and produces sound under the interaction of the electromagnetic coil and the magnet.

Detailed explanation of AT89C52 control buzzer circuit diagram

  Buzzer circuit diagram

  AT89C52 introduction:

  AT89C52 is a low-voltage, high-performance CMOS 8-bit microcontroller produced by Atmel Company of the United States. It contains 8KB of rewritable program memory and 12B of random access data memory (RAM). The device adopts Atmel's high-density, non-volatile Produced with volatile storage technology, it is compatible with the standard MCS-51 instruction system. It is equipped with a general-purpose 8-bit central processing unit (CPU) and Flash storage unit on-chip. The powerful AT89C52 microcontroller can be flexibly used in various control fields. The AT89C52 microcontroller is an enhanced version of the AT89C51 microcontroller and is compatible with Intel's 80C52 in terms of pin arrangement, hardware composition, operating characteristics and command system. Its main working characteristics are:

  The on-chip program memory contains 8KB of Flash program memory, with a rewritable lifespan of 1,000 times;


  The interrupt system is an interrupt structure with 8 interrupt sources, 6 interrupt vectors, and 2 levels of priority;

  The serial port is a full-duplex programmable serial communication port; it has a data pointer DPTR;

  Low-power working modes include idle mode and power-down mode; with programmable 3-level program lock bit;

  The working power supply voltage of AT89C52 is 5 (1+0.2) V, and the typical value is 5V; the maximum working frequency of AT89C52 is 24MHz, here we use 11.0592MHz. The AT89C52 picture is as follows:

Detailed explanation of AT89C52 control buzzer circuit diagram

      AT89C52 control buzzer circuit diagram

  The buzzer circuit consists of a 220 ohm resistor, a transistor 8550, and a buzzer, as shown in Figure 10. By controlling the conduction and cut-off of the transistor, the buzzer can sound or not.

Detailed explanation of AT89C52 control buzzer circuit diagram

Detailed explanation of AT89C52 control buzzer circuit diagram  
flow chart

  Microcontroller controls the sounding and closing of active buzzer

  As you can see from the picture below, the circuit uses the I/0 port P3.4 of the microcontroller to control the buzzer. However, in the figure, P3.4 is not used to directly control the buzzer, but indirectly controlled through the transistor 8550. This is because the current that can flow in and out of the I/0 port of the microcontroller is limited. Some buzzers require a relatively large current to sound, which the I/0 of the microcontroller cannot meet. The transistor 8550 can provide a maximum current of more than 1A, which is enough to drive the buzzer, so P3.4 is used to control the conduction and cutoff of the transistor 8550 to achieve the purpose of controlling the buzzer. Let’s first look at the control principle of this circuit:

  When writing logic "1" to P3.4, P3.4 outputs +5V, the base current of the transistor 8550 is 0, the transistor is in a cut-off state, the power supply +5V cannot be added to the positive pole of the buzzer, and the buzzer does not sound. When writing logic "0" to P3.4, P3.4 outputs OV, and a current is generated between the emitter and base of the transistor 8550. In Figure 1, the current limiting resistor R1 takes an appropriate value to make the transistor saturated. In the conduction state, the power supply +5V is added to the positive electrode of the buzzer through the emitter and collector of the triode, and current flows through the positive and negative electrodes of the buzzer, and the active buzzer starts to sound.

Detailed explanation of AT89C52 control buzzer circuit diagram

  In this way, controlling the sound of the active buzzer becomes writing logic "1" or logic "0" to port P3.4. The following program can make the active buzzer sound "beep" and "beep":

  #include《reg52.h》

  sbitBuzzer=P3h4;1/[Note 1]

  //Main program voiDMAin(void){//Loop statement, make the buzzer sound continuously at intervals of 0.5 seconds, stop for(;;){delay(): //Delay 0.5 seconds, for specific procedures, see the previous issue of BUzzerh =1; //[Note 2]

  }

  }


Reference address:Detailed explanation of AT89C52 control buzzer circuit diagram

Previous article:Internal clock circuit design of AT89S51 microcontroller
Next article:89c51 microcontroller minimum system, detailed function explanation of 89c51 minimum system schematic diagram

Recommended ReadingLatest update time:2024-11-16 10:29

Microcontroller buzzer control program and drive circuit
Buzzers are divided into piezoelectric buzzers and electromagnetic buzzers based on their structure. Piezoelectric buzzers use piezoelectric ceramics to make sounds, and the current is relatively small, while electromagnetic buzzers use coils to vibrate and make sounds, and are relatively small in size. According to t
[Microcontroller]
Microcontroller buzzer control program and drive circuit
AVR microcontroller (ATMEGA16) controls the buzzer
#include iom16v.h    #include macros.h    #define uchar unsigned char   #define uint unsigned int   #define DELAY 500   void delay(uint z)    //1ms   {    uint x,y;    for(x=z;x 0;x--)     for(y=157;y 0;y--);   }   void main(void)   {    DDRA |=BIT(0);    while(1)    {     PORTA &=~BIT(0);     delay(
[Microcontroller]
AVR microcontroller (ATMEGA16) controls the buzzer
HT47 Buzzer Application
HT47 Buzzer Application include ht47c20.inc data .section 'data' count1 db ? count2 db ? ;**************************** code .section at 0 'code'  org 00h  jmp start ;****************************  org 20h start: clr i NTC 0  clr intc1 loop: clr pa.1  clr pa.0  call delay  set pa.1  call delay  set pa.0  call delay  j
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号