suvarna rani
Published © GPL3+

COVID-19 SMS Alert

Here is the COVID-19 SMS system to send you an alert when you violate the lockdown rule by stepping out of house so Stay Home and Stay Safe.

BeginnerFull instructions provided1 hour623
COVID-19 SMS Alert

Things used in this project

Hardware components

LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1

Software apps and online services

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

Story

Read more

Schematics

COVID-19 SMS Alert

COVID-19 SMS Alert kit

Code

COVID-19 SMS Alert

Python
Enter your credentials from respective Bolt and Twilio accounts.
from boltiot import Sms,Bolt #Libraries required to connect with Bolt Wifi Module
import requests 
import json
import time

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

import json,time
from boltiot import Sms,Bolt

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

while True:
  mybolt.digitalWrite ("0","LOW")
  try:
    print("Making Request to Twilio")
    response=sms.send_sms("Stay Home and Stay Safe")
    print("response received from Twilio is:" +str(response))
  except Exception as e:
    print("error occured, couldnt generate sms")
    print(e)
  time.sleep(10)

Credits

suvarna rani

suvarna rani

2 projects • 1 follower

Comments