Anti-doorbell

by IanK76 in Circuits > Arduino

462 Views, 1 Favorites, 0 Comments

Anti-doorbell

IMG_0482.JPG
IMG_0484.JPG
IMG_0486.JPG
IMG_0487.JPG
IMG_0488.JPG
Arduino Anti Doorbell

The Arduino project creates a way to prevent a doorbell from activating continually when the doorbell is pressed. The code is really simple to follow.

Supplies

20220925_145802.jpg
20220925_145048.jpg
20220925_145102.jpg
20220925_145129.jpg

One installed doorbell system (represented by a four pushbutton or single wire)

One Arduino

One 5V relay module

One 3 pin cable

Relay Attachment

FC478ZLL8HCQI57.jpg

Setup Arduino with the relay on the pin defined, for this example it is pin 13, this pin also lights the built in led, good for testing relay signal.

Test Circut

F81MJXYL8HCQI58.jpg

Program the Arduino with following code and attach test pushbutton or wire connected to pin 2 to simulate doorbell. When delay times are to your likening prosed.


// copy and paste the following into a new Arduino IDE Sketch

// constants won't change. They're used here to set pin numbers:

const int buttonPin = 2;   // the number of the pushbutton pin

const int ledPin = 13;   // the number of the LED pin


// variables will change:

int buttonState = 0;     // variable for reading the pushbutton status


void setup() {

 // initialize the LED pin as an output:

 pinMode(ledPin, OUTPUT);

 // initialize the pushbutton pin as an input:

 pinMode(buttonPin, INPUT_PULLUP);

 digitalWrite(ledPin, LOW);

}


void loop() {

 // read the state of the pushbutton value:

 buttonState = digitalRead(buttonPin);


 // check if the pushbutton is pressed. If it is, the buttonState is HIGH:

 if (buttonState == LOW) {

  // turn LED on:

  digitalWrite(ledPin, HIGH);

  delay(2000);

  digitalWrite(ledPin, LOW);

  delay(1000);

  digitalWrite(ledPin, HIGH);

  delay(2000);

  digitalWrite(ledPin, LOW);

  delay(60000); // 60000 = One Minute

 }

}

Cable Prep

FM8Y5N4L8HCQIA1.jpg
FAPR06HL8HCQIA0.jpg

If you have crimp connectors prep your cable by cutting one wire or tin the tips with solder, preferably the positive or hot side.