TEMPERATURE ALERT BY SMS
Tags: Bolt, Bolt Iot, IoT

Using LM35 (Temperature sensor) we will get an temperature alert via sms in smart phone. by which we can easily know the changing of temperature .

Hardware components:

Bolt WiFi Module

Breadboard

Micro-USB to USB Cable

Jumper Wires -3

LM35 (Temperature Sensor)

Software components:

Bolt Cloud (https://cloud.boltiot.com/home/)

Twilio software (https://www.twilio.com/console)

1. Introduction

This project is totally based on iot . for this project we are using boltiot module ESP8266 by which we can easily configure through bolt cloud. It has five digital GPIO pin ,one analog to digital pin , VCC, TX,RX and ground pin.

For our project we configure A0 pin through bolt cloud.

And write code in javascript. After all the connection

We are using twilio software for configure sms in smart phone. it will give an alert sms in our phone how temperature are changed.

Bolt ESP8266 module

2. Demonstration

After Configure bolt module through bolt app. Both light will stable it mean its connected with wifi and internet.

· Blue light stable means it connected with wifi

· Green light stable means it connected with internet.

Configuration KIT:

Now we have configure the kit required :-Breadboard, Micro-USB to USB Cable , Jumper Wires -3 , LM35 (Temperature Sensor).

Here we are using LM35 (Temperature Sensor). Which have 3 pin

Suppy(VCC), output and Ground. Which can be used to measure temperature anywhere.

Power the IC by applying a regulated voltage like +5V(Vs) tp the input pin and connected the ground pin to the ground of the circuit.

LM35

Configuration File:

The python coding for this project we will use Jupyter Notebook .

For using jupyter notebook first we have to install boltiot module by :-

Pip install boltiot

Then we need to make a configuration file which will have the specific keys for each user /device. Following is the configuration file named as conf.py

And write the code given below:-

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’

create an account on Twilio

Twilo is a sms functionality provider. Twilo allow software developer to programmatically make and receive phone call and also send and receive message

After the create account in twilio we get SID, AUTH_TOKEN,PHONE NUMBER.

Just copy all the code and paste into conf.py file.

Software Configure:-

For the software configuration we have go to https://cloud.boltiot.com/home/)

After sign in with your account click on product icon . after create product .select the pin A0 in hardware . click on code icon and write the code given below

setChartLibrary(‘google-chart’);

setChartTitle(‘Polynomial Regression’);

setChartType(‘predictionGraph’);

setAxisName(‘time_stamp’,’temp’);

mul(0.0977);

plotChart(‘time_stamp’,’temp’);

and save it.

Jypyter Notebook

Upload the conf.py file in jypyter . after import boltiot module and import file.

We have to create another file name project_boltiot for wite the main code for alert message.

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)

OUTPUT:-

Thank you!!!!!!!!

Pratyush Kumar