Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Buzzer with Pushbutton Activation

View and Edit Project In Cirkit DesignerImage 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

Arduino UNO

Pushbutton

Buzzer

Wiring Details

Resistor

Arduino UNO

Pushbutton

Buzzer

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.