Sohan Kundu
Published

Home Quarantine Security Alert

This project will alert the local government authorities or the local police whenever a home quarantine patient steps out of his/her house.

IntermediateFull instructions provided2 hours453
Home Quarantine Security Alert

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Buzzer, Piezo
Buzzer, Piezo
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Male/Male Jumper Wires
×1

Software apps and online services

SMS Messaging API
Twilio SMS Messaging API
Snappy Ubuntu Core
Snappy Ubuntu Core
Integromat

Story

Read more

Schematics

Circuit Diagram

Code

Configuration File

Python
Configuration File of the Project
#SID, AUTH_TOKEN, FROM_NUMBER, TO_NUMBER are available on Twilio dashboard
SID = '*********************************'
AUTH_TOKEN = '********************************'
FROM_NUMBER = '+19*********'
TO_NUMBER = '**********'
#API_KEY AND DEVICE_TD of the Bolt Wifi Module is available on the Bolt Dashboard
API_KEY = '********-****-****-****-************'
DEVICE_ID = 'BOLT******'

Main File

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

mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)

while True:
	mybolt.digitalWrite('1','LOW')
	response = mybolt.digitalRead('0')
	data = json.loads(response)
	print("Sensor value is: "+str(data['value']))
	try:
	  #When the sensor detects the movement, a SMS alert is sent via Twilio
		sensor_value=int(data['value'])
		if sensor_value == 1:
			print("Movement detected. Sending SMS.")
			response = sms.send_sms("Movement detected by home quarantine patient. Patient ID: 291618")
			mybolt.digitalWrite('1','HIGH')
			mybolt.restart()
			time.sleep(20)
	except Exception as e:
		print("Error occured: Below are the details.")
		print(e)

Credits

Sohan Kundu
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.