Introduction
It is very important in pharmaceutical industry to maintain the temperature of the medicines in the threshold range and it's very important to inform the owner if the temperature is about to go beyond the set threshold value, my project does exactly the work of saving lot of products from damaging by informing to owner even before the temperature reaches beyond the threshold value set.
https://drive.google.com/file/d/10fhJGqhHiohwMzRG_q0W6h79lh6plE8x/view?usp=drivesdk
Hardware ComponentsWe need the following components to build the whole project:
- Bolt WiFi module
- LM35 Temperature sensor
- 3Jumper wires ( Male to Female )
- Micro-USB cable ( mobile charger can also be used )
- Power Source ( power bank can also be used )
- Connect the adopter pin to bolt pin and give the power supply. Now, blue led will be on.
- Now on your mobile hotspot and connect to bolt device. Then green led will be on.
- Connect the Supply/Vcc pin of LM35 to 5volt pin of bolt Wi-Fi module.
- Connect the ground pin of LM35 to ground pin of bolt device.
- Connect the analog output pin of LM35 to A0 pin of bolt.
- Before giving the power supply make sure that your connections are tight.
The working principle is quite easy. LM35 is temperature sensor that senses the temperature of surrounding environment and generates the analog output voltage. This analog voltage produced by LM35 is given as input to bolt A0 Pin. Then bolt converts the analog value to 10 bit digital value. This digital data is send cloud throw bolt.
Create a product : Different types of products can be configured in bolt cloud. Here, the LM35 temperature sensor is an input device because it gathers data from the connected sensors and send it to the bolt cloud at the set interval. Since the sensor is connected to the A0 pin, GPIO option is chosen.
Once the product is created, following screen will appear.
Polynomial Regression is a prediction algorithm which helps us to predict the future temperatures in case of persistence of same temperature levels for a long time thereby allowing to take early action.Using the polynomial regression, the complex data set(temperature data) is taken and a polynomial equation is derived which best represents the data set.
The polynomial equation is of the form: y=f(x)
where f(x) is a function of sum of different powers of x. Usually time is considered as the x value. The corresponding coefficients in the polynomial equation is obtained by observation of the data trend in the algorithm and are tweaked till it matches the data set perfectly. Hence once the equation is obtained, by just substituting the time at which we want the temperature, the respective temperature value is obtained by the above equation.
Hardware ConfigurationOnce the product is created, click on the configure option to first configure the hardware as shown and initialize the A0 pin with a variable 'temp'.
The following code is written to plot the temperature data and run the polynomial regression algorithm on this data to predict the future temperatures.
Once both code and hardware are configured and saved, the bolt device is linked and the configuration is deployed. The temperature readings for almost one hour is recorded.
The parameters shown in the graph are explained as follows:
- Prediction Points: Tells the Visualizer how many future data points need to be predicted.
- No of Polynomial Coefficients: Visualizer processes the given input-time dependent data and outputs the coefficients of the equation
which 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: No. of the previous data points the visualizer will use to predict the trend.
The predict history graph will help you tune the machine learning model. The parameters can be changed so that this graph closely resembles the actual data which will ensure the predicted future temperature will be accurate.
ConclusionHence, successfully a temperature monitoring system using Bolt IoT and machine learning is developed and implemented.
Thankyou π
Comments