Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO Controlled Buzzer with Pushbutton Activation

Image of Arduino UNO Controlled Buzzer with Pushbutton Activation

Circuit Documentation

Summary of the Circuit

This circuit is designed to activate a buzzer when a pushbutton is pressed. It consists of an Arduino UNO microcontroller, a resistor, a pushbutton, and a buzzer. The Arduino UNO is programmed to read the state of the pushbutton and control the buzzer accordingly. When the button is pressed, the buzzer emits a sound. The resistor is used to limit the current flowing through the pushbutton.

Component List

Resistor

  • Description: A passive two-terminal electrical component that implements electrical resistance as a circuit element.
  • Purpose: To limit the current flowing through the pushbutton.
  • Resistance: 10,000 Ohms

Arduino UNO

  • Description: A microcontroller board based on the ATmega328P.
  • Purpose: To control the buzzer based on the state of the pushbutton.

Pushbutton

  • Description: A simple switch mechanism for controlling some aspect of a machine or a process.
  • Purpose: To provide user input to the circuit.

Buzzer

  • Description: An audio signaling device.
  • Purpose: To emit a sound when activated by the Arduino UNO.

Wiring Details

Resistor

  • Connected to:
    • One end to the pushbutton (Pin 3 - out).
    • The other end to the Arduino UNO (Digital Pin 4).

Arduino UNO

  • Digital Pin 4: Connected to the resistor and pushbutton.
  • Digital Pin 8: Connected to the buzzer PIN.
  • GND: Connected to the buzzer GND and one end of the resistor.
  • Vin: Connected to the pushbutton (Pin 4 - out).

Pushbutton

  • Pin 3 (out): Connected to the resistor.
  • Pin 4 (out): Connected to the Arduino UNO Vin.
  • Pin 1 (in): Connected to the Arduino UNO Digital Pin 4.
  • Pin 2 (in): Not connected in this circuit.

Buzzer

  • PIN: Connected to the Arduino UNO Digital Pin 8.
  • GND: Connected to the Arduino UNO GND.

Documented Code

// Filename: sketch.ino

void setup()
{
  pinMode(4, INPUT); // Set the button pin as an input
  pinMode(8, OUTPUT); // Set the buzzer pin as an output
}

void loop()
{
  int buttonState = digitalRead(4); // Read the state of the button
  if (buttonState == HIGH) // Button is pressed when it reads HIGH
  {
    digitalWrite(8, HIGH); // Activate the buzzer by sending HIGH signal
  }
  else
  {
    digitalWrite(8, LOW); // Turn off the buzzer when the button is not pressed
  }
}

This code is written for the Arduino UNO microcontroller. It initializes the digital pins connected to the pushbutton and buzzer. In the loop function, it continuously checks the state of the pushbutton. If the button is pressed (reads HIGH), it activates the buzzer. If the button is not pressed, it turns off the buzzer.