According to the Google definition of Internet of Things, the interconnection via the Internet of computing devices embedded in everyday objects, enabling them to send and receive data is known as IoT. In this project, I have used the major concepts of IoT from making a sensor to monitor temperature values and plot a graph using the machine learning algorithm and performing Z-score analysis to set a suitable temperature range. This sensor picks up values and the graph depicts any sudden changes or spikes. In my implementation, these spikes indicate the opening of a refrigerator door thus causing a sudden change in temperature. Further, I have developed an alert system that alerts the user in case the door has been opened via email.
There are a number of ways in which this system can be used. One of them is in a highly confidential organization storing important chemicals in refrigerators, this system can act as a log as to when the refrigerator has been opened or tampered with. In this way, my Temperature Monitoring and Alert System acts a security element.
For this project, I have used the Bolt Wifi Module and stored data on the Bolt cloud. I have made use of the software, Mailgun, to send my alerts through the email.
Here are the steps o create your very own Temperature Monitoring and Alert System.
Hardware ConnectionsI have used a LM35 Temperature Sensor, Bolt Wifi Module, a simple android usb cable and male/female wires.
1). Identify the VCC, Output and Gnd pins on your LM35 sensor from left to right with the curved side of the sensor facing downwards and the engraved side facing towards you.
Here in the picture, the green wire corresponds to VCC, blue wire corresponds to Output and purple wire corresponds to Gnd.
- Now, using the male/female wires, connect the VCC to the 5v pin on the Bolt Wifi Module.
- Now, connect the Output to the analog input pin A0 of the Bolt Wifi Module.
- Finally, connect the Gnd pin of the sensor to the Gnd pin of the Bolt Wifi Module.
Connect your Android usb cable and now you are ready.
Now we require our very own cloud server. For that we will make use of Digital Ocean and create our own Digital Ocean Droplet.
Now go ahead and create your digital ocean account and proceed to make a droplet.
You will require your Host IP Address which you might receive on your registered email id.
We will be coding in Linux. For Windows, I have downloaded PuTTY. This Host IP Address will be required to log in to your PuTTY to start coding.
RETRIEVING BOLT API KEY AND DEVICE IDLog into to your BOLT Cloud and under the tab 'API' you can find your API Key and under the tab 'Devices', your device id. Add these to the appropriate places in the code given.
So we will be using Mailgun to send alerts to our phones via email. Follow these steps to create your own account.
Open https://www.mailgun.com/ in the browser of your choice.
Sign up and create your account.
Sandbox domain-> add recipients -> invite new recipient -> enter email ID
Be sure to save your sandbox ID and sandbox URL and private API Key safely and add these to your code.
PROCEDUREPut your Bolt Wifi Module in the refrigerator and let it obtain sufficient values. After a while, open the door of the refrigerator and remove the module. Notice that email alerts will be sent to your email id due to the sudden temperature change.
At the output line where value is 42, the refrigerator door was opened and the device was taken out. That is when the emails were sent.
Comments