Introduction: Buzzer With Arduino Uno Tutorial

About: pursuing Bachelors in Electronics and Communication at Chandigarh University

In this project a tone is generated by buzzer when set to high in Arduino code.

Buzzer - Piezo buzzers are simple devices that can generate basic beeps and tones. They work by using a piezo crystal, a special material that changes shape when voltage is applied to it. If the crystal pushes against a diaphragm, like a tiny speaker cone, it can generate a pressure wave which the human ear picks up as sound.

Ways of getting output from Arduino for buzzer:-

1. When connected to digital input/output pin buzzer get two values HIGH and LOW .

2. When connected to PWM pins namely pin 3,5,6,9,10,11 we can send values between 0V to 5V .

Step 1: Components Required

Step 2: Circuit Schematic

Pin 8 --> buzzer positive

GND --> buzzer negative

Step 3: Arduino Code

Upload buzzer.ino code to run this project.

void setup() {
// put your setup code here, to run once:

pinMode(8, OUTPUT);


void loop() {

// put your main code here, to run repeatedly:




delay(5000); }

Upload tone_function.ino code but remember to attach buzzer with PIN 6 as it is a PWM pin.

tone(pin number, frequency);

frequency is generated from 31 to 65540 but we prefer values between 1000 to 5000 which are tolerable for human ears.