Sudhir Kumar
Published

Temperature Monitoring Sensor

It is a project to measure temperature inside any building, storage, room, etc using LM35 sensor with Bolt Wifi Module

IntermediateFull instructions provided3 hours566
Temperature Monitoring Sensor

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Temperature Sensor
Temperature Sensor
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×3
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
VMWare Workstation 15 or earlier
Ubuntu Server
SMS Messaging API
Twilio SMS Messaging API

Story

Read more

Schematics

Schematics

Code

conf.py

Python
#You can find SID in your Twilio Dashboard
SID = 'AC84ae5eceXXXXXXXXXXXXX6ff711b05'
 
#You can find AUTH_TOKEN in your Twilio Dashboard
AUTH_TOKEN = 'cd2f5435XXXXXXXXXXXXXb29bbb1'

#FROM_NUMBER, This is the number generated by Twilio. 
FROM_NUMBER = '+12XXXXXXX73'

#TO_NUMBER, this is your number
TO_NUMBER = '+9174XXXXXX54'

#You can find API_KEY in your Boltiot Cloud
API_KEY = 'd5745340-XXXXXXXXXXXXXXX-c12dfc9ff1c8'

#You can find DEVICE_ID in your Boltiot Cloud
DEVICE_ID = 'BOLTXXXXX165'

temperature_monitor.py

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

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("Sending SMS through Twilio...")
            temp_value = round((100*sensor_value)/1024,2)
            print("The Current temperature is " +str(temp_value) + chr(176) + "C")
            response = sms.send_sms("The Current temperature is " +str(temp_value) + chr(176) + "C")
    except Exception as e: 
        print ("Error occured: Below are the details")
        print (e)
    time.sleep(10)

Credits

Sudhir Kumar

Sudhir Kumar

1 project • 2 followers

Comments