Lets think that you are the supervisor of a company's cold storage department, it's your responsibility to maintain the optimum temperature of the storage, or else the products in the cold storage will start to deteriorate. Its very troublesome to keep on checking the temperature value manually every now and then to ensure that the refrigerator is working properly. So to solve this problem we can use IoT and make a temperature monitoring system which constantly monitors the temperature inside the storage and if there is any change in temperature due to system failures and value of temperature goes beyond the threshold value this project will send sms alert to you that the temperature value is xyz and once you are notified you can take the required actions by calling the maintenance department and hence saving the products from decaying there by saving company's revenue.
2. DemonstrationAlert notification on sms appStep 1: Open https://www.twilio.com/ in browser.
Step 2: Click on Get a Free API Key
button to sign up.
Step 3: Fill all the necessary details in SIGN UP form. Below is the screenshot of filled sign up form.
Step 4: To verify they will ask for your phone number. Choose India as an option in the dropdown and then enter your phone number.
Step 5: Click on "Products" as shown on the screen below,
Step 6: Now enable the SMS services by clicking on two checkboxes for Programmable SMS and Phone Numbers as shown below.
Once you have done this, scroll to the bottom of the screen and click on "Continue".
Step 7: Now, you will need to give a name for your project. I have given the name as My Project. Click on "Continue" once you have entered the project name.
Step 8: Click on "Skip this step" when it asks you to Invite a Teammate.
Step 9: Your project should be created at this point. Click on "Project Info" to view the account credentials which is required for your projects.
Step 10: You can view the Account SID and Auth token on this page. The Auth token is not visible by default, you can click on "view" button to make the Auth token visible as shown below. Copy both and save them somewhere securely.
Step 11: From the drop-down menu, choose "Programmable SMS". Now click on Get Started
button to generate phone number.
Step 12: Click on Get a number
button.
Step 13: Then a popup will appear. Click on Choose this number
button.
Step 14: Then a popup will appear which will have the final number. Copy this number and save to notepad for future references.
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.
In the above image, VCC is connected to the blue wire, Output is connected to the grey wire and Gnd is connected to the purple 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.
ConfigurationFile
The python coding for this project is done in Ubuntu (Linux). Before we start coding in python, we need to make a configuration file which will have the specific keys for each user/device. We will import this file in our main code and use the various attributes.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.
The API key and Device ID of the Bolt module can be determined as follows:
Connect your Bolt Device to the Bolt Cloud as per instructions given at https://cloud.boltiot.com/.
- The following screen will appear after that.The Bolt Device ID is highlighted in yellow.
- Go to the API section to know the API Key.
Codingin python for sms alert
Codeexecution
Comments