Hey I'm Ganapriya, this project is a part of internshala IoT training.In this we consider the cooling chamber of pharmaceutical industry as one of the real time problem.Our approach is to detect variation in temperature range and anomaly in value when someone open the chamber.To solve this we consider the refrigerator as cooling chamber and going to work on it.
This project deals with constantly monitoring temperature using LM35 and BoltIoT Wi-Fi module.
COMPONENTS
OBJECTIVE
- To plot a predictor graph made of polynomial regression ML algorithm to predict the future temperature change and ranges so that early action can be taken when the temperature is maintained within the given range for longer than 20 minutes.
- Sending an Email using Mailgun services and a SMS using Twilio services when temperature is not within the prescribed range so that early action can be taken and when fridge is opened (Using Z-score Analysis i.e. when anomaly in temperature graph is detected) and alarm through the buzzer and LED light.
CONNECTION
PROCEDURE:
STEP 1:Create a product on Bolt cloud to get the upper ,lower temperature limit of the fridge.
STEP 2.Save a code for polynomial regression and hardware components of product and exit.
STEP 3.Later link the product to the bolt module and deploy the configuration.
PREDICTION GRAPH
STEP 4.Place the temperature sensor for about 2 hours inside the fridge and see the output.
STEP 5.Analyse the output and decide the maximum and minimum limit.
Min=2 degree= 20.48 (sensor value)
Max=4.5 degree= 46.08(sensor value)
STEP 6. Install BoltIot python library and write python code on the terminal in the linux operating system.(or digital ocean or virtual machine)
STEP 7.Create a new folder temp_alert by following command.
mkdir temp_alert
cd temp_alert
sudo atom conf.py
Note : Need a maligun account and twilio SMS messaging account before performing the upcoming steps.
STEP 8.Create a file named ‘conf.py’ in folder ‘temp_alert’ which will store all the credentials related to maligun ,twilio ,bolt device id ,bolt API key,mul_factor and frame size.
STEP 9.Create one more file ‘main.py’ in folder ‘temp_alert’ using command
STEP 10.ALGORITHM OF THE PYTHON CODE:
- Import conf which have all credentials ,json,time.
- Import our Bolt python library which will let us fetch the data stored in bolt Cloud and then based on it send mail and sms and import math and statics libraries will be required for calculating the z-score and the threshold boundaries.
- Fetch the sensor value from bolt sevice and store in a list ‘history_data’ which is used for computing z-score.
- Display the sensor value in terms of temperature (celcius).
Temperature(celcius)=Sensor value/10.24
- Define a function ‘compute’ to compute z-score ,upper and lower threshold bounds for normal and anomalous readings.
- If the sensor reading cross the range of normal reading send a mail and a SMS , if any error occurred display the error.
- Then depending on bounds of Z-score analysis check the sensor value ,if it crossed the limit display ‘Someone opened the door’ and send a mail and a SMS,if any error occurred display the error.
- Wait for 10 seconds.
- Repeat the steps from step3.
STEP 11.Run the python code by following code.
sudo python3 main.py
When anomaly or temperature variation from range found, LED glows and buzzer alarms.
OUTPUT:
RESULT:
The final output of prediction chart in bolt cloud gives the prediction of next 20 minutes of temperature range. And the python code output detect and alert the change in temperature and an anomaly in the temperature when the door is opened by mail ,SMS and alarm by LED light and buzzer. As the result of this project pharmaceutical companies keep their tablets in better condition to avoid destroying ,major loss and can able to obey all the government rules perfectly.
Comments