CLOUD BASED TEMPERATURE THRESHOLD MONITORING SYSTEM FOR PHARMACEUTICAL INDUSTRIESSubmitted by - Nakul Dubey
MAY 2020
ABSTRACT
Cloud Based Temperature Threshold Monitoring System for Pharmaceutical Industries is a cloud based advance temperature monitoring and controlling system equipped with high tech IoT technology which give output of current temperature of industry installed HVAC, system time, generated records, strength of signal, and further humidity and temperature factors. This application uses Bolt IoT kit with added sensors and continuous Internet connection. User and administrator can remotely access the data over cloud and take preventive measures required at time which will give advancement in management system of medicine manufacturing and supply chain also. This application sends SMS, Email, and Notification to all the monitoring devices, the administration, and to whomsoever the authority has given the right to receive that. We have developed this whole application which not only measures the current temperature but also adjusts the threshold according to the industry use. Besides, whenever the temperature is about to reach its threshold value it alarmed the whole industry by siren connected to the application.The advantage of this application is it also stores the data over cloud in CSV format and then we run our prediction algorithm which shows us that on which time of the day temperature get lower down so that we can adjust the system according to that and increase the temperature of HVAC and use this feature efficiently.
CHAPTER – 1
INTRODUCTION
1.1 Problem Definition
Heat affects every exercise that involves us. Direct confirmation of temperature is an important factor in the infinite interplay with various fields of science. Temperature recognition is important for the range of businesses, such as the food business, the workshop, and the pharmaceutical business and environmental testing. Simple temperature and computer temperature sensors are available for detecting temperature for business purposes. Temperature sensors have properties that are less than electrically measured temperatures containing resistors, semiconductor components, for example, diodes, and thermocouples.
This targeted access assesses the cost of continuous-effective heating. Here is a place to look for it by BOLT IoT. The programming language used for BOLT IOT is PYTHON. The sensor used here is an LM35 wire advanced temperature sensor. This sensor comes with a small pi-shaped transistor. The sensor is connected to a gadget that uses jumper cables. Temperature is achieved using a high-quality LM35 sensor and is used remotely and displayed by a screen. Various sensors such as humidity, barometrical weight, or vibrate can be concentrated without breaking the sweat to break the natural boundaries.
- Preparation for cloud-based testing
- Concrete machinery that collects heat indicators
- Software testing,
- Old-fashioned monitoring
- Making reports
- Preservation of sensitive data in an efficient manner
This experiment produces continuous temperature observations using BOLT IOT. Heat affects all the exercises that put us in the middle of it can be frostbite, espresso mixing, and so on. Heat variants play a fundamental role in the field of gadgets. Direct assurance of heat is a key element in the unmatched business and various scientific fields. Temperature testing is urgent for big business, such as the food business, the workplace, and the pharmaceutical and environmental business. Earnings can be displayed in the BOLT IOT pack using the order. The proposed strategy focuses on continuously assessing the cost of continuous heating — effectively by setting a limited means.
1.2 Project Overview
"Temperature-touchy pharmaceuticals" - Under the term "pharmacists", a combination of substances and Chemicals, for example, drugs, drugs biopharmaceuticals, APIs, synthetic materials, human body tests or clinical gadgets. They all talk about how their buildings and in this way their temperature changes - for example:
- Protein declines with time and temperature - the higher the temperature, the faster it destroys itself.
- Insulin can take shape whenever it is stabilised - if insulin is tight, it can be harmful to the patient.
- The gel will water in high temperatures.
Separated from food items, herbal remedies usually do not change their scent and eye makeup when exposed to the wrong temperatures. Either way, they change their size and their sufficiency. This way, losing a power system can be detrimental to continued security.
Items fall under the category of "thermal softening material" - Standard guidelines are not listed for all temperature-sensitive items in the setting of pharmaceutical and medical equipment. When the "cool chains" industry started in 1980, heat-sensitive pharmaceuticals were often added to refrigerated items such as vaccines, insulin, or bio-pharmaceuticals. Besides, blood and blood products, as well as research materials and the human body, require temperature monitoring. Since the 2015 amendment of EU GDP rules, API and room temperature materials, for example, small atoms and over-the-counter medicines, it was being recalled by the contact level of temperature control. As a new guide to medical gadgets comes into effect, clinical gadgets that include the type of drug regimen you are working on (for example cover) should also be considered within the range of thermal-controlled encounters.
1.3 Hardware Definition
1) BOLT IOT KIT
2) LM35 TEMPERATURE SENSOR
3) JUMPER WIRES
1.4 Software Specification
1) BOLT CLOUD PLATFORM
2) BOLT API
3) ANY OS (LINUX UBUNTU SERVER PREFERABLE)
1.5 Language Used
1) PYTHON
Python is a very advance level of language which came in existence in 1991. We can use python language broadly for developing application and system for various technologies. We have used Python 3.8 version in this application. Python plays a very important role in this application. The connection and configuration at the back end have been made by Python with the help of Bolt python Library. Working with Python is very easy.
2) LINUX BASIC COMMANDS
Linux Commands like given below are basically used at the time of deploying the whole application over Linux Ubuntu Server. The server of Linux is open source and freely available over the web. By using the given below commands, we can operate any type of Linux operating system.
>>> pwd
>>> ls
>>> cd
>>> nano
>>> mkdir
>>> rmdir
>>> rm
>>> touch
>>> clear
>>> sudo
>>> sudo -s
>>> apt-get update
>>> apt-get upgrade
>>> man
>>> --help
>>> cp
>>> mv
>>> locate
>>> echo
>>> cat
>>> df
>>> chmod
>>> uname
>>> ping
CHAPTER – 2
LITERATURE SURVEY
2.1 Existing System
Historical backdrop for experimental arrangements began more than 30 years earlier with Autonomous Temperature Data lumberjacks - for example, ELPRO's amazing HAMSTER. Battery-driven, the lumberjack data recording rate was recorded, and it had the option of transferring its internal memory to the display probe system. Since self-regulating temperature data was not the same in Hazard Anlages and Critical Control Point (HACCP) tests, the food and beverage industry such as heating, air conditioning, and cooling systems (HVAC) make use of early information of self-regulatory information. Shortly thereafter, the pharmaceutical business began analysing the cold and the cold rooms, too. The temperature information of the temperature gradients was close together with the bat used in the research centres and nature offices. Later offices were added to the power and transportation facilities.
Key Functions of Temperature Monitoring Systems - A monitoring system often contains measurements of temperature sensors or other environmental information in a specific location. The sensor transmits nodes that are more or less remote than the information woodhack, which acts as a communication link. Software slowly collects attributes to perform various tasks (see below framework).
In any environment and in many distribution centres, the basics of Building Management Solutions (BMS) are presented in the resulting temperature and environmental information such as bending, such as providing orders in a cool frame. What is the difference in a free monitoring solution? With the exception of Structural Control, Monitoring Solutions never have control circles but are completely independent of any control component. The permitted freedom of Monitoring Solution is an essential requirement of any GxP law.
Parameters and Sensors
Research, creation, testing, and filling of pharmaceuticals, are always performed in a systematic environment where different environmental parameters, for example, temperature, adhesion, pressure, pressure difference, C02 emission etc.
In this way, experimental preparations should be available to process, evaluate and demonstrate the full range of natural parameters. When an item is completed in a container, rent, vial or syringe, the temperature is an important detail for the environment that is important to the environment.
Placement of Sensors
The rules of GMP and GDP require the power of storage, cooling, or moving box. The most important piece of the process is the warm map system that separates the smoker from the coldest.
Depending on the specific situation and requirements, the appropriate sensor can be selected and set. It depends on the nature of the connection between the twin sensors (for example 4to20mA transmitters) or the remote sensors (for example temperature and humidity).
2.2 Proposed System
Cloud-based temperature monitoring
The cloud-based temperature monitoring system includes equipment that collects temperature parameters as well as program information monitoring, alerts, reports, and complements information collected in an approved way. In any case, where does this product work? While in the past "in the building" was the standard response, nowadays most of the cloud plans are being deployed. However, what are the proposals, risks and requirements for using a GxP-based cloud-based temperature monitoring system?
Cloud Technology
Cloud Technology is a utility that uses multiple Remote Server to provide web services, Instead of running the application on a neighbouring server on the premises. Typically, a distinction is made between the three-dimensional cloud models, which occur in the redistributed regions of the work. Programming as a service (SaaS), otherwise known as cloud-based application management, speaks to the great cloud vision. SaaS applications are transfers (business) that are usually done directly through the Internet browser and do not need to be downloaded or built on the client-side.
Advantages of Cloud Computing
Over the years, the distribution of computers and the simplification of the cloud have rapidly established business applications for all different businesses. This is due to the obvious points of interest:
- Know how to use the server farm accessible and open to the Cloud Provider
- Measures senior security measures in the office, gear, SW equipment (for example, fire agencies), forms and personnel
- Faster and easy-to-use computing equipment for all considerations (practicality, extra room)
- For Built-in Reinforcement and Reinforcement
- Reduced support efforts due to the impacts of coalition forces.
Each of these benefits often results in huge investment costs compared to the implementation of the program somewhere in terms of security and efficiency.
Generally, cloud registrations are similarly problematic: Login constraints bring conditions to the system provider. This requires a very unambiguous and clear consensus on the nature of the surrounding break.
Security concerns or regulatory appointments: Again, this requires additional efforts to assess proper compliance and general review. But ultimately it's about cost: What is the benefits (investment cost) and what are the additional efforts (additional costs) in cloud planning as opposed to using a local product.
Open cloud compares to Private Cloud: What is the right of SaaS.
Cloud Computing or Software-as-an management (SaaS) has three sub-types that distinguish when an application is dedicated to one client or if the system is shared by many.
Public Cloud: The application is provided by a SaaS provider and is used by many clients with client names and passwords but with a shared framework and program.
Private Cloud: The application is committed to one client. Separated from the public cloud, the private cloud grows more expensive because the assets have to double for each new client.
Hybrid Cloud: A combination of open and private cloud arrangements. Goods are typically covered in the form of an embedded framework. Cloud breeding Cloud captures the "best of both worlds" but is slowly improving in apathy and perception.
The cloud-based temperature monitoring system
To ensure that the public cloud-based SaaS cloud-based test provision is compatible with GxP, a couple of requirements must be satisfied: The hot test setup, including the database, is a factory-operated system. To meet the initial GxP requirements (for example, GAMP5, Title 21 CFR Part 11), the electronic framework must be approved (CSV). To ensure good stability, data must remain unchanged, and data integrity must be protected by a multi-layer application where information is available to be sensitive, clean, considered old, unique, precise, strong, robust, and accessible throughout its life cycle. Electronic framework approval (CSV) is a well-documented process of ensuring that a modern framework does exactly what it intends to do in a reliable and efficient manner. The most effective way to ensure data security is the SaaS Public Cloud temperature monitoring system. At a SaaS Public Cloud base, different customers experience a cloud-based temperature monitoring system that uses their own client names and passwords, which means they just approach their details and reports that guarantee maximum access rights. As a result, each row in the database is open only to authorised clients.
Risks of hosting a cloud based Monitoring Solution in the Public Cloud
The Pharma Supply Chain
Temperature monitoring and Pharma Supply Chain Like are fantastic chains of advanced features, and the flexible pharma series is amazing and versatile. In addition, the harmonious series of each medicinal substance looks different and relies on a multidimensional substance just as it is a creative space. While expensive substances such as synthetic drugs often have a short supply chain, low-cost generic drugs such as Aspirin have an incredibly frustrating cord with varying degrees between natural and patient. What all pharma chains kindly share all their wants and purpose, is the responsibility between Active Product Ingredients (API) submissions and the composite materials. More recently, the rate of temperature data analysis is slowly reaching the final mile to the drug store or even the patient. Direct-to-Patient-Shipments (DTP) are becoming more and more important, especially in relation to clinical precautions currently added to customised drugs.
How applicable is moistness for the pharma gracefully chain
Thickness is compared to the heat and refers to the amount of water that is visible around it. Mugginess is very effective in pharmaceutical production as long as the substance is in its open substance prior to the important compounding (for example, fluid or powder). After an important wrap, relative adhesion often loses its importance for security insights. It is all considered normal to close the limited adhesion in storerooms to maintain the proper distance from the negative impact on naming and assembly (for example, paper, cardboard). In most distributions, however, the main relevant parameter is temperature. The wood of information along these lines, as a rule, does not look for Moisture within a travel safe.
Transportation Conditions versus Capacity Conditions
Although each pharmaceutical item has an individual safety plan, it is included in the general temperature information according to the categories of transportation and transportation. As energy conditions we usually maintain temperatures - 196 ° C, - 80 ° C, - 20 ° C, 2-8 ° C and 15-25 ° C. As travel conditions the marks can be "wet nitrogen" (- 196 ° C), "dry-ice" (- 78 ° C), 2-8 ° C and 15-25 ° C. The "stabilised" (- 20 ° C) capacity is not always achieved by moving for two reasons. Stabilised materials do not usually accumulate at very high temperatures. It is cheaper later to use a freeze-dryer than to use expensive and complex pressure cooling.
Regulatory Environment of Pharma Companies
To the extent that an organisation needs to ask for, produce, store, deliver or sell medical supplies, it depends on the initial demand for management. Laws and guidelines are clear to all nations and often include national or international powers such as the FDA (United States), EU (Europe) or Swiss Medicine (Switzerland), all organised by ICH (International Council for Harmonization) Personal Chemicals).
In addition to the official guidelines, there are various related entities that provide track records that support and provide guidelines and implementation in clear cases. The most compelling organisations related to the pharmaceutical supply chain are International Society for Pharmaceutical Engineering (ISPE), United States Pharmacopeia (USP), Parental Drug Association (PDA) and World Health Organization (WHO). A management plan to keep abreast of these daily life-altering lifestyles and new rules has been turned into a place of enforcement and new final submissions.
GMP & GDP Differences
From a pharmaceutical point of view, the fundamentals of the management structure are the framework of Good Manufacturing (GMP) and the Good Distribution Practice (GDP) framework - though they are always referred to as GxP. While GMP emphasises physical fitness through integration (test counts, release and dose), the GDP centres around the allocation include transportation, moving stocks and discounts on medical supplies. Both the GMP and GDP mean to create good health by ensuring the quality of the item.
How GMP and GDP are created (short history)
GMP and GDP laws created in recent years. Rays associated with it shows the most important success made with GMP and GDP.
2.3 Feasibility Study
The main purpose of doing feasibility study is to see whether our given application system is suitable for work or not in short worthy to the industry or not which is determined by the three main factors which are technical, behavioural, and Economical Feasibility study. Let us discuss these three factors below:
Technical Feasibility:
We have used the Bolt IoT gadget and the cloud platform. It is clear that basic equipment and systems are accessible to develop and implement the given application system. We started doing work after having an intermediate level of knowledge in Python as well as in some sensors. After the study, we got the output that this system is completely technical feasible.
Behavioural Feasibility:
Currently, industries are using digital temperature sensing machine, which includes a lot big framework and connectivity all over the industry campus and that need man force to which at last is a burden to the industry. So by using our application company will save a lot of money and there are fewer chances of getting any human error which is best for the pharmaceutical industries.
Economic feasibility:
As long as we are building this application we get to know this system is financially viable as all the hardware components are cost-effective and are of the best quality. As per the advancement, this system is giving to the industry and taking care of all the major risk and reducing the man force for the particular task which is a win-win situation for the industry and for the administrator too.
CHAPTER – 3
SYSTEM ANALYSIS & DESIGN
3.1 Requirement Specification
The area consist of product necessities a degree of information joined to framework setting chart, use cases, and use case portrayals, is adequate to empower architects to structure a framework to fulfil those prerequisites, and analysers to test that the framework fulfils those prerequisites.
3.1.1 External Interface Requirements
Suggested application system uses some external devices for performing I/O task. Below are some of them.
- Computer Device
- Mobile Device
- Input Device
- Output Device
- Internet Broadband
3.1.2 User Interface
Monitoring Person needs a monitor, and a phone to get the notification of the temperature threshold every time it crosses below -31 degree and above -40 degree. It will also show the graphs, and the current temperature of the system or (HVAC) installed inside the industry.
3.1.3 Hardware Interfaces
The software is working on Cloud Platform, which is Bolt IoT Cloud Platform. Gathering information from the sensors connected by the Bolt IoT Device which is so advanced that contain it's Inbuilt Bluetooth module and Wi-Fi module and occupies less space and time to connect to any other device. Other than this, we just need jumper wires and LM35 sensor, and these will be interconnected with each other for collecting the accurate temperature of the pharmaceutical industry. At the user end, you just need a screen to see the data collected by the sensors.
3.1.4 Software Interfaces
We are using a Linux server for connecting and collecting data from Bolt IoT Cloud platform. For this Bolt Python library is used to make successful connectivity. And Bolt API has been used for the security purpose which is secured by the 16 digit API key so no one will disturb the connectivity and no one can see what's going on without the permission of the administration. Python language is used for the coding purpose. And giving instruction to the machine for performing the required task.
3.1.5 Communication Interfaces
For the communication purpose, constant connectivity of the Internet is required because this system is collecting the data over the cloud which require continuous connection to the Internet as our code and all the system required sensor and machines are configured on the cloud, so it is useless without the Internet.
3.1.6 Functional Requirement
It defines the fundamental function the system should perform. This whole product some main functions which are the key unique in this system which is given below.
- Collecting the correct temperature
- Checking the threshold
- Alarming the industry administration
- Sending a message on phone and email
3.1.7 Non-Functional Requirement
It defines the Non - Fundamental function which defines the need in the term of performance and security and many more things which are given below.
- Security of the system by API key.
- Collecting and saving daily data in CSV format.
- Prediction of temperature down at a certain time.
- Generating graphs for the analysis of temperature.
3.1.8 Reliability
The system shows the quality of being trustworthy and performing consistently well. Indicate the variables required to set up the necessary unwavering quality of the product
3.1.9 Availability
The software promises to be available to the industry use by taking some factors in confidence very strictly.
- Constant Internet connectivity.
- Maintenance of hardware.
- Act of God or Human Indulgence in any disaster.
3.1.10 Security
The whole application is secured by many factors given below.
- Linux open source Server – It is a secured OS.
- Bolt Python Library is another great factor.
- Security over the cloud is an added advantage.
- The API key is the main security factor of whole connectivity integrity.
3.1.12 Maintainability
The system is developed by the use of 75% of the hardware, and 25 % software which gives an added maintenance to hardware and less to software level Python is used in coding for the software which easy to update and use. One should just be aware of the hardware maintenance from time to time.
3.1.13 Portability
The major uniqueness of this application is you can see the current temperature and threshold crossing of industry while being anywhere in the world. It is possible because we have used cloud technology in it. You can see the condition over the phone through the web and in your laptop and desktop you just need administrative rights to do so.
3.2 Flowcharts / DFDs
3.2.1 Waterfall model
The Waterfall model document SDLC method was applied to the Plan of development. I flatten the Model represents the product improvement process stream directly consecutive. This means any stage of the process the better starts just when you finished the previous section. Waterfall model is a breakdown of the promise of the body directly into sequential stages, where each stage relies on the expectations of the one in the past and respect of other assignments. This is the way to run a processor in certain places to create a plan.
3.2.2 Data Flow Diagram
Data Flow Diagram shows the whole flow of the data inside the system application. It is very helpful while designing the whole cloud based monitoring system.
3.3 Design and Test Steps
3.3.1 Use Case Diagram
Use case diagram shows the different kind of user interaction as this is a product which is only used by the industry so the single user is administrator of the industry who monitor everything.
3.3.2 Activity Diagram
Activity Diagram shows the dynamic aspects of the system. A type of flowchart which shows the flow of from one activity to another activity.
3.4 Testing Process
Installation of Computing Platform – All the hardware connection is to be done, and then further these all will be configured over the cloud for harvesting temperature data over LM35 sensors connected to Bolt IoT Device. In addition, you have to install Linux server OS, and constant Internet connectivity is needed in high priority.
Site Preparation – All the monitoring device should be there in industry monitor room as specific, and you can also look of the temperature change and graphs over your laptop and phone in a remote location.
Technology Testing – All the hardware devices, including computer laptop and mobile, should be synced and checked once to see whether the whole application is working properly. In addition, coding and software should also be tested by a known and knowledgeable person.
Program Testing – after doing the whole process of installation and testing devices we should now turn on the Bolt IoT device and check the further connection and see whether we are receiving the temperature data on all the monitoring device.
User Training – so in this the same person with the less workforce can learn how to see and monitor the data and do their respective work for the company without having any human interference and mistake over industry. This will lower down the risk of any damage to medicine and industry.
Output Testing – At last, we have to check whether the coming output is correct and helpful to the industry. Because we have done this whole process just for the sake of correct outputs and lower down the workforce and risk factor of human indulgence.
CHAPTER – 4
RESULTS AND OUTPUTS
4.1 Connection of Hardware
This whole figure shows how the actual connection of the application system.
Hardware required
- The Bolt Wi-Fi module
- 3 female to male wire
- Temperature Sensor: LM35 sensor
Connecting the LM35 sensor to the Bolt
Step 1: Hold the sensor in a manner such that you can read LM35 written on it.
Step 2: In this position, identify the pins of the sensor as VCC, Output and Gnd from your left to right. VCC is connected to the red wire, Output is connected to the orange wire and Gnd is connected to the brown wire
Step 3: Using male to female wire connect the 3 pins of the LM35 to the Bolt Wi-Fi Module as follows:
- VCC pin of the LM35 connects to 5v of the Bolt Wi-Fi module.
- Output pin of the LM35 connects to A0 (Analog input pin)
- Gnd pin of the LM35 connects to the Gnd.
4.2 Configuring the machine
device_stat.py
from boltiot import Bolt
api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
device_id = "BOLTXXXXXX"
mybolt = Bolt(api_key, device_id)
response = mybolt.isOnline()
print (response)
This output shows how we have to configure Bolt IoT machine every time we need to do change or update by the use of security feature Bolt API Key.
First, we need to import the Bolt Class from the boltiot python module. This is done in line 1. Next, We need to provide the API key and device ID to the Bolt Class so that we can control our device. For this, we are creating and assigning a variable to hold the API key in line 2. In line 3, we have created and assigned a variable to hold the device ID. You can find your device ID and API key https://cloud.boltiot.com/api_credentials from your Cloud dashboard. The Device ID will be similar to something like BOLTXXXXX where XXXXX are numbers. In the fourth line, we are initializing the Bolt class with our API key and device ID. In the fifth line, we are calling the "isOnline()" function to know if the device is online or offline. In the last line, we are printing the response of the "isOnline()" function. This will tell us if the Bolt device is online or offline along with the time when the device was online/offline respectively.
If the device is online then it will print the following message.
{"success": 1, "value": "online", "time": "Mon 2018-06-18 03:27:40 UTC"}
4.3 Deploying the application
SID = 'You can find SID 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 accout API key'
DEVICE_ID = 'This is the ID of your Bolt device'
temp_sms.py
import conf
from boltiot import Sms, Bolt
import json, time
minimum_limit = 300
maximum_limit = 600
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SID, conf.AUTH_TOKEN, conf.TO_NUMBER, conf.FROM_NUMBER)
while True:
print ("Reading sensor value")
response = mybolt.analogRead('A0')
data = json.loads(response)
print("Sensor value is: " + str(data['value']))
try:
sensor_value = int(data['value'])
if sensor_value > maximum_limit or sensor_value < minimum_limit:
print("Making request to Twilio to send a SMS")
response = sms.send_sms("The Current temperature sensor value is " +str(sensor_value))
print("Response received from Twilio is: " + str(response))
print("Status of SMS at Twilio is :" + str(response.status))
except Exception as e:
print ("Error occured: Below are the details")
print (e)
time.sleep(10)
A Python program which will fetch the temperature data collected by Bolt and send SMS if the temperature value goes outside our specified temperature range.
The algorithm for the code can be broken down into the following steps -
1. Fetch the latest sensor value from the Bolt device.
2. Check if the sensor value is in the range specified in our min and max values.
3. If it is not in range, send the SMS.
4. Wait for 10 seconds.
5. Repeat from step 1.
In the above code, we are fetching the data every 10sec. You can change the value but ideally, it should be good if the time interval between 2 data points is more than 10sec
Note: The above "sensor_value" is the raw temperature reading, obtained from the LM35 sensor. In case you want to convert this value to the temperature in degree Celsius, use the formula: Temperature=(100*sensor_value)/1024 Where sensor_value is the variable in which data obtained from the LM35 sensor is stored.
4.4 Reading Sensor Value
In the above figure Linux server is running the python code and getting the value of sensor and at the same time checking the threshold parameters given manually.
4.5 Crosses Temperature Threshold
Figure shows then whenever the threshold crosses its value the system ask the third party SMS & Email application to send alert to the registered number.
4.6 Sending an SMS when Temperature Crosses Threshold
Since we have written a couple of print statement in the code. So the temperature data will get printed on the terminal. If that value falls outside the threshold range then SMS will be sent to your registered number. The screenshot for the SMS sent is given.
Twilio is a third-party SMS functionality provider. It is a cloud communications platform as a service (PaaS) company. Twilio allows software developers to programmatically make and receive phone calls and also send and receive text messages using its web service APIs.
After login in to your Linux Server. Create a file named conf.py which will store all the credentials related to Twilio. To create a new file type sudo nano conf.py in the terminal. After that write below code to save all the credentials in a single file[11].
SID = 'You can find SID in your Twilio Dashboard'
AUTH_TOKEN = 'You can find on your Twilio Dashboard'
FROM_NUMBER = 'This is the no. generated by Twilio.
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'
Note: You have to replace all the above value with your credentials. You can find the first four value in Twilio dashboard and the last two in Bolt Cloud dashboard. We store all the credentials in a separate file since it is sensitive data which should not be shared with anyone. Hence it is a good practice to avoid using credentials in code directly. After replacing all the values, save the file using CTRL+X.
4.7 Email received by the system
Mailgun is an Email automation service. It has a very powerful set of inbuilt functions for sending emails. Developers can process their email with the help of Mailgun API.
MAILGUN_API_KEY = 'This is the private API key which you can find on your Mailgun Dashboard'
SANDBOX_URL= 'You can find this on your Mailgun Dashboard'
SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
RECIPIENT_EMAIL = 'Enter your Email ID Here'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'
temp_email.py
import email_conf
from boltiot import Email, Bolt
import json, time
minimum_limit = 300 #the minimum threshold of light value
maximum_limit = 600 #the maximum threshold of light value
mybolt = Bolt(email_conf.API_KEY, email_conf.DEVICE_ID)
mailer = Email(email_conf.MAILGUN_API_KEY, email_conf.SANDBOX_URL, email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL)
while True:
print ("Reading sensor value")
response = mybolt.analogRead('A0')
data = json.loads(response)
print ("Sensor value is: " + str(data['value']))
try:
sensor_value = int(data['value'])
if sensor_value > maximum_limit or sensor_value < minimum_limit:
print("Making request to Mailgun to send an email")
response = mailer.send_email("Alert", "The Current temperature sensor value is " +str(sensor_value))
response_text = json.loads(response.text)
print("Response received from Mailgun is: " + str(response_text['message']))
except Exception as e:
print ("Error occured: Below are the details")
print (e)
time.sleep(10)
Since we have written a couple of print statement in the code, the temperature data will get printed on the terminal. If that value falls outside the threshold range then an email will be sent to your registered Email ID. The screenshot for the email sent is given.
After login in to your Linux Server. Create a file named email_conf.py which will store all the credentials related to Mailgun. To create a new file type sudo nano email_conf.py in the terminal. After that write below code to save all the credentials in a single file[12].
MAILGUN_API_KEY = 'This is the private API key which you can find on your Mailgun Dashboard'
SANDBOX_URL= 'You can find this on your Mailgun Dashboard'
SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
RECIPIENT_EMAIL = 'Enter your Email ID Here'
API_KEY = 'This is your Bolt Cloud account API key'
DEVICE_ID = 'This is the ID of your Bolt device'
Note: You have to replace all the above value with your credentials. You can find the first four value in Mailgun dashboard and the last two in Bolt Cloud dashboard.
We store all the credentials in a separate file since it is sensitive data which should not be shared with anyone. Hence it is a good practice to avoid using credentials in code directly. After replacing all the values, save the file using CTRL+X.
4.8 Data Set Collection
The figure represent the data collected by the system application which count the data set every 30 second and display the output in the form of graph.
code to plot the temperature data and run the polynomial regression algorithm
setChartLibrary('google-chart');
setChartTitle('Polynomial Regression');
setChartType('predictionGraph');
setAxisName('time_stamp','temp');
mul(0.0977);
plotChart('time_stamp','temp');
Prediction points: This number tells the Visualizer how many future data points need to be predicted. By default, the Visualizer spaces the points with the data collection time in the hardware configuration of the product.
So if you set the product to collect data every 5 minutes, and select 6 prediction points, the Visualizer will predict the trend and show 6 points up to 30 minutes into the future.
No. Polynomial coefficients: Polynomial Visualizer processes the given input time-dependent data, and outputs the coefficients of the function of the form:
Which most closely resembles the trend in the input data. This number tells the Visualizer how many elements should be present in the function i.e. the value of n.
Frame Size: These are the number of previous data points the Visualizer will use to predict the trend of the data. For example, if you set this value to 5, the Visualizer will use the previous 5 points to predict the trend.
4.9 Prediction of Temperature through Polynomial Regression
The figure represent the polynomial regression which we will use with the Bolt Cloud to predict what the temperature in your Pharmaceutical Industry or anywhere is going to be in future.
When you click on the predict button 2 graphs other than the data graph shown. These graphs are the prediction history, and the predicted data.
The prediction history graph helps you tune the machine learning model. You have to change the parameters below, to make it so that this graph most closely resembles the actual data. When this happens the predicted data, or the predicted future temperature will be most accurate.
CHAPTER – 5
CONCLUSION
Traditionally Pharmaceutical Industries use old gauge system to check the threshold of the temperature required by the industries to maintain the quality of the medicine because if the medicine lot gets damaged by the fact that it has been not manufactured in the required temperature which is [- 31º to - 40º] then by the government guidelines a whole lot of the medicine or drug has to be destroyed, and none of them should be distributed to the dealer or customer.
In any case, the temperature threshold crosses the required temperature degree, and the company has to suffer from a huge loss which ultimately affects the whole company supply chain, to the workers and the dealers too. Since 1937 the industry is trying to reduce this human factor of mistake and do it more correctly and accurately. As in security field, we say there is no patch for human stupidity so here is the same case pharmaceutical industry has faced a lot of loss due to this because earlier there was the human who does manually check the temperature and generate a handwritten report and at last the medicine doesn't match according to the government guidelines, and they have to destroy the whole lot.
Later on, there came a lot of advancement in this system helping the industry and the other food manufacturing industry too because FMCG products also depend on the temperature factor, so the change in monitoring the temperature of the industry is helping in the growth of all the essential products and services.
Then the digital system started to use in checking and monitoring of medicine manufacturing through temperature threshold, which is required. But the problem of the workforce was the same company have to use humans to check it and report it. Most of the big pharmaceutical Industry is running 24x7 in three shifts of 8 hours each. Just imagine how many amounts they are investing, but the risk remains same any misshapen can take place as there is no automatic system to alert the company and administrator that the temperature is reaching the threshold so that by the time better security measure can be taken and lesser the risk and loss for the company and the medicine lot.
So by considering all this, we have developed this whole application which not only measures the current temperature but also adjusts the threshold according to the industry use. Besides, whenever the temperature is about to reach its threshold value, it alarmed the whole industry by siren connected to the application.
This application sends SMS, Email, and Notification to all the monitoring devices, the administration, and to whomsoever the authority has given the right to receive that.
We have used the latest technology of IoT Device, which is Bolt IoT and the LM35 temperature sensor to which takes the input of the current temperature of the area. We also used the Bolt IoT cloud platform to connect the whole device and configure it through the Linux server by the use of the Bolt IoT python library for the connection of API and use it over remote location by the use of cloud technology.
The advantage of this application is it also stores the data over cloud in CSV format, and then we run our prediction algorithm which shows us that on which time of the day temperature get lower down so that we can adjust the system according to that and increase the temperature of HVAC and use this feature efficiently.
As a result, the pharmaceutical industry gets the win-win situation as on the one side the biggest factor of temperature threshold risk got almost null and void and on the other hand, they do not have to pay extra to the human for the manual work which lowers down the risk of human stupidity too. Concerning that their existing system monitoring administrator can do this work from them.
This cloud-based temperature threshold monitoring system for pharmaceutical industries will not only solve the problem of medicine manufacturing but also for the FMCG and food production industries all over the world.REFERENCES
[1] Kleist P, Zerobin Kleist C: Eine Kurzgeschichte der klinischen Studie. In: Schweizerische Ärztezeitung, 2005, 86, Nr. 44, Seite 2476
[2] US FDA. Milestones in U.S. Food and Drug Law History, https://www.fda.gov/about-fda/fdas-evolving-regulatory-powers/milestones-us- food-and-drug-law-history (22.05.2019) (letzter Aufruf: 22.05.2019).
[3] Wenzel J: Arzneimittelproduktion in den USA. In: Pharm. Ind., 1995, 57, Nr.
[4] Feuerhelm K: GMP – Was ist das? In: PS Training Service, 2000.
[5] Peither T, Rempe P, Büßing W: Qualifizierung. In: Maas & Peither AG, 2008, Tab. 1-1.
[6] Schnettler R: Basistraining Validierung. In: Kursunterlagen PTS Training Service, 2008, Seite 8.
[7] Biermann, Andreas: Eine Reise voller Risiken, erschinen in PZ Pharmazeutische Zeitung, Ausgabe 35/2016, https://www.pharmazeutische- zeitung.de/ausgabe-352016/eine-reise-voller-risiken/ (31.08.2016), letzter Aufruf28.08.2019
[8] Märkische Allgemeine Zeitung vom 15.01.2019, Patrick Pleul, dpa, https://www.maz-online.de/Brandenburg/Lunapharm-Skandal-Brandenburg-entzieht-Betriebserlaubnis, zuletzt aufgerufen 04.09.2019
[9] IPEC Press release 03.01.2012; https://www.gmp-navigator.com/gmp-news/ipec-veroeffentlicht-gdp-audit-richtlinie-fuer-pharmazeutische- hilfsstoffe (zuletzt aufgerufen 04.09.2019)
[10] Bolt IoT cloud platform (https://cloud.boltiot.com/home/)
[11] Bolt IoT Training (https://cloud.boltiot.com/training)
[12] Bolt Docs (https://docs.boltiot.com/docs)
Comments