Rohit9924
Published

Intrusion Alert System Using Bolt IoT

Use Bolt IoT kit and PIR (passive infrared sensor) to make a detection system that sends an SMS when there is an intrusion.

IntermediateFull instructions provided2 hours1,862
Intrusion Alert System Using Bolt IoT

Things used in this project

Hardware components

PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1

Software apps and online services

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

Story

Read more

Code

Intrusion Detection using PIR and Bolt Wifi module

Python
Python code for reading data from the PIR sensor and sending an alert SMS using Twilio credientials
import conf, json, time, requests
from boltiot import Sms, Bolt

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

while True:
    response = requests.get('http://cloud.boltiot.com/remote/xxxxxxxxxx/digitalRead?pin=0&deviceName=BOLTxxxxx')
    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)

Credits

Rohit9924

Rohit9924

1 project • 0 followers

Comments