Buzzer (HC6800-EM3 V2.2 development board)

Publisher:EtherealEssenceLatest update time:2022-05-26 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Active/passive buzzer

The picture shows a passive buzzer - it can be clearly seen that there is a "+" on the top of the package and a green circuit board on the bottom; (the passive buzzer in the HC6800-EM3 V2.2 development board)

The picture shows: an active buzzer - it can be clearly seen that its package is sealed with black glue and there is no "+" on the top, and there is no green circuit board on the bottom;


Buzzers are divided into two categories

Electromagnetic buzzer:

The electromagnetic buzzer (active) consists of an oscillator, an electromagnetic coil, a magnet, a vibrating diaphragm and a casing.

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. Under the interaction between the electromagnetic coil and the magnet, the vibrating diaphragm vibrates periodically and produces sound.


Piezoelectric buzzer:

The piezoelectric buzzer (passive) is mainly composed of a multivibrator, a piezoelectric buzzer, an impedance matcher, a resonance box, a casing, etc.

The multivibrator is composed of 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 matcher drives the piezoelectric buzzer to sound.


Buzzer circuit diagram

Driving principle

The self-excited buzzer is driven by DC voltage and 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 through the amplifier circuit to make the buzzer sound. It is very simple.

By changing the duty cycle of the high and low levels of the output level, the volume of the buzzer can be controlled. (Duty cycle = high level signal duration / cycle)

By changing the frequency of the waveform output by the microcontroller pin, the tone of the buzzer can be adjusted to produce sounds with different timbres and tones.

It is worth noting that the IO port of the microcontroller is only used to control the buzzer;


Code

#include

sbit beep = P1^5;

void delay(unsigned int x);


void main()

{

while(1)

{

beep=~beep;

delay(10);//1ms=10^3us;f=1/T;

}

}


void delay(unsigned int x)

{

while(x--);

}


Development board connection diagram

J8 is connected to P1.5;

Reference address:Buzzer (HC6800-EM3 V2.2 development board)

Previous article:Getting Started with C51 MCU - Buttons
Next article: library functions

Latest Microcontroller 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号