Difference between revisions of "Sensor-Buzzer"

From Microduino Wiki
Jump to: navigation, search
m (Fengfeng moved page Microduino-Buzzer to Sensor-Buzzer)
Line 29: Line 29:
 
*Hardware Needed: [[Microduino-Core]], [[Microduino-USBTTL]], [[Microduino-Sensorhub]], several dupont lines and USB cable;   
 
*Hardware Needed: [[Microduino-Core]], [[Microduino-USBTTL]], [[Microduino-Sensorhub]], several dupont lines and USB cable;   
 
*Software:
 
*Software:
**Make sure you did build Microduino development envrionment or you need to refer to: [[Microduino Getting start]]
+
**Make sure you did build Microduino development environment or you need to refer to: [[Microduino Getting start]]
 
*Program
 
*Program
 
<source lang="cpp">
 
<source lang="cpp">

Revision as of 09:52, 28 September 2016

Language: English  • 中文
Microduino-Buzzer

Microduino-Buzzer is a passive buzzer. Like a magnetic speaker, it needs voltage with different frequency so that it can make sound accordingly. The pitch becomes louder when the frequency gets higher.



Feature

  • Controllable sound frequency (eg: You can achieve the effect of piano spectrum with it. )
  • Small size and beautiful

Specification

  • Operation voltage—3.3V~5V;
  • 1.27mm pitch and 4Pin interface;


Document

Development

It can be used to make various kinds of sound through the buzzer.

Application

#define buzzer_pin 6
void setup()
{
  pinMode(buzzer_pin,OUTPUT);
}
 
void loop()
{
  for(int i=200;i<=800;i++)  //Increase the frequency from 200HZ to 800HZ circularly. 
  {
    tone(buzzer_pin,i);    //Output frequency in the port. 

    delay(5);      //The frequency lasts for 5ms.  
  }
  delay(1000);     //The highest frequency lasts for 1s. 
  for(int i=800;i>=200;i--)
  {
    tone(buzzer_pin,i);
    delay(10); //The frequency lasts 10ms.   
  }
}
  • Stack all the modules and then connect the interface on the back of BUZZER to the D6 digital port of Sensorhub.
  • Open IDE, copy the program to IDE, choose the right board, compile and download.
  • You can hear the alarm after download.


Purchase

History

Image

  • Front
Microduino-Cube-Station Front
  • Back
Microduino-Cube-Station Back