Tech & Vlogs
Published

Contact-Less Door Bell with SMS Notification

Covid-19 situation brought us to take care more about our health. In this situation contact-less doorbell system is ideal solution.

IntermediateFull instructions provided2 hours1,763
Contact-Less Door Bell with SMS Notification

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LED (generic)
LED (generic)
×1
IR Proximity Sensor
Digilent IR Proximity Sensor
×1
Buzzer
Buzzer
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×5
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

Circuit Diagram

Code

project.py

Python
import conf #importing the conf file which has all the identifications
from boltiot import Sms #importing SMS module used for notifying purpose
from boltiot import Bolt #importing Bolt module for accessing the bolt data and functionality
import json 
import time # To access the time related functionality

max_limit = 500 #maximum limit for alerting purpose

mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID) #initializing the bolt module with device id and API key
sms=Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER) #initialize SMS module with twillio API credentials

while True:
     print('reading the sensor value')
     response=mybolt.analogRead('A0') #reading the analog values connected to the 'A0' pin of Bolt module
     data=json.loads(response) #converting the given text into JSON format
     print('sensor value is: '+str(data)) # printing the response to the console
     try:
        sensor_value=int(data['value']) #assigning the sensor value
        if sensor_value > 0 and sensor_value < max_limit: #comparing the sensor values with the given limit
           mybolt.digitalWrite('0', 'HIGH') # updating the pin values to notify the user with beep sound along with LED lightt
           print('making request to twillo to send SMS')
           response=sms.send_sms('somebody has came at your door step') #making the call twilio to notify the user with SMS
           print('response recieved from Twilio is:'+str(response))
           print('status of SMS at twilio is:'+str(response.status))
           time.sleep(4) #wait the control for 4 seconds
           mybolt.digitalWrite('0','LOW') # update the pin vaue to Low to turn of the buzzer and LED
     except Exception as e:
        print('error occured: below are the details')
        print(e)
     time.sleep(5) #repeating the same operation for every 5 seconds

conf.py

Python
SID='AC4b53xxxxxxxxxx1a324c31e0542180b2' #available in twiliio dashboard
AUTH_TOKEN='40aaxxxxxxx54ff72010b3188be539f6' #available in twilio dashboard
FROM_NUMBER='+131xxxxx638' #number generated in twilio dashboard
TO_NUMBER='+919xxxxx555' #number to which SMS alert to be received
API_KEY='ec53xxxxxx-b279-eeb5b4119416' #bot cloud account api key
DEVICE_ID='BOxxxxxx240' #bolt device id

Credits

Tech & Vlogs

Tech & Vlogs

1 project • 4 followers
Thanks to Bolt IOT.

Comments