> For the complete documentation index, see [llms.txt](https://learn.arduinosa.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.arduinosa.co.za/arduino-kits/basic-starter-kit/active-buzzer.md).

# Active Buzzer

### **Component Required:**

* 1 x Uno R3
* 1 x Active buzzer
* 1x 830 Tie Points Breadboard
* 2x M-M wires (Male to Male jumper wires)

#### **BUZZER:**

Electronic buzzers are DC-powered and equipped with an integrated circuit. They are widely used in computers, printers, photocopiers, alarms, electronic toys, automotive electronic devices, telephones, timers and other electronic products for voice devices. Buzzers can be categorized as active and passive ones. Turn the pins of two buzzers face up. The one with a green circuit board is a passive buzzer, while the other enclosed with a black tape is an active one.

![](/files/Bva9ByogulIRqPYQNSeo)

### **Connection Diagram:**

![](/files/GYlDBEZ2OP8KtHBEfqQE)

### **Wiring schematic:**

![](/files/Webzq8qADUHWcqo2aKEj)

### **Physical wiring diagram:**

![](/files/iywh6Rg2pfIO6FhnMAa1)

### **Code:**

{% hint style="warning" %}
After wiring add the "pitches.h" library. Download this file below.

You can click [here](/arduino-kits/basic-starter-kit/add-libraries.md) to see how to add a library.
{% endhint %}

{% file src="/files/Xkixck8f25IUfx2S3RoA" %}

```
#include "pitches.h"// notes in the melody:
int melody[] = {
  NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5, NOTE_C6
};
int duration = 500;  // 500 miliseconds
void setup() {  }
void loop() {
  for (int thisNote = 0; thisNote < 12; thisNote++) {
    // pin12 output the voice, every scale is 0.5 sencond
    tone(12, melody[thisNote], duration);
    delay(100);
    // Output the voice after several minutes
    delay(100);
  } // restart after two seconds
  delay(200);
}
```

You can also download the code below

{% file src="/files/IzX8WDwWUBEgxyPKGi74" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.arduinosa.co.za/arduino-kits/basic-starter-kit/active-buzzer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
