Interfacing of Buzzer with Arduino Uno.
What is a Buzzer?
Buzzers are used for making beep alarms and tones. They can be used in alarm systems, for keypad feedback, or some games. Lightweight, simple construction and low price make it usable in various applications like car/truck reversing indicators, computers, call bells etc.
Material Required:
Material Quantity
Arduino Uno 1
Buzzer 1
Jumper cables 5
Resistor 1(100 ohms)
Pinout Diagram:
Circuit Diagram:
The Connections are pretty simple:
Connect the Supply wire (RED) of the buzzer to the Digital Pin 9 of the Arduino through a 100-ohm resistor.
Connect the Ground wire (BLACK) of the buzzer to any Ground Pin on the Arduino.
Tested Programming Code:
This code is to generate an alarm type of sound. The tone is an Arduino Library to produce a square wave of the specified frequency
(and 50% duty cycle) on any Arduino pin.
const int buzzerPin = 9;
void setup() {
Serial.begin(8600);
pinMode(buzzerPin, OUTPUT);
void loop() {
tone(buzzerPin, 50);
delay(50);
noTone(buzzerPin);
delay(100);
}
}
Precautions:
1. Double-check the connections before powering on the circuit.
2. Don’t use loose jumper cables.
3. Check whether the proper board is selected from Arduino IDE.
4. Ensure proper placement of Buzzer for correct working.
5. Don’t lose hope if Buzzer does not run properly for the first time, try again.
Conclusion:
You can Use Buzzer as an Alarm and many Other Alerting Devices.