Arduino Circuits

Buzzer and LED Warning Circuit

A circuit that gives a warning with both buzzer sound and LED light when a button is pressed.

November 22, 20264 min read
Buzzer and LED Warning Circuit — Arduino circuit built on a breadboard, showing components and connections
Buzzer and LED Warning Circuit circuit breadboard layout, components and jumper connections.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build

What is it for?

In this project, a buzzer is driven directly from a digital output pin, with its other end connected to ground. A button applies pressure to an input pin that is connected to the 5-volt rail through a 10-kilohm pull-up resistor. The red LED is fed from a separate output pin through its own 220-ohm series resistor. For as long as the button is pressed, the software runs the buzzer and lights the LED; when the button is released it turns both off. The buzzer produces sound by vibrating as current passes through it, while the LED reports the same state visually. This circuit teaches the simultaneous control of multiple output elements by one event and the input-triggered warning logic. Similar arrangements are used in alarm, notification and security systems.

Parts list

The following components are used to build this project:

  • Arduino Uno — Reads the input and drives two outputs at once.
  • Buzzer — Produces an audible warning.
  • Button — Triggers the warning.
  • 10kΩ Resistor — Keeps the input at HIGH level while released.
  • Red LED — Gives a visual warning.
  • 220Ω Resistor — Limits the current through the LED.
  • Ground — Common reference for all outputs.

Step-by-step build

  1. Place the board and put the buzzer on the upper row.One end of the buzzer goes to an output pin, the other to ground.
  2. Place the button on the lower row and pull it to the 5-volt rail with a 10-kohm resistor.The other end of the button will be ground.
  3. Connect the button's input node to a digital input pin.The resistor and the button must meet at the same node.
  4. Connect the red LED to a separate output pin with a 220-ohm resistor.Take the LED cathode to common ground.
  5. Meet the ground ends of the buzzer, button and LED on the common rail and run GND to the board.A single reference ensures stable operation.
  6. Upload the code; pressing the button starts the sound and the light together.The buzzer and LED must be driven inside the same condition.

How it works

When the button is pressed, the input pin is connected to ground and reads LOW; when released, the 10-kilohm resistor holds the pin at HIGH. When the software detects this LOW state, it sets two output pins HIGH at once. The voltage applied to the buzzer makes its piezoelectric element vibrate and produce sound, while the LED draws current through the 220-ohm resistor and emits light at the same time. Tying both outputs to the same condition means the event is reported both audibly and visually. The common ground line guarantees that the buzzer and the LED operate at the same reference voltage. This structure is the basis of systems where several warning devices are managed by a single trigger.

The buzzer is on the output line in the upper row and one end goes to ground. The button and the 10-kohm pull-up resistor form the input line on the lower row. The LED and the 220-ohm resistor are in the middle row, on a separate output pin from the buzzer. The ground ends of the buzzer, the button and the LED meet on the common rail.

What you will learn

  • Controls multiple outputs at once from one input event.
  • Explains how a buzzer is driven electrically.
  • Combines audible and visual warnings under one condition.
  • Provides stable input reading with a pull-up resistor.

Tips

  • If there is no sound, check both ends of the buzzer and the output pin.
  • If the LED lights but there is no sound, the buzzer pin may be defined incorrectly in the code.
  • If the warning stays on, the button's ground connection may be loose.

Try it yourself

  • Press the button and observe that the buzzer sound and the LED light start together.
  • Verify that both outputs turn off when the button is released.
  • Add a short delay in the code to change the duration of the warning.

Getting the parts

Frequently asked questions

What does this circuit do?

A circuit that gives a warning with both buzzer sound and LED light when a button is pressed.

How does the circuit work?

When the button is pressed, the input pin is connected to ground and reads LOW; when released, the 10-kilohm resistor holds the pin at HIGH. When the software detects this LOW state, it sets two output pins HIGH at once. The voltage applied to the buzzer makes its piezoelectric element vibrate and produce sound, while the LED draws current through the 220-ohm resistor and emits light at the same time. Tying both outputs to the same condition means the event is reported both audibly and visually. The common ground line guarantees that the buzzer and the LED operate at the same reference voltage. This structure is the basis of systems where several warning devices are managed by a single trigger.

What is the expected result?

When the button is pressed the buzzer sounds and the red LED lights up; when released both stop.

You may also like

Try the circuit in the simulator

Open the diagram in your browser, inspect the connections and follow the steps.