Aman Kumar (B18ME005)
Published © GPL3+

Temperature Monitoring System via LEDs

A system based on Bolt IoT which lightens LED to indicate the temperature range whether it is normal, in-between or extreme.

IntermediateFull instructions provided15 minutes316
Temperature Monitoring System via LEDs

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Breadboard (generic)
Breadboard (generic)
×1
LM35 Temperature Sensor
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Jumper wires (generic)
Jumper wires (generic)
×1
5 mm LED: Green
5 mm LED: Green
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Schematics

Schematics

Follow the instructions to make connections as per the schematics

Code

The main code file to be executed

Python
You can change the temperature ranges freely but don't put such values that it causes an error
from conf import api_key,device_id
from boltiot import Bolt

import time
import json

mybolt = Bolt(api_key,device_id)

ind_p = None

High = 'HIGH'
Low = 'LOW'

pin_1 = 1

pin_2 = 2

pin_3 = 3

pin_4 = 4

''' Define tempearute ranges here '''
extreme_high = 42

extreme_low = 16

mid_high = 36

mid_low = 20

# making pin4 to work as ground
res_ground = mybolt.digitalWrite(str(4),Low)

while(True):
	temp = mybolt.analogRead('A0')
	data = json.loads(temp)
	try:
		temperature = (100*int(data['value'])/1024)
		if(temperature >= mid_high):
			if(temperature >= extreme_high):
				ind = pin_3
			else:
				ind = pin_2
		elif(temperature <= mid_low):
			if(temperature <= extreme_low):
				ind = pin_3
			else:
				ind = pin_2
		else:
			ind = pin_1
		if(ind != ind_p or ind_p==None):
			response1 = mybolt.digitalWrite(str(ind_p),Low)
		response2 = mybolt.digitalWrite(str(ind),High)
		ind_p = ind
	except Exception as e:
		print("Error occured: Below are the details")
		print(e)
	print("The Temperature is : ",temperature)
	time.sleep(20)

Bolt WiFi Module configurations

Python
Change the values of the variables of the file to your Bolt WiFi Module, API KEY, and DEVICE ID.
api_key = "**********************************"
device_id = "*********"

Credits

Aman Kumar (B18ME005)

Aman Kumar (B18ME005)

1 project • 0 followers
IITJ Sophomore

Comments