Yogesh Kumbhar
Published

Locker Protection using BOLT Module

In this project we will build a device which can protect use of locker from a unknown person. It will gives us SMS alert on unlocking

IntermediateProtip1 hour544
Locker Protection using BOLT Module

Things used in this project

Hardware components

IR sensor
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Bread Board
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Bolt IoT Android App
Bolt IoT Android App

Story

Read more

Schematics

Circuit Connections

video

Code

code

Python
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)
            
            
            
    

Credits

Yogesh Kumbhar
1 project • 0 followers

Comments