The TemperatureMonitoring System by using the LM35 sensor is such a useful IoT tool that helps to calculate the actual temperature of your room and convert it in a manner. And the fun thing about this is that it also text's a message to the user and tells them that the current temperature value senses the temperature automatically as per requirement.
So without wasting any time let's move to the further steps to create such a device for ourselves.
The most first thing is connection. So I"ll tell you step by step how to do connections.
1. Connect the VCC terminal of LM35 sensor to 5V in the Bolt IoT WiFi module, with the use of jumper wires.
2. Connect the middle terminal of the LM35 sensor to A0 in the Bolt IoT WiFi module, with the use of jumper wires.
3. Connect another Ground terminal of the LM35 sensor to GND in the Bolt IoT WiFi module, with the use of jumper wires.
Step 2:
Created a product on the Bolt cloud, to monitor the data and link it Uploading image to a device.
Wrote a product code, required to run the polynomial regression algorithm on the data sent by the Bolt.
setChartLibrary('google-chart');
setChartTitle('Polynomial Regression');
setChartType('predictionGraph');
setAxisName('time_stamp','temp');
mul(0.097)
plotChart('time_stamp','temp');Step 4 :Go to google.com and search for Twilio and create a free account this will help to get the text message about the Temperature value inside the room.
Step 5:
Now moving to the coding part of the System.
1. Create a python file (.py).
2. Name that python file "conf.py"
3. Copy the below code and save it.
4. Change "SID", "AUTH_TOKEN", etc. according to your own.
SID = 'You can find SID 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 accout API key'
DEVICE_ID = 'This is the ID of your Bolt device'4. Now create another python (.py) file and name it "temp_alert.py"5. Copy the below code and save it.
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)




.png?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)









Comments