Home > Projects > Arduino Programmer Projects > How To Connect A Buzzer To An Arduino

How To Connect A Buzzer To An Arduino

Summary of How To Connect A Buzzer To An Arduino


This article explains how to connect a buzzer operating at a different voltage (5V–24V) or higher current than an Arduino pin can handle by using an NPN transistor. The circuit allows the buzzer to be powered from an external source like a 12V battery while controlling it via the Arduino, ensuring common ground between the power supply and the board.

Parts used in the Arduino Buzzer Circuit:

  • Arduino (e.g., Arduino Uno)
  • Buzzer (operating at 5V to 24V)
  • NPN Transistor (e.g., PN2222)
  • Base Resistor (2k2)
  • External Power Supply (e.g., 12V battery)

This article and circuit diagram show how to connect a buzzer to an Arduino when the buzzer operates at a different voltage to the Arduino. The buzzer may operate at 9V, 12V or some other voltage. Arduinos such as the Arduino Uno operate from 5V. All the voltages referred to here are D.C. voltages (direct current).
The same circuit used here can also be used to operate a 5V buzzer when the buzzer draws more current than the Arduino pin can handle, so can not be connected directly to the Arduino pin. To directly connect a low power 5V buzzer to an Arduino, refer to the article: Connecting a Buzzer to an Arduino Uno.Arduino Buzzer Circuit

Arduino Buzzer Circuit Diagram

The circuit shown here uses a NPN transistor to connect the buzzer to the Arduino. The transistor allows the buzzer to be powered from a different voltage to the Arduino. Any NPN transistor that can handle the current drawn by the buzzer can be used.
With a PN2222 and 2k2 base resistor, the circuit can be used to operate a buzzer that draws up to about 200mA.

Although the circuit shows the buzzer being powered from 12V, the circuit allows any buzzer that operates from about 5V to around 24V to be used.
When the external power supply (12V in the circuit diagram) is connected, the GND or 0V of the power supply must be connected to the GND of the Arduino.
So the above circuit means that the connections must be made as follows:
The power supply powering the buzzer in this circuit is a 12V battery.Arduino Buzzer Circuit Schematic

Arduino Sketch

The Arduino sketch below operates the above circuit by pulsing the buzzer on for a short period of time continuously.
This video shows the buzzer powered from a 9V battery and the Arduino powered from a USB cable. The Arduino is running the above sketch.

 

For more detail: How To Connect A Buzzer To An Arduino

 

Quick Solutions to Questions related to Arduino Buzzer Circuit:

  • Why use a transistor to connect a buzzer to an Arduino?
    The transistor allows the buzzer to be powered from a different voltage than the Arduino or handles current levels exceeding what an Arduino pin can support.
  • What type of transistor is recommended for this circuit?
    Any NPN transistor that can handle the current drawn by the buzzer can be used, such as the PN2222.
  • Can this circuit operate a 9V buzzer?
    Yes, the circuit allows any buzzer that operates from about 5V to around 24V to be used.
  • How much current can a PN2222 with a 2k2 base resistor drive?
    The circuit can operate a buzzer that draws up to about 200mA when using a PN2222 and 2k2 base resistor.
  • How should the grounds be connected in this setup?
    The GND or 0V of the external power supply must be connected to the GND of the Arduino.
  • Does this method work for 5V buzzers drawing high current?
    Yes, the same circuit can be used to operate a 5V buzzer when it draws more current than the Arduino pin can handle.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top