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](/proxy/?url=https://content.instructables.com/FMG/NYNG/J5Y82I3S/FMGNYNGJ5Y82I3S.jpg&filename=2016-08-05 14.46.53.jpg)
![2016-08-05 14.46.38.jpg](/proxy/?url=https://content.instructables.com/FAZ/4J3F/J5Y82I33/FAZ4J3FJ5Y82I33.jpg&filename=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](/proxy/?url=https://content.instructables.com/F94/K7TQ/J5Y82HY3/F94K7TQJ5Y82HY3.jpg&filename=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](/proxy/?url=https://content.instructables.com/FLG/CQ82/J5Y82JEW/FLGCQ82J5Y82JEW.png&filename=Screen Shot 2017-08-07 at 1.05.34 PM.png)
![Screen Shot 2017-08-07 at 1.10.01 PM.png](/proxy/?url=https://content.instructables.com/FPY/TVB7/J5Y82JFA/FPYTVB7J5Y82JFA.png&filename=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](/proxy/?url=https://content.instructables.com/FHM/KMUS/J5Y7ZNPL/FHMKMUSJ5Y7ZNPL.png&filename=Screen Shot 2017-08-06 at 4.26.39 PM.png)
![Screen Shot 2017-08-06 at 4.27.24 PM.png](/proxy/?url=https://content.instructables.com/FDA/TV72/J5Y7ZNNX/FDATV72J5Y7ZNNX.png&filename=Screen Shot 2017-08-06 at 4.27.24 PM.png)
![2016-08-05 14.27.16.jpg](/proxy/?url=https://content.instructables.com/FCX/CXNS/J5Y82I2Q/FCXCXNSJ5Y82I2Q.jpg&filename=2016-08-05 14.27.16.jpg)
![2016-08-05 14.26.13.jpg](/proxy/?url=https://content.instructables.com/FAL/RY07/J5Y82HY5/FALRY07J5Y82HY5.jpg&filename=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](/proxy/?url=https://content.instructables.com/F9C/2L0B/J5Y7ZG0T/F9C2L0BJ5Y7ZG0T.png&filename=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](/proxy/?url=https://content.instructables.com/F4L/GQVL/J5Y7ZDWM/F4LGQVLJ5Y7ZDWM.jpg&filename=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.