Nikhil Likhar
Published

Hands-Free Doorbell with SMS Alert

Worried about sanitization of the Doorbell ? Why, Don't make it hands-free! Want to get notified through SMS alert. ? Lets Dive In!

IntermediateFull instructions provided1 hour585
Hands-Free Doorbell with SMS Alert

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
IR Proximity Sensor
Digilent IR Proximity Sensor
×1
Buzzer
Buzzer
×1
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Resistor 330 ohm
Resistor 330 ohm
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

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

Story

Read more

Custom parts and enclosures

Bolt wifi Module model

IR sensor Model

Schematics

Circuit Diagram

Code

Handsfree_Buzzer.py

Python
import conf, json, time
from boltiot import Sms, Bolt

#Extract required information from conf.py file
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SSID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)

history_data=[]

while True:
    response = mybolt.digitalRead('0')
    data = json.loads(response)

    #If there was error in loading data
    if data['success'] != 1:
        print("There was an error while retriving the data.")
        
        #printing the error
        print("This is the error:"+data['value'])
        time.sleep(10)
        continue

    #If no error then print the value 
    print ("This is the value "+data['value'])
    sensor_value=0
    
    try:
        sensor_value = int(data['value'])
    except e:
        print("There was an error while parsing the response: ",e)
        continue

    


    try:
        #When no one is there set buzzer and led to OFF
        if(sensor_value==1):
            mybolt.digitalWrite('1','LOW')

        #when someone came and raised palm in front of doorbell set buzzer and led to ON
        else:
            mybolt.digitalWrite('1','HIGH')
            print ("Someone Ringed the DoorBell")

            #sending sms to phone number
            response = sms.send_sms("Someone Ringed the DoorBell")



       
    except Exception as e:
        print ("Error",e)
    time.sleep(4)

conf.py

Python
SSID = 'ACeexxxxxxxxxxxxxxxxxxxxxxxx98030'
 
#'You can find SSID in your Twilio Dashboard' 

AUTH_TOKEN = 'b6ec3xxxxxxxxxxxxxxxxxxxxae' 
#'You can find  on your Twilio Dashboard'

FROM_NUMBER = '+xxxxxxxx80'
#'This is the no. generated by Twilio. You can find this on your #Twilio Dashboard'

TO_NUMBER = '+91xxxxxxxxx2'
#'This is your number. Make sure you are adding +91 in beginning'

API_KEY = 'd7xxx838-xxxx-xxxx-xxxx-aaxxxxxxx0e'
#'This is your Bolt Cloud account API key'

DEVICE_ID = 'BOLTxxxxxxxxx'
#'This is the ID of your Bolt device'

Credits

Nikhil Likhar
1 project • 0 followers
Final year BE Computer Science Student at Shri Ramdeobaba College of Engineering and Management, Nagpur.
Contact

Comments

Please log in or sign up to comment.