Super Simple Flashing Light Doorbell Demo

by TechMartian in Circuits > Arduino

2060 Views, 12 Favorites, 0 Comments

Super Simple Flashing Light Doorbell Demo

2016-08-05 14.46.53.jpg
2016-08-05 14.46.38.jpg

This is a very simple and cheap, audible and visualizable doorbell system that can be made for under $10.

Sometimes, when I'm working with power tools or just listening to loud music, I cannot hear the doorbell ring. I need a visual cue to tell me if someone is waiting at door, so I made a doorbell that flashes a Super Bright LED, to alert me every time someone has pushed the button.

My goal is to have a doorbell on my room door, since I like to keep my room door locked and closed for privacy reasons (i.e. to get rid of those nosy meddlers). I almost always have headphones or earphones on and most of the time I wouldn't even notice someone is knocking outside until I see that they have messaged or emailed me, so I needed a visual cue to let me know. Thankfully, this device has solved my problems!

BoM

2016-08-05 14.20.10.jpg
  • Arduino 101 or Uno
  • Push Button
  • 10k Ohm resistor
  • Buzzer
  • 10mm Super Bright LED
  • Jumper Wires

Calculating the Resistance

Screen Shot 2017-08-07 at 1.05.34 PM.png
Screen Shot 2017-08-07 at 1.10.01 PM.png

  • The LED is white, so the voltage drop across the LED is around 3 to 3.5V.
  • The supply voltage that the Arduino board can supply is either 3.3V or 5V.
  • The desired current for the LED is 25 milliamps as specified by the LED specifications.

By using Ohm's law it is calculated that the resistor needed assuming the voltage drop accross the LED is 3V, is a 12Ω resistor. For a 5V power source and a 3.5V voltage drop the resistor needed is 60Ω. I had neither of these resistors so I opted to use the 3.3V power source without a resistor since the resistor needed is quite low anyway.

You can calculate this resistance by using V = IR (Voltage = Current * Resistance) or by using this online lED resistor calculator: http://ledcalc.com/#

Hardware Hookup

Screen Shot 2017-08-06 at 4.26.39 PM.png
Screen Shot 2017-08-06 at 4.27.24 PM.png
2016-08-05 14.27.16.jpg
2016-08-05 14.26.13.jpg

Buzzer

  • Connect one of the pins of the buzzer to pin 6 on the Arduino, while the other pin connects to GND on the Arduino.

Super Bright LED

  • Connect the Anode (positive pin) of the LED to pin 9 on the Arduino.
  • Connect the Cathode (negative pin) of the LED to the ground pin of the buzzer. It does not matter which ground it is connected to since all grounds are the same. Ground is ground, all are common!

Button

  • Connect one of the button pins to pin A0. Connect this same pin to a 10kΩ resistor.
  • Then, connect the end of this resistor in series to 3.3V on the Arduino.
  • Connect the other pin of the button to any of the common ground, either the Arduino common ground, or the buzzer/LED, all are the same as mentioned before.

Coding

Screen Shot 2017-08-06 at 4.11.53 PM.png
// declare all pin constants
const int led = 9;
const int buzz = 6;
const int pb = 0;
int toggle = 0;
void setup() {
  //declare output pins
  pinMode (buzz, OUTPUT);
  pinMode (led, OUTPUT);
  digitalWrite (led, LOW);
}
void loop() {
  if (analogRead (pb) == 0){  // if button is pressed
    if (toggle == 0){
      for (int i  = 0; i<10; i ++){
      digitalWrite (led, HIGH);
      dingdong();
      delay (250); //delay a total of 1/4 of a second before flashing again  
      digitalWrite (led, LOW);  // turn on light
      delay(250); // delay for 1/4 seconds
      toggle = 1; // toggle so it turns off next press
      }
    } else { 
      toggle = 0; 
      digitalWrite (led, LOW);
      noTone (buzz);
    }
  }  
}
void dingdong(){
  tone (buzz, 5000); // play a tone of a frequency of 5000Hz
  delay (50); // play for only 50 milli seconds
  noTone (buzz);  // stop the tone 
  delay(50);  // stop for 50 milli seconds
  tone(buzz, 2000);   // play another tone at 2000Hz this time
  delay(50); // play for only 50 milli seconds
  noTone (buzz);  // stop the tone
  delay(50); // stop for 50 millisecodns
}

Downloads

Done!

Doorbell Demo

You're done. You can make a PCB circuit for this and mount it at your door. I prefer just taping it to my door, since I'm only using it for my room so that I'll know when someone's at my door, when I'm playing or listening to music.