SOUMYA
Published

Thief Motion Detector

Use Bolt IoT kit to make a thief motion detection system that sends an SMS when there is an intrusion or any human motion

IntermediateFull instructions provided1 hour259
Thief Motion Detector

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1

Software apps and online services

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

Story

Read more

Code

main.py

Python
import json

from pip._vendor import requests

import conf
from boltiot import Sms, Bolt
import _json,time

sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)

while True:
    response=requests.get('http://cloud.boltiot.com/remote/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/digitalRead?pin=0&deviceName=BOLTxxxxxxxxx')
    data=json.loads(response.text)
    print(data)
    sensor_value = int(data['value'])
    if sensor_value == 1:
        print("MOTION DETECTED")
        print("sending SMS")
        sms.send_sms("SOMEONE ENTERED")
    elif sensor_value ==0:
        print("SENSOR IS READY")
    time.sleep(5)

conf.py

Python
SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
AUTH_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
TO_NUMBER="+91xxxxxxxxxx"
FROM_NUMBER="+14xxxxxxxxxx"

Credits

SOUMYA
1 project • 0 followers

Comments