Buzzer (Active/Passive) Module with Arduino Nano

This project demonstrates how to use a buzzer module with an Arduino Nano to produce sound or generate alerts. Buzzer modules can be either active or passive, each requiring different driving methods. In this project, we'll cover both types of buzzer modules.

Components Needed

Circuit Diagram

Circuit Setup

1.Buzzer Module Connection:

Connect the positive terminal (+) of the buzzer module to any digital pin (e.g., pin 2) on the Arduino Nano.

Connect the negative terminal (-) of the buzzer module to the ground (GND) pin on the Arduino Nano.

Instructions

1.Circuit Setup:

Connect the buzzer module to the Arduino Nano as described above.

2.Code Upload:

Copy and paste the provided code into the Arduino IDE.

Select the appropriate board (Arduino Nano) and port from the Tools menu.

Upload the code to the Arduino Nano.

3.Testing:

Observe the behavior of the buzzer module: it should produce sound with alternating on and off periods as specified in the code.

Applications

Audible Alerts: Use the buzzer module to provide audible alerts or notifications in Arduino projects.

Alarm Systems: Incorporate the buzzer module into alarm systems to indicate certain conditions or events.

Interactive Feedback: Provide audio feedback to users in interactive systems or games.

Notes

For passive buzzer modules, the frequency of the sound produced depends on the frequency of the signal applied.

For active buzzer modules, simply applying a HIGH signal turns the buzzer on, and applying a LOW signal turns it off.

Adjust the on and off times in the code to control the duration of sound produced by the buzzer.