Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Achiket Kumar
Published © GPL3+

Temperature Monitoring System

My project on IOT where I have made temperature monitoring system which will alert us whenever any disturbance takes place in temperature.

IntermediateProtip7 hours959
Temperature Monitoring System

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Temperature Sensor
Temperature Sensor
×1
Male/Male Jumper Wires
×3

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Code

Complete code

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

minimum_limit = 300
maximum_limit = 600  


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.analogRead('A0') 
    data = json.loads(response) 
    print("Sensor value is: " + str(data['value']))
    try: 
        sensor_value = int(data['value']) 
        if sensor_value > maximum_limit or sensor_value < minimum_limit:
            print("Making request to Twilio to send a SMS")
            response = sms.send_sms("The Current temperature sensor value is " +str(sensor_value))
            print("Response received from Twilio is: " + str(response))
            print("Status of SMS at Twilio is :" + str(response.status))
    except Exception as e: 
        print ("Error occured: Below are the details")
        print (e)
    time.sleep(10)

Credits

Achiket Kumar
12 projects • 3 followers
I am a Computer Science student from Indian Institute of Information Technology, Kalyani
Contact

Comments

Please log in or sign up to comment.