Adarsh Kumar Maurya
Published © GPL3+

Alert for wearing Mask and Helmet while going out from Home

This works when the person switches off the main LED which activates to send an SMS

IntermediateFull instructions provided2 hours448
Alert for wearing Mask and Helmet while going out from Home

Things used in this project

Hardware components

LED (generic)
LED (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×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
ubuntu virtualbox
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

img_20200816_075115_pFc7AMEhh5.jpg

Code

python code

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

import json,time
from boltiot import Sms,Bolt

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

response=mybolt.digitalWrite ("0","HIGH")
print(response)

while True:
  mybolt.digitalWrite ("0","LOW")
  try:
    print("Making Request to Twilio for SMS")
    response=sms.send_sms("ALERT: Take and wear your mask and helmet properly")
    print("response received from Twilio is:" +str(response))
  except Exception as e:
    print("error occured, couldnt generate sms")
    print(e)
  time.sleep(10)

Credits

Adarsh Kumar Maurya
2 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.