You are on page 1of 18

1

“IOT BASED DOORBELL USING RASPBERRY PI”


A PROJECT REPORT
Submitted by
A SRI SRAVYA KRISHNA - 160101130041
N SIRISHA - 160101130030
CHARAN KUMAR CHOUDHURY - 160101130037
in partial fulfillment for the award of the degree
of
BACHELOR OF TECHNOLOGY
in
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING

Under the Guidance of


Mrs. Jeevaratnam
Assistant Professor
Department of Electronics and Communication Engineering

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING
SCHOOL OF ENGINEERING & TECHNOLOGY (JITM)
CENTURION UNIVERSITY OF TECHNOLOGY&MANAGEMENT
PARALAKHEMUNDI
ODISHA
2018-2019
2

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING
SCHOOL OF ENGINEERING & TECHNOLOGY (JITM)
CENTURION UNIVERSITY OF TECHNOLOGY & MANAGEMENT
PARALAKHEMUNDI -761211

BONAFIDE CERTIFICATE
Certified that this project report entitled
“IOT Based Doorbell Using Raspberry PI”
is the bonafide work of
A SRI SRAVYA KRISHNA - 160101130041
N SIRISHA - 160101130030
CHARAN KUMAR CHOUDHURY - 160101130037

Who carried out the project work under my supervision. This is to further certify
to the best of my knowledge that this project has not been carried out earlier in
this institute and the university.
Signature Of The Supervisor

Mrs. Jeevaratnam
Assistant Professor
Department of Electronics and Communication Engineering
Certified that the above mentioned project has been duly carried out as per the
norms of the college and statutes of the university

HEAD OF THE DEPARTMENT


Mr. Satyanarayana Padhy
Assistant Professor
2018-2019
DEPARTMENT SEAL

Status: Approved/Not Approved

INTERNAL EXAMINER EXTERNAL EXAMINER


3

SPECIMEN ACKNOWLEDGEMENT

ACKNOWLEDGEMENTS

I wish to express my profound and sincere gratitude to Prof.Mrs. JEEVARATNAM


Department Of Electronics And Communication Engineering, JITM Paralakhemundi, who
guided me into the intricacies of this project non-chalantly with matchless magnanimity.

I thank Prof.Mr.Satyanarayana Padhy, Head of the Department of Electronics And


Communication Engineering, and Dr.B.P.Mishra, DEAN, SOET for extending their support
during Course of this investigation.

I am highly grateful to my group members who evinced keen interest and invaluable
support in the progress and successful completion of my project work.

I am indebted to my parents for their constant encouragement, co-operation and help.


Words of gratitude are not enough to describe the accommodation and fortitude which they have
shown throughout my endeavor.

A.SRI SRAVYA KRISHNA : 160101130041

N.SIRISHA : 160101130030

CHARAN KUMAR CHOUDHURY : 160101130037


4

ABSTRACT

This Raspberry Pi, IoT Doorbell is basically a simple smart Door Bell, which takes a photo of
whoever rings it, and emails it to the specified email address, and keeps all the photos in a folder.
(along with going Ding-Dong).

Hardware is solved by Plug of Webcam into the Rasp-pi, along with your selected network
interface. Then, using the images as a guide (the wiring diagrams + this pinout for rasp pi 1B),
connect your button and resistors to the pi. With the breadboard image, the both wires are the
wires running the the door bell (Project Box with button).

When a person presses the switch or knocks the door , the bell gets rang which is old fashion but
in our project the new thing is when a person presses the switch the bell gets rang and meanwhile
the owner gets notifications through mail with captured image and the message that somebody
knocked the door at particular day and time.

Without internet also the owner gets notified through sms.

\
5

TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.

LIST OF TABLE ...


LIST OF FIGURES IX
LIST OF SYMBOLS / NOTATION ...

1. CHAPTER – 1 INTRODUCTION 7
1.1. Introduction To Wireless Doorbell Using Raspberry Pi
1.2. Product overview

2. CHAPTER – 2 SOFTWARE DESCRIPTION 8


2.1 Raspbian OS (www.raspberrypi.org),
2.2 Putty (www.putty.org)
2.3 Real VNC viewer (www.realvnc.com)
2.4 SD card formatter (www.sdcard .org)
2.5 Zapier
2.6 python 2.7
2.7 Xming
2.8 Advance Ip Scanner

3. CHAPTER - 3 HARDWARE DESCRIPTION 9


3.1. Tools
3.2. Email setup

4. CHAPTER – 4 BLOCK DIAGRAMS 12


4.1. Block Diagram
4.2. GPIO Pins Block diagram
6

5. CHAPTER – 5 CODING 13
5.1 E-mail Attachment Coding
5.2 Text E-mail Coding

6. CHAPTER – 6 WORKING, SCOPE FOR FURTHER STUDY&APPLICATIONS 17


6.1. Working
6.2. Scope For Further study
6.3. Applications
7. CHAPTER – 7 CONCLUSION 18
7.1. Conclusion

8. CHAPTER – 8 REFERENCES 18

8.1 Reference
7

CHAPTER – 1

INTRODUCTION:

1.1 INTRODUCTION TO WIRELESS DOORBELL USING RASPBERRY PI:


Over the world, IOT (Internet of Things), technologies which were developed for smart home
system are becoming well known. The system is developed by using Supported Mobile
Communication and Safety Powered Functional Smart Door System The proposed system will
allow to communicate between visitors and owners of the house. Video camera system (the
photo of visitors will be sent to the owner of the house), instant message notification and SMS
notification process will be provided. In addition, cloud storage of image data with a high
resolution will be provided using the system With increasing safety and security is-sues, the use
of smart door system increased consistently with the advent of security related electronics, such
as digital door locks, and wire-less home security networks . There are many smart systems
proposed to provide safety and security at home and offices. The system is integrated to the gate
for recognition people.

1.2. PRODUCT OVERVIEW:


This project is about a smart doorbell notification so that when a guest clicks on the button/bell,
it makes a ring, a camera takes a picture and the admin get the notification on his E-mail with
the picture of Guest and it send normal text message to his phone.
8

CHAPTER-2

SOFTWARE DESCRIPTION:

2.1. Steps to install OS:

1. Use “Zapier” to write the raspberry pi OS image file to the micro Insert micro SD card
and format it using SD card Formatter.
2. Extract Raspbian OS file to get image file.
3. SD card.
4. Remove the SD card and insert into the raspberry pi.

2.2. Steps for raspberry pi:

1. Connect micro USB cable to the raspberry pi for power to the raspberry pi.
2. Connect Ethernet cable to the raspberry pi from router which has an active internet
connection.
3. Wait for one to two minutes, as raspberry will be booting after that move onto next steps.

2.3. Steps for setting putty:

1. Open command prompt by typing CMD in RUN window and 1st open the xming .
2. Type “ping-4 raspberry pi.local”, and Note down the IP address which is mentioned in
the command prompt.
3. Open “putty”.
4. In IP address type “raspberry.local”.
5. Click open.
6. Login as : pi@raspberrypi.local , Password : raspberry (can be anything).
7. Type – start lxde.
8. Type – y.
9. Type – vncserver:1.
10. Close putty.
11. Open putty again.
12. In IP address type raspberry.local.
13. Go to SSH-tunnels in source port type and copy the ip address and paste it.
9

CHAPTER – 3

HARDWARE DESCRIPTION:

3.1 PARTS/ TOOLS:

Here is the list of parts with approximate prices and links, though you don't need to buy these
exact parts, or you may already own some components.

1. Raspberry Pi 3 Model B :
I have linked Raspberry Pi 3, though any should work, it even has Wi-Fi which
means your doorbell can be wireless. You can also use the other Raspberry Pi Models
also.
And it act as CPU.

2. Wireless Door bell: (Transmitter & Receiver):


(for the doorbell! Wire at the right length for a connection between pi and doorbell)
10

3. Web Cam :
It is used to click the images when the persons press the doorbell with the help of
Raspberry Pi 3 Model B and it send the images to E-mail.

4. SD Card:
It is the memory card which is used to store the data in it.

5. HDMI Cable:
It is the cable is used to installation process of OS at Raspberry Pi 3 Model B by
connecting between the Raspberry Pi 3 Model B and laptop.
11

6. LAN Cable:
It is the cable is used to dump the coding part and it is connected between Raspberry
Pi 3 Model B and laptop.

7. Jumper wires:

3.2 Email Setup


For this program to work, you will have to make a EMAIL account (or use a spare one (that
Gmail) to send the emails to Your Email. Throughout the next steps, I will call this GMAIL
account:
After both software and Hardware
1. Installing and configuring SSMTP.
2. Make sure your repositories are up-to-date.
3. Install SSMTP and mail utilities.
4. Edit the SSMTP configuration file for Gmail.
5. Allow less secure apps to access your account.
6. Two ways to send an text Email.
7. Send an attached file.
8. Capture the image.
9. Inside the C program using the mail command and system function you can send the mail
to the user.
10. The Email arrives.
12

CHAPTER – 4
BLOCK DIAGRAMS:
4.1 Block diagram

4.2 . GPIO Pins Block diagram:


13

CHAPTER – 5

5.1 TEXT E-MAIL CODING:

#!/usr/bin/python

import urllib2

from time import sleep

from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate

import RPi.GPIO as GPIO

import time

from time import gmtime, strftime

import os

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

GPIO.setup(14, GPIO.IN, pull_up_down=GPIO.PUD_UP)

# Initialize the LCD plate.

lcd = Adafruit_CharLCDPlate()

# Clear display and show greeting, pause 1 sec

lcd.clear()

lcd.backlight(lcd.ON)

lcd.message("Welcome to your\ndoorbell")

sleep(1)
14

def internet_on():

try:

urllib2.urlopen('http://www.google.com', timeout=10)

return True

except urllib2.URLError as err:

pass

return False

lcd.clear()

if internet_on():

lcd.message("Internet is set\nup :)")

else:

lcd.message("No internet use\nDoorbell wifi")

while True:

if not GPIO.input(14): # button pressed

lcd.clear()

lcd.message("Ding Dong at\n")

lcd.message(strftime("%d-%m-%Y %H:%M:%S"))

os.system("sudo python zapier_webhook.py") # put a space within the quote after .py to
insert an argument

os.system("sudo python send_email.py") # put a space within the quote after .py to insert
an argument

time.sleep(0.2)
15

5.2 E-MAIL ATTACHMENT CODING:

#!/usr/bin/env python

import smtplib

from email.MIMEMultipart import MIMEMultipart

from email.MIMEBase import MIMEBase

from email.MIMEText import MIMEText

from email.Utils import COMMASPACE, formatdate

from email import Encoders

from time import gmtime, strftime

import os

# from constants import _const

USERNAME = "doorbellding@gmail.com"

PASSWORD = "doorbell2"

MAILTO = "tim@tieka.nl"

MOSTRECENTSNAPSHOT = '/home/pi/camera/images/mostrecent.jpg'

def sendmail():

print('Starting sendmail\n')

msg = MIMEMultipart()

text = "Hi, \n\nSomeone knocked on your door at " + strftime("%l:%M %p on %d-%m-%Y")


+ ".\n\nHave a great day!"

msg['to'] = MAILTO

msg['from'] = "doorbellding@gmail.com"
16

msg['subject'] = "Ding Dong at " + strftime("%l:%M %p on %d-%m-%Y")

msg.attach(MIMEText(text))

part = MIMEBase('application', "octet-stream")

part.set_payload(open(MOSTRECENTSNAPSHOT, "rb").read())

Encoders.encode_base64(part)

part.add_header('Content-Disposition', 'attachment; filename="photo.jpg"')

msg.attach(part)

print('Het bericht is:' + str(msg.as_string))

server = smtplib.SMTP('smtp.gmail.com:587')

server.ehlo_or_helo_if_needed()

server.starttls()

server.ehlo_or_helo_if_needed()

server.login(USERNAME, PASSWORD)

server.sendmail(USERNAME, MAILTO, msg.as_string())

print('\nVerzonden')

server.quit()
17

CHAPTER – 6
6.1 WORKING:

Interface the webcam:

1. Configure to enable camera using the command : sudo raspi-config.


2. Use command sudo apt-get install fswebcam.
3. Type fswebcam –p YUYV filename.jpeg.

6.2. SCOPE FOR FURTHER STUDY:


1. We can add video streaming.
2. We can talk with the person live face to face. (Here connection to be made with mobile)
3. We can get call as notification as somebody knocked the door.
4. We can get tweet as somebody knocked the door.
5. We can get hangouts message as somebody knocked the door.

6.3. APPLICATIONS:

1. When the delivery boy presses the button ,we can come to know that at that time and day
he /she knocked the door.(sms)
2. Who knocked the door ,we can know it.(email with captured image)
3. Security of home, office .., etc.
18

CHAPTER – 7

CONCLUSION:

This project comprises a raspberry pi IOT based smart doorbell. The experimental results of the
system proposed indicate that it may consist support and secure assistance for safe and secure
life with minimum cost of the system. Raspberry Pi is a strong and reliable embedded system
device for the complex and challenges tasks. Using these technologies in the proposed system
will bring several advantages in providing safety and security for the owner and also comfortable
for the visitors.

CHAPTER – 8

REFERENCES:

1. https://docs.google.com/document/d/1e7U_WM1jSo0wgMX5RdpN0eN6p9TWadGYHq
Wf6yR2JZM/edit?usp=sharing
2. https://github.com/in06khattab/Doorbell-6--final-

You might also like