Experiment 2 Experiment With Buzzer



The components are one buzzer,two jumper wires, and one breadboard.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Schematics

The long pin of the buzzer is positive,and the shorter one is negative. This is also marked on the bottom of the buzzer.

Step 2: Wiring Diagram

The positive pin of the buzzer is wired to digital IO pin 7 of Arduino, and the negative pin is connected to GND of the Arduino.

Step 3: Arduino Code

Arduino Code:

int buzzer=7;//Configure the control digital IO pin
void setup()
pinMode(buzzer,OUTPUT);//Set the mode of the digital IO pin to be
void loop()
unsigned char i,j;//Defined a variable
for(i=0;i<80;i++)//output a sound with a frequency
digitalWrite(buzzer,HIGH);//make a sound
delay(1);//delay 1ms
delay(1);//delay 1 ms
for(i=0;i<100;i++)//Output a sound with another frequency
digitalWrite(buzzer,HIGH);//make a sound
delay(2);//delay 2ms

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest