Arduino Make custom bell for your office/room

Arduino Make custom bell for your office/room

This Project will demonstrate the use of Push Button & Buzzer to make your custom bell for room/office.

Hardware Required:

1x Arduino Uno

1x Buzzer

1x Push Button

1x 10K Resistor

1x Bread Board & Some Jumpire Cables M-M

Want to Buy Complete Kit Click Here

Arduino Pin Layout:

Code:

/*
* OR97 Arduino Maker Basic Kit
* Project#7 Room/Office Bell.
* Made By: OR97 Team
* Kit Link=https://www.or97.com/arduino-maker-basic-kit
*/

const int buzzer = 3; //buzzer to arduino pin 3
const int pushBtn=2;

void setup(){
pinMode(pushBtn,INPUT);
pinMode(buzzer, OUTPUT); // Set buzzer – pin 3 as an output

}

void loop(){

int btnValue=digitalRead(pushBtn); // Read the Button State Pressed or not
if(btnValue==1){
tone(buzzer, 3000); // Send 3KHz sound signal…
delay(2000);
noTone(buzzer); // Stop sound…
delay(1000); // …for 1sec
}
delay(10);
}