Malvi Mungalpara
Published © GPL3+

Cold Storage Manager

I have designed a system with BOLT IOT device which will notify Cold Storage owners in case of any impairment found inside Storage.

IntermediateFull instructions provided3 hours320
Cold Storage Manager

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
Breadboard (generic)
Breadboard (generic)
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
Temperature Sensor
Temperature Sensor
×1
LED (generic)
LED (generic)
×1
Buzzer
Buzzer
×1
Resistor 10k ohm
Resistor 10k ohm
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Male/Male Jumper Wires
×6

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Snappy Ubuntu Core
Snappy Ubuntu Core

Story

Read more

Code

Cold_Storage_Manager

Python
To create a file : sudo nano cold_storage_manager.py
To run file: python3/python cold_storage_manager.py
from boltiot import Sms, Bolt
import conf
import json,time

MAX_LIMIT = 45  
MIN_LIMIT = -10
###you can vary values here according to your requirement

mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)

while True:
    print("\nReading Temperature Values")
    A_response = mybolt.analogRead('A0')
    print(A_response)

    A_data = json.loads(A_response)
    Temp =(int(A_data['value'])*100) / 1024  ##convertin values to Degree Celsius
    print("\nTemperature in degree celsius")
    print(Temp)

    print("\nSensing presence of Light")
    D_response = mybolt.digitalRead('0')
    print(D_response)

    D_data = json.loads(D_response)

    try:
        D_value = int(D_data['value'])

        if (D_value ==0) or (Temp > MAX_LIMIT) or (Temp < MIN_IMIT):
            mybolt.digitalWrite('1','HIGH')  ## LED output
            mybolt.digitalWrite('2','HIGH')  ##Buzzer Output
            print("\n Making request ot Twilio to send SMS")
            response = sms.send_sms("Alert Message: There is issue with light or Tempe                rature in Cold storage" + " The current Temperature is " + str(Temp) + " degree Celsius")
            print(\n"Response received from Twilio is: " + str(response))

        elif D_value == 1:
            mybolt.digitalWrite('1','LOW')
            mybolt.digitalWrite('2','LOW')

    except Exception as e:
        print("\nError occured: Below are the details")
        print(e)



###digitalRead(), analogRead(), digitalWrite() are functions of bolt python library

Credits

Malvi Mungalpara

Malvi Mungalpara

1 project • 1 follower

Comments