Hi there !!
This project is about the pharmaceutical companies which use a cooling chamber to keep the tablets and maintain the temperature in the required limits. So making a device which notifies via Email or SMS for any sudden change in temperature or if it goes out of the defined threshold.
Instead of Cooling chamber, we use a regular refrigerator at home for this project.
Video of the Final result of this project :
Building the ProjectFor Setting the Bolt WiFi Module click on link https://docs.boltiot.com/docs.
Step 1: Connecting LM35 to Bolt- Connect the GND pin of LM35 to GND pin of the Bolt device.
- Connect the analog output pin of LM35 to A0 (analog input) pin of the Bolt device.
- Connect VCC pin of the LM35 is connected to 5v of the Bolt device.
To create a Product for this project, firstly login into BOLT CLOUD
Click on the Products tab and then create a product
For this Project
select the Input Devices option and GPIO to collect the data
Click on Configure this product to configure the product
Click on the "A0" pin of the Bolt and name the variable
now click on Code tab and write down the code
Now for Making Prediction Graph, we write code on JavaScript in the Bolt Cloud by using Google Chart
setChartLibrary('google-chart');
setChartTitle('Temperature Prediction For Pharmaceuticals');
setChartType('predictionGraph');
setAxisName('Time','Temperature');
mul(0.0977);
plotChart('time_stamp','temp');
Now view the visualization
count data for every 5 minute so wait for 20-25 mins.
Note :- Now you can also use your BOLT IOT android app and ios app for Visualization by just clicking the Bolt Device NameStep 4: Anomaly Detection with Z- Score analysis and Notification
For this project, I used Oracle VM Virtual Box, you can also use Digital Ocean. Now make conf.py which has the information of Twilio (Login and you use API) and Bolt Cloud account such as
SSID = "You can find SSID 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 account API key"
DEVICE_ID = "This is the ID of your Bolt device"
FRAME_SIZE = 10
MUL_FACTOR = 6
Similarly for Mailgun Email, make email_conf.py
MAILGUN_API_KEY = "your Mailgun private API"
SANDBOX_URL = "your sandbox url"
SENDER_EMAIL = "test@your sandbox url"
RECIPIENT_EMAIL = "your mail id"
API_KEY = "Bolt API key"
DEVICE_ID = "Your Device ID"
FRAME_SIZE = 10
MUL_FACTOR = 6
Make anomaly_detection.py in which we write a python code to use z-score analysis for anomaly detection and run it using
python3 anaomaly_detection.py
Python code is attached below
In case the anomaly occurs or temperature crosses the threshold, an SMS & mail alert is sent out using the Twilio and Mailgun.
The Screenshots of Twilio's Sms and Mailgun's Email
and Screenshot of display
Thank you
Comments