gowthamkishoreindukuri
Published © LGPL

Industrial Safety Alert

This project is mainly about alerting via buzzer and iot through a mobile phone app.

IntermediateProtip2 hours606
Industrial Safety Alert

Things used in this project

Story

Read more

Code

webpage and app code

HTML
<html>

    <head>
        <style>
            
            
            h1 { text-align:center;}
            .button {
  background-color: #7FFF00; 
  border: none;
  color: red;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
        
        </style>

        <title>IoT Platform</title>

        <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>

        <script>

        setKey('{{ApiKey}}','{{Name}}');

        </script>
        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

    </head>
    
    <body >
        <h1 style = font-family:"courier",text-align:"center"> Controlling buzzer Over Internet </h1>

        <center>

        <button class="button" onclick="digitalWrite(0, 'HIGH');">ON</button>

        <button class="button" onclick="digitalWrite(0, 'LOW');">OFF</button>

        </center>
        <center>
            <i class="material-icons" style="font-size:60px;color:#00FFFF;">cloud</i>
        </center>
        

    </body>

</html>

sms.py

Python
import conf, json, time
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: 
    print ("Reading sensor value")
    response = mybolt.digitalRead('0') 
    data = json.loads(response) 
    response = sms.send_sms(" there is emergency in industry ")

main.py

Python
SSID = 'You can find SSID in your Twilio Dashboard' 
AUTH_TOKEN = 'You can find  on your Twilio Dashboard' 
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'

Credits

gowthamkishoreindukuri

gowthamkishoreindukuri

16 projects • 19 followers

Comments