Make the buzzer sound

Publisher:和谐相伴Latest update time:2024-08-16 Source: cnblogs Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The circuit diagram of the buzzer on the development board schematic is as follows. According to the video, we know that it is a passive buzzer.

You can see that one end of the buzzer is connected to the resistor, and the other end is connected to pin BZ. Note that this BZ is not the name of Yuanqi. As you can see from the picture, Yuanqi names are all blue, while this BZ is red.

BZ pin. We found that there is a BZ pin on the ULN2003D chip, so we put the buzzer diagram and the ULN2003D diagram on one diagram, and connected the pins they should be connected to.

As can be seen from the figure, the BZ pin of the BZ1 buzzer is connected to the 12th pin of the ULN2003 pin, which is an output pin, and the corresponding input pin is the 5th pin. As can be seen from the figure, the P15 pin of the STC89C52 microcontroller is connected to the 5th pin of the ULN2003.

So the buzzer can be controlled by a single-chip microcomputer. That’s how it works.

ULN2003

I can't understand the chip schematic diagram. To be continued

The above is the information I have compiled. I still don't understand why the Darlington tube has a reverse effect? ​​Doesn't the Darlington tube amplify current? Why does it have a reverse effect? ​​I don't understand the freewheeling diode either.

I think I understand one question, why can't the P15 of the microcontroller be directly connected to the BZ pin of BZ1? Because a certain current is required to make the buzzer sound, and the current output by the microcontroller pin is very small, so the current output by the microcontroller pin must be amplified. We can use transistors to amplify the current. In fact, many examples of using transistors to drive buzzers can be found on the Internet.

For example, the following figure:

For example, the following figure:

But why is ULN2003 used to drive the buzzer in STC89C52? Because there is no separate transistor on the board for us to use, and ULN2003 also has the function of amplifying current, and it is also for the purpose of getting familiar with the ULN2003 chip.

Think about why the light-emitting diode is directly connected to the pin of the microcontroller. Doesn't the LED need a driving current to work? I guess the current of the microcontroller pin is just enough to drive the LED.

In fact, there is a very simple truth. Any electrical appliance needs a working voltage, such as a buzzer or an LED lamp. This voltage is called the rated voltage, and some are called the driving voltage. The driving current is the same thing. If you know the rated voltage, you can know the rated current. Take the buzzer as an example. The rated voltage is 5V, so the rated current can be calculated. If P15 is directly connected to the buzzer, the current flowing into the buzzer will not meet the rated current. What should I do? Let the current be amplified until it meets the rated current. What should I use to amplify the current? Transistors or ULN2003, that's the idea, it's clear.


Reference address:Make the buzzer sound

Previous article:Keil new project and project settings
Next article:Some questions about the delay function

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号