Suresh Krishna
Published © GPL3+

Fire alarm using Bolt device

Whenever the temperature exceeds, the buzzer starts and sends you the message. And if the temperature decreases, the it automatically stops.

IntermediateFull instructions provided1 hour30
Fire alarm using Bolt device

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Temperature Sensor
Temperature Sensor
×1
Buzzer
Buzzer
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Snappy Ubuntu Core
Snappy Ubuntu Core

Story

Read more

Schematics

20200612_1127501_iIc7XMXw5Z.jpg

Code

python code

Python
write the code in linux
from boltiot import Bolt
import json,time
maximum_temp=500
SID='your twilio SID key '
AUTH_Token='your twilio token'
To_num='your number'
From_num='your twilio number'
api_key="your bolt api key"
device_id="your bolt device id"
mybolt=Bolt(api_key,device_id)
sms=Sms(SID,AUTH_Token,TO_num,From_num)
while True:
  print("Reading the temperature value")
  responce=mybolt.analogeRead('A0')
  print(responce)
  data=json.loads(responce)
  print("sensor value is:"+str(data['value']))
  try:
    sensor_value=int(data['value'])
    if sensor_value > maximum_temp :
      print("alert!The temperature exceeds the critical point")
      responce=mybolt.analogWrite('0','150')
      print(responce)
      print("making request from tiwilio to send message")
      responce=sms.send_sms("alert! the temperature is"+str(sensor_value))
      print("responce recived from tiwilio is:"+str(responce))
      print("status of sms at a=twilio is:"+str(responce.status))
    else:
      print("everything is OK")
      responce=mybolt.analogeWrite('0','0')
      print(responce)
except Exception as e:
  print("error occured:below are the details")
  print(e)
time.sleep(5) 

Credits

Suresh Krishna

Suresh Krishna

2 projects • 0 followers

Comments