This project is about creating a temperature alert system using the IoT platform and where it can also be used as a solution in many practical scenarios.
In this project, we are using a machine learning algorithm called Z-score analysis, data visualization, and telegram to get notifications.
Using this analysis we can detect the anomaly in collected data. This includes calculating Z-Score, mean, variance, and threshold value. Whenever the data crosses the threshold value a message can be sent to the user.
Z-Score depends on two constant inputs we give, Frame Size and Multiplication Factor.
Here the threshold value is directly proportional to the multiplication factor(C) and inversely proportional to the frame size(r). i.e., we should tune these values to get accurate anomaly detection.
HARDWARE CONNECTIONS- LM35 - Temperature sensor
- Place it on the breadboard. (flat surface facing your side)
- In the same way, connect the other end of the jumper wires to the respective pins of the LM35 sensor on the breadboard.
- Bolt Wi-fi Module
- Connect three jumper wires to the Bolt Wi-fi Module.
- Each one for Vcc pin (5v), GND pin, input pin (A0).
- In the same way, connect the other end of the jumper wires to the respective pins of the LM35 sensor on the breadboard.
- Power up the device to get started.
- Open the Bolt cloud platform and create a product.
- Configure this product.
- Write a javascript to get data visualized in the graph using google-chart. Click here
- You can also use the
'
predictionGraph
'
to predict the next temperature value.
setChartLibrary('google-chart');
setChartTitle('Your Graph Title');
setChartType('predictionGraph');
setAxisName('X-axis Name','Y-axis Name');
mul(0.0977);
plotChart('time_stamp','your_variable_name');
- Open the Ubuntu terminal and install Python libraries for boltiot. Click here
- Create a configuration python file consisting of device id, API key, and other required data such as telegram chat id, telegram bot id, frame size, and multiplication factor.
- Write the required coding part in another python file. Go here
- The main program consists of two functions
compute_bounds()
for computing Z- score analysis andsend_telegram_message()
for sending alert messages whenever the anomaly detected.
- Create a telegram bot and telegram channel to get alert messages through telegram
- Add telegram bot to the telegram channel you created.
- Join the members to the channel to get an alert/notification.
Comments