In this tutorial you will learn how to use a buzzer with Arduino.

17

Preparation:

  • Arduino uno
  • Breadboard
  • Buzzer
  • 100 Ohm resistor (optional)
  • Arduino IDE
  • PC

Connection:

F3DDJQ4IAP6UGTG.LARGE

Upload the following sample sketch to make the Buzzer make a beeping noise:

#define buzzer 9 //connect Buzzer to digital pin9
void setup() {                
 // initialize the digital pin9 as an output.
 pinMode(buzzer, OUTPUT);     
}

void loop() {
 digitalWrite(buzzer, HIGH);   // set the Buzzer on
 delay(500);                  // for 500ms
 digitalWrite(buzzer, LOW);   // set the Buzzer off
 delay(500);                
}

You can get more info about buzzer:http://osoyoo.com/2017/05/05/buzzer-5v-breadboard-friendlytmb12a05/

 

 

Leave a Reply

WordPress spam blocked by CleanTalk.
Bombax Theme designed by itx