“Lesson 17--Microduino "Buzzer alarm"”的版本间的差异
Jasonsheng(讨论 | 贡献) (Created page with "{| style="width: 800px;" |- | ==Objective== We have used the buzzer in the light alarm experiment. This lesson will give a detailed instruction for the buzzer and use it simul...") |
|||
(未显示2个用户的2个中间版本) | |||
第1行: | 第1行: | ||
+ | {{Language|第十七课--Microduino_蜂鸣器警报器}} | ||
{| style="width: 800px;" | {| style="width: 800px;" | ||
|- | |- | ||
第34行: | 第35行: | ||
==Experimental schematic== | ==Experimental schematic== | ||
− | [[File: | + | [[File:lesson17-schematic.jpg|600px|center|thumb]] |
'''Note:In this experiment must use passive buzzer''' | '''Note:In this experiment must use passive buzzer''' | ||
2014年3月2日 (日) 14:59的最新版本
Language | English |
---|
目录ObjectiveWe have used the buzzer in the light alarm experiment. This lesson will give a detailed instruction for the buzzer and use it simulate the air defense warning. Equipment
BuzzerBuzzer is an integration of electron acoustic structure, divided into two types, piezoelectric buzzer and magnetic buzzer. Piezoelectric buzzerPiezoelectric buzzer is mainly composed by the multivibrator, piezoelectric, impedance matching unit and sound box, shell and so on. As shown in figure Magnetic buzzerMagnetic buzzer is composed by the oscillator, the electromagnetic coil, magnets, vibration membrane and shell. Active buzzer and passive buzzer
Difference
Experimental schematicNote:In this experiment must use passive buzzer Programvoid setup()
{
pinMode(3,OUTPUT);
}
void loop()
{
for(int i=200;i<=800;i++) //Dynamic to set the frequence from 200HZ to 800HZ in a cycle
{
tone(3,i); //Output the frequence in port 4
delay(5); //Keep this frequence 5ms
}
delay(4000); //Keep 4mins in the Highest frequence
for(int i=800;i>=200;i--)
{
tone(3,i);
delay(10); //Keep this frequence 10ms
}
}
ResultAfter download, you can hear the alarm. Maybe you have found that buzzer with the polarity, actually passive buzzer is nonpolar, and active buzzer is polarity, but for the production cost savings and unified adopted active buzzer encapsulation, so we have the same results for both pin connection. Video |