Smart Doorbell

I always wanted to make a system that would alert me on my phone and mail whenever someone is on the door. We often miss the doorbell of some reason or another.

Using this system you will never miss anyone who knocks on your door.

Using an Arduino and an ethernet shield to connect the button to the internet, the system uses blynk app to connect it to the cloud. The app is available both for android and IOS. The system sends an email and a mobile notification whenever it is pressed.

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth = “YourAuthToken”;

SimpleTimer timer;

WidgetLCD lcd(V1);

void setup()
{
Serial.begin(9600);
Blynk.begin(auth);

while (Blynk.connect() == false) {
// Wait until connected
}
}
void notifyOnButtonPress()
{
// Invert state, since button is “Active LOW”
int isButtonPressed = !digitalRead(2);
if (isButtonPressed) {
BLYNK_LOG(“Button is pressed.”);

Blynk.notify("Please open up! Somebody is on the door!");
 lcd.clear(); //Use it to clear the LCD Widget

lcd.print(4, 0, “Open”); // use: (position X: 0-15, position Y: 0-1, “Message you want to print”)
lcd.print(4, 1, “The Door!”);
}
}

void emailOnButtonPress()
{

int isButtonPressed = !digitalRead(2); // Invert state, since button is “Active LOW”

if (isButtonPressed) // You can write any condition to trigger e-mail sending
{
BLYNK_LOG(“Button is pressed.”); // This can be seen in the Serial Monitor
Blynk.email(“xxx@gmail.com”, “Subject: Doorbell”, “Please open up! Somebody is on the door!”);
lcd.clear(); //Use it to clear the LCD Widget
lcd.print(4, 0, “Open”); // use: (position X: 0-15, position Y: 0-1, “Message you want to print”)
lcd.print(4, 1, “The Door!”);

}
}

void loop() {
// put your main code here, to run repeatedly:
Blynk.run();
timer.run();
}

You can check out my Project here. Please respect if you find it useful :slight_smile:

Smart Doorbell - Hackster.io?

3 Likes

You might wanna remove your actual e-mail adres from this, it’s an easy target for spammers :wink:

I’d love to built this someday, but haven’t got around to it yet. I might even incorporate a small screen to send text to the person at the door. That would be funny :smiley:

Great project!

Thanks for posting it on hackster.io!

1 Like

Hello,
Sorry for the ignorance but, where was used the timer library?

From what I can tell it’s not used in this project. It wouldn’t be needed to since we are dealing with push data, you only need to get into action if someone is pressing the button. I think it’s left because of some copy/paste actions :wink: