In this project we make a device which send us a SMS upon opening a door of locker or any other things like home doors, windows etc.
Now a days a encryption is very important so in order to encrypt our door or to knows about a alert on opening of door this device is very helpful
prerequisite:1.You must to knows how to use Bolt iot module and little information about Bolt cloud
2. Required a TWILLOW account, API, SSID
Working:Upon opening a door. a door reflects IR rays of IR sensor module. The reflected ray will sens again by a IR receiver on a module. and give signal to a Bolt module the module accordingly send data on cloud.
In a cloud data will get processed and using a third party member (like TWILLOW) it will send a SMS on a phone
IMPLEMENTATION:- Make a circuit connection as shown in a diagram
- Now power the Bolt module using USB cable and connect it to wi-fi
- Use a Python to write a code
The code is mention as follows
SID='Your SID '
AUTH_TOKEN='Your AUTH_TOKEN'
FROM_NUMBER='Your TWILLIOW number'
TO_NUMBER='For which number you want SMS'
APT_KEY='Enter here'
DEVICE_ID='Enter here'
import json, time
from boltiot import Sms, Bolt
mybolt=Bolt(APT_KEY,DEVICE_ID)
sms=Sms(SID,AUTH_TOKEN,TO_NUMBER,FROM_NUMBER)
while True:
print("IR SENSOR is active")
response=mybolt.digitalRead('0')
data=json.loads(response)
print("sensor value is:"+str(data['value']))
try:
sensor_value=int(data['value'])
if sensor_value==0 :
print("Making request to twillow to send SMS")
response=sms.send_sms("Someone has open door"+str(sensor_value))
print("Responce recived from Twillow is:"+str(response))
print("status of SMS from twillow is:"+str(response.status))
except Exception as e :
print("Error occured: Below are details")
print(e)
time.sleep(10)before Runing this code
Make sure that your IR sensor will get installed on door so that on opening of door it will reflect IR rays
Now, run the code you will get a SMS upon opening of door







Comments