Hello and welcome to Surilli Kit tutorials. Today we are going to Interface a Piezo buzzer with Surilli GSM. A buzzer has numerous applications and is commonly used to generate alerts or status of any process or exception.
What is a Piezo Buzzer?A buzzer or beeper is an audio signalling device, which may be mechanical, electromechanical, or piezoelectric (piezo for short).
Piezo buzzer is an electronic device commonly used to produce sound. Light weight, simple construction and low price make it usable in various applications like car/truck reversing indicator, computers, call bells etc.
Step 1: HardwareInterfacing a Piezo Buzzer is as simple as connecting a simple LED with Surilli or any other Development board e.g an Arduino.
We are using an Active Buzzer here which means providing it a high digital signal which would make a beep and low means no sound. Its as simple as that. Let's just jump into the circuitry.
Circuitry:After you are done with the circuit, plug in you Surilli device to the PC and upload the sketch given below.
Step 2: Setting up Arduino IDE:Open Arduino IDE and make sure that you have selected the right board & port.
Now copy and paste the Arduino IDE sketch from down below.
NOTE: If you are using this device for the first time you might need to set it up with Arduino IDE first. Visit Getting Started With Surilli GSM and then follow Step 2.
void setup() {
//Initializing pin 12 as Output Pin. This is the signaling pin for buzzer
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(12, HIGH); // turn the buzzer beep on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(12, LOW); // turn the buzzer beep off by making the voltage LOW
delay(1000); // wait for a second
}
That's it. The buzzer would beep alternatively after every second. You can play with it and set it according to your need.
There are more ways to analog-ly (not a word I guess but makes some sense lol) control the buzzer sound based on frequency. We will look into it in the next tutorial. See you until then :)
If you have any queries, feel free to contact us at surilli.io
Comments