DOORBELL USING ARDUINO
In this project we will make arduino door bell using led ,pushbutton and piezo buzzer
Components Needed
LED
piezo buzzer
push button
arduino uno
resistors (10k,1k &220 ohm)
CIRCUIT DIAGRAM
YOU CAN CHECK TINKERCAD SIMULATION
PROGRAMMING CODE
int buzzer = 8; int button = 2; int LED = 3; int buttonState = 0; void setup() { // put your setup code here, to run once: pinMode (buzzer, OUTPUT); pinMode (button, INPUT); pinMode (LED,OUTPUT); } void loop() { // put your main code here, to run repeatedly: buttonState = digitalRead(button); if (buttonState == HIGH) { tone (8,400,800); digitalWrite(LED,HIGH); delay (1000); } else { noTone (8); digitalWrite(LED,LOW); } }