Sahil Shirodkar
Published

COVID-19 Prevention Alert

This projects alert a person whenever the person switches off the led light. It alert the person to sanitize and wear mask for prevention.

BeginnerFull instructions provided3 hours234
COVID-19 Prevention Alert

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LED (generic)
LED (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Snappy Ubuntu Core
Snappy Ubuntu Core
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

20200829_214704_fdassxb2nT.jpg

20200829_214654_yKmzt9ZkP7.jpg

screenshot_20200829-223855_messages_lb2O5T3vIP.jpg

Code

Python Code for main file

Python
import conf 
import json
import time


from boltiot import Sms,Bolt #Libraries required to connect with Bolt Wifi Module


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 ("0","LOW")
  try:
    print("Making Request to Twilio for SMS")
    response=sms.send_sms("COVID PREVENTION ALERT: Sanitize your self and Wear your mask")
    print("response received from Twilio is:" +str(response))
  except Exception as e:
    print("error occured, couldnt generate sms")
    print(e)
  time.sleep(10)

Configuration file

Python
API_KEY = "xxxxxxxxxxxxxxxxxxxxx"   # Bolt API Key
DEVICE_ID = "xxxxxxxxxxxxxxxxxxxx" # Bolt Device ID
SID = 'xxxxxxxxxxxxxxxxxxxx' # Twilio Account SID
AUTH_TOKEN = 'xxxxxxxxxxxxxxxxxxxxxx' #Twilio Auth Token
FROM_NUMBER = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx' # Twilio Trial Number
TO_NUMBER = 'xxxxxxxxxxxxxxxxxxxxxxxxx' #Your own mobile number

Credits

Sahil Shirodkar
1 project • 0 followers
Contact
Thanks to Adarsh Kumar Maurya.

Comments

Please log in or sign up to comment.