Lackshya Mathur
Published © GPL3+

Smart IoT Fire Alarm

A temperature-based fire alarm based on the Bolt IoT platform. Detects a rise in temperature and sends SMS alerts.

BeginnerWork in progress1 hour602
Smart IoT Fire Alarm

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Buzzer
Buzzer
×1
Temperature Sensor
Temperature Sensor
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

Bolt IoT Android App
Bolt IoT Android App
PuTTY
SMS Messaging API
Twilio SMS Messaging API
DigitalOcean

Story

Read more

Schematics

Circuit Diagram

Code

Main Program

Python
import conf_project
from boltiot import Sms, Bolt
import json, time

maximum_limit = 290

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

while True:
	print ("Reading Sensor Value.....")
	response = mybolt.analogRead('A0')
	data = json.loads(response)
	print("Sensor Value: " + str(data['value']))
	response2 = boltiot.digitalWrite('0', 'LOW')
	try:
		sensor_value = int(data['value'])
		if sensor_value > maximum_limit:
			response1 = mybolt.digitalWrite('0', 'HIGH')
			print(response1)
			print("Making SMS request to Twilio.....")
			realTemp = (100*sensor_value)/1024
			response = sms.send_sms("The Fire Alarm has gone off, Temperature: " +str(realTemp))
			print("Response recieved from Twilio: " +str(response.status))
	except Exception as e:
		print("ERROR OCCURRED - DETAILS: ")
		print(e)
    time.sleep(10)

Credits

Lackshya Mathur
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.