Email alert system for some thresholds temperature and Z-score analysis to detect the anomaly.
STORY:The government declared the following rules for manufacturing tablets/medicine in all pharmaceutical companies :
· While the manufacturer is allowed to maintain the temperature of the tablets between, -40 and -30 degrees Celsius, the temperature of the tablets should never remain between -33 and -30 degrees for longer than 20 minutes at a time.
· Also, the manufacturer should maintain a log of when the cooling chamber for the production of the tablets is opened.
· These rules should be implemented within a month of their declaration. Failing to comply would lead to cancellation of the pharmaceutical production permit.
While the government declared these rules to ensure that the medicine produced at all pharmaceutical companies, was good enough to be used by the general public.
This project is related to solving the problem that is faced by many pharmaceutical companies i.e. they have no automated alert system that alert the people responsible for management of cooling the chamber at a certain range of temperature. Because of temperature going below the lower threshold or going above the upper threshold value will cause the damage to tablets or medicine and that will cause a huge lose to the pharmaceutical companies.
The pharmaceutical companies use a cooling chamber which is similar to a refrigerator to keep the tablets and maintain the temperature in the required limits. However, since we don’t have a cooling chamber which can maintain a temperature in the range, of -40 to -30 degrees Celsius, you can instead use a regular refrigerator at your home for this project.
Project Objectives :1. Build the circuit for temperature monitoring system, using the Bolt and LM35 sensor.
2. Create a product on the Bolt Cloud, to monitor the data from the LM35, and link it to your Bolt.
3. Write the product code, required to run the polynomial regression algorithm on the data sent by Bolt.
4. Keep the temperature monitoring circuit inside your fridge with the door of the fridge closed, and let the system record the temperature readings for about 2 hours.
5. Using the reading that you received in the 2 hours, set boundaries for the temperature within the fridge.
6. Write a python code which will fetch the temperature data, every 10 seconds, and send out an email alert, if the temperature goes beyond the temperature thresholds you decided on in Objective “E”.
7. Modify the python code, to also do a Z-score analysis and print the line “Someone has opened the fridge door” when an anomaly is detected.
8. Tune the Z-score analysis code, such that, it detects an anomaly when someone opens the door of the fridge.
CIRCUIT CONNECTIONS
For circuit connections we are using BOLT IOT WIFI MODULE, LM35 Sensor, Male/Female Jumper Wires, USB Cable and Power Bank for supplying the current.
LM35 SENSOR
LM35 Sensor has three terminals - supply, output and ground. It is a temperature monitoring sensor and it can be used in Pharmaceutical companies to maintain the temperature of the medicines.
Where,
1.VCC pin of the LM35 connects to 5V of the BOLT WIFI MODULE.
2.Output pin of the LM35 connects to A0 (Analog input pin) of the BOLT WIFI MODULE.
3.GND pin of the LM35 connects to the GND of the BOLT WIFI MODULE.
SCHEMATICS :
A. Build the circuit for temperature monitoring system, using the Bolt and LM35 sensor.
B. Create a product on the Bolt Cloud, to monitor the data from the LM35, and link it to your Bolt.
In the above image, we are creating a new Product named as Project_Capstone..Than we are linking this product to BOLT WIFI MODULE.
C. Write the product code, required to run the polynomial regression algorithm on the data sent by the Bolt.
By taking the effective measures, Mr. Ram managed to satisfy the first condition set by the Government. Using the prediction data, he was able to take early action, whenever the graph predicted that the temperature would be maintained within the -33 and -30 degrees Celsius range for longer than 20 minutes.
Similarly, In the above image shown we are writing the code to run the Polynomial Regression on the data sent by the BOLT.
CODE :
setChartLibrary('google-chart');
setChartTitle('Polynomial Regression');
setChartType('predictionGraph');
setAxisName('time_stamp', 'temp');
mul(0.0977);
plotChart('time_stamp', 'temp');
Polynomial Regression:
Polynomial Regression is a form of regression analysis in which the relationship between the independent variable x and the dependent variable y is modeled as an nth degree polynomial.
Parameters used in Polynomial Regression :
1.Prediction points
2. Number of polynomial coefficients
3.Frame Size
D. Keep the temperature monitoring circuit inside your fridge with the door of the fridge closed, and let the system record the temperature readings for about 2 hours.
E. Using the reading that you received in the 2 hours, set boundaries for the temperature within the fridge
STEP 1: Create a filename sudo nano email_conf.py to store the credentials.STEP 2: Create another filename sudo nano temp_email.py for sending emails when temperature crosses its threshold.
F. Write a python code which will fetch the temperature data, every 10 seconds, and send out an email alert, if the temperature goes beyond the temperature thresholds you decided on in objective "E".
Ø Sending an email alert when temperature crosses its threshold.
READINGS :
G. Modify the python code, to also do a Z-score analysis and print the line “Someone has opened the fridge door” when an anomaly is detected.
STEP 1: For writing the final code for Z-score analysis, create another filename sudo nano project_capstone.py.
READINGS :
Ø Sending email alert for the temperature of the refrigerator.
H. Tune the Z-score analysis code, such that, it detects an anomaly when someone opens the door of the fridge.
APPLICATIONS :
There are Temperature Sensor applications in many industries including medical, motorsport, HVAC, agriculture, industrial, aerospace and automotive.
Some of the specific temperature sensor applications which we have come across are :
- Motors– There are many different aspects of motors and most of these require temperature measurement to ensure the motor itself does not overheat.
- ·Surface plates – Ring terminal temperature sensors are often used on surface plates as they can be mounted onto a flat surface and measure temperature effectively.
- Home appliances – Kettles, toasters, washing machines, dishwashers and coffee machines will all contain temperature sensors.
- Computers– Within computers there are temperature sensors to ensure the system does not overheat.
- Industrial equipment – Temperature sensors used within these applications will need to be robust as the environment can be very demanding.
- Warming Electrical Radiators – NTC thermistors are used to control the heat on electric radiators.
- Exhaust Gas Monitoring on Motorsport Vehicles – Motorsport temperature sensors need to be highly reliable and durable to ensure performance is not compromised in this harsh environment.
- Food Production; 3D printed chocolates – Temperature sensors are used to monitor the temperature of the melted chocolate for 3D printing.
Comments
Please log in or sign up to comment.