Suppose you want to know what will be the temperature after every 5 minutes. What you will gonna do?So, if you want to know the future temperature follow this project. In this you will learn how to predict the temperature of future. So let's get started.
The system takes taken temperature values as input using the LM35 temperature sensor and using polynomial regression algorithm, predicts the temperature values of the future instance. We have to tune the model according to the environment and the criteria that we want to achieve.
Hardware ConnectionsStep 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.
In the above image, 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 WiFi Module as follows:
- VCC pin of the LM35 connects to 5v of the Bolt WiFi module.
- Output pin of the LM35 connects to A0 (Analog input pin) of the Bolt WiFi module.
- Gnd pin of the LM35 connects to the Gnd.
The final circuit should look like the image below:
That's it.
Software Setup for Predicting TemperatureStep 1: Go to cloud.boltiot.com and create a new product. While creating the product, choose product type as output device and interface type as GPIO. After creating the product, select the recently created product and then click on configure icon.
Now make a new product and cofigure it as follows.
In the hardware tab, select the radio button next to the A0 pin. Give the pin the name 'temp'.
Go into the code section and Copy the code that I have attached and file extension should be js.
Now save it and link this product with your device and you are ready to go.
Collect data for about 2-3 hrs to get the proper prediction of the temperature.
After completing this open your visualizer on BolT cloud. I got the following visualisation. I put my setup in refrigerator, choose any environment you want.
Now you know how to run this algorithm.
Understanding the AlgorithmPrediction 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.
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.
Comments