Arduino – Push Button- Buzzer Activation Program with Component Connection

Objective:

         To Control (ON/ OFF) the devices using mechanical switching operation

Components Required

  • Arduino Uno
  • Push Button
  • Buzzer

Connection Diagram

Program

int SwitchPin = 2, ButtonPin= 3, BuzzPin=13, sensorValue ;

void setup()

{

pinMode(ButtonPin, INPUT);

pinMode(BuzzPin, OUTPUT);

Serial.begin(9600);

}

void loop()

{

sensorValue = digitalRead(ButtonPin);

if(sensorValue == HIGH)

{

Serial.println(“LED ON”);

digitalWrite(BuzzPin, HIGH);

}

else

{

Serial.println(“Buzzer OFF”);

digitalWrite(BuzzPin, LOW);

}

}

Working

         The Push Button is a  switch. It has input side and output side. The Push button is connected in the path of the device and the power supply. One end connected to the device and the other end connected to the supply. Whenever the button is pressed the path is closed and current flows and make the device ON. If it is not pressed the path is open, no current flows and make the device OFF

Output

The Buzzer makes Sound (when Push Button Pressed)

The Buzzer is Idle (when Push Button not Pressed)

Temperature Measurement using DHT11and Arduino Program with Component Connection

Leave a Reply

Your email address will not be published. Required fields are marked *

Navigation

My Cart

Close
Viewed

Recently Viewed

Close

Great to see you here !

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Already got an account?

Quickview

Close

Categories