Lesson:3 - Use a Piezo Buzzer with Arduino🎶 [ tone() and notone() functions explained ]

Опубликовано: 17 Май 2026
на канале: Electro Nerds Academy
1,388
50

Hello and welcome to Electro Nerds Academy. In this exciting tutorial, we’ll show you how to connect and control a piezo buzzer with your Arduino board. Whether you're just starting out or refining your electronics skills, this video will help you go beyond blinking LEDs and start generating sound!

What You’ll Learn:
✅ What a piezo buzzer is and how it works
✅ How to wire a buzzer to your Arduino
✅ How to make it beep using digitalWrite()
✅ How to control pitch using the tone() function
✅ How to stop sound with noTone()
✅ BONUS: How to create real melodies using different frequencies! 🎵
✅ Important limitations of the tone() function you should know

Code for Example:1(simple beeping using the digitalWrite() function)
void setup()
{
pinMode(8, OUTPUT);
}
void loop()
{
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
}

Code for Example:2(making a simple melody with the tone() function)
void setup()
{
pinMode(8, OUTPUT);
}
void loop()
{
delay(400);
tone(8, 262, 450);
delay(850);
tone(8, 294, 450);
delay(850);
tone(8, 330, 450);
delay(850);
tone(8, 349, 450);
delay(850);
tone(8, 392, 450);
delay(850);
tone(8, 440, 450);
delay(850);
tone(8, 494, 450);
delay(850);
tone(8, 523, 450);
delay(850);
}

👉 Subscribe for more beginner-friendly Arduino tutorials
👉 Like if you learned something new
👉 Comment with the melody you’ll try next!

Let’s bring your projects to life—one circuit at a time!

#Arduino #Buzzer #toneFunction #ArduinoProjects #PiezoBuzzer #LearnElectronics #notone() #tone() #ElectroNerdsAcademy