Well this project is about monitoring the temperature of the 'LM35' sensor, whenever its temperature crosses the threshold value set by me a telegram alert is sent to my channel indicating rise in temperature detected by the sensor.
Just equivalent to the way pharmaceutical companies work by using the IOT bolt's cloud help to detect any anomaly happening in the system, I placed my system (comprising bolt wifi device, 3 male to female wire, LM35 sensor, generic breadboard, Android USB cable with the circuit connections shown in the figure)
in the freeze and allowed the system to be held for 2 hours so as to know the temperature to which the sensor reads for setting up the threshold limit.I noted it around 13.5 degree centigrade.
I made use of Ubuntu OS terminal via VMware so as to control the cloud via python libraries. In the code(.js) provided by cloud, With the help of polynomial regression technique algorithm of Machine I got to know about the temperature sensed by the sensor so as to set the threshold value of the the sensor.
Circuit Connections Explained:With the Lm35 sensor in the hand so that you can read it from left to right, identify the pins of the sensor as VCC, Output and Ground from your left to right. In the figure you may see by careful observation in the breadboard, VCC pin is connected to blue wire, Output being connected to green wire and Ground pin connected to yellow.
Now other end of the respective blue, green and yellow wires being connected to 5v, A0 analog pin and gnd of the bolt wifi module. Now finally the power supply pin of wifi module connected to the socket via android usb cable so as to power it on.
BOLT CLOUD SETTING with device :Setting up the Bolt cloud obviously requires our Wifi microcontroller to be connected to the cloud app firstly.Bolt device has got 2 led's with it, slow blinking of green led indicates that the device has got the power supply and it starts its own hotspot so that it may catch the device wanting to make use of it (device having bolt cloud app installed actually requires enabling its gps so that bolt device may detect it), once connected to the cloud, the wifi device green led starts blinking fast showing that it has now secured the connection with the device's app.Now its time to connect the cloud and wifi device to a internet connection so that we may make use of cloud in an effective manner.Now you may debug the connections since by now both the leds must be glowing in a stable manner.
Creating Projects in The Bolt Cloud App:Follow the screenshots provided to create the product in bolt cloud app:
Go to the dashboard of the site and select Producs tab to add the product, click on add product as shown in the figure1.
Another window with the title as Built Product pops up, now we have to give it a name, I have given it temp_monitor.
Since LM35 sensor senses the temperature of the environment around so its a input device so click on input device option asked above.
I wanted to collect the data in GPIO(General purpose input output pin)so I choose gpio next.
Click on done to proceed further.
Now you will be taken back to the dashboard with the message poping up at the top showing that the product has been successfully created.
Now kindly click on "configure your product" icon provided at the middle right of the above screen shot shown.The window shown below pops up showing the products setup.Now in the hardware Tab of the page, set the output pin to A0 since we are connecting the output pin of the sensor to the A0 pin.Give it a name as well as shown in the figure.
Now go on to the code tab, and write the code's file name with.js extension and write Polynomial regression Machine Learning Algorithm code.
Now move on to saving the above code.
Now link the device to the product and click on the icon to deploy the configuration.In this way your circuit connections as well as bolt cloud is ready being linked with the wifi module.
Now keep the circuit in the freeze as shown.
Now power on the bolt wifi module.
Keep the system in the freeze for 2 hours so that it may stabilize the environment with the door of freeze closed.
Under the bolt cloud app click on "View The device" icon to see the chart graph showing the temperature versus time graph as shown below:
So finally by watching the curve trend I marked my threshold limit to 13 degree celcius as temperature may go very less beyond this line.
You may see a anomaly afterwards in the graph but kindly ignore it since I opened the freeze for the further intended purposes.
WRITING THE PYTHON CODE IN UBUNTU VMWARE TERMINAL:Meanwhile within this 2 hours I made use of my own server of ubuntu with the cloud's api and device id to access both of them via my ubuntu vmware server.
I made 2 sepearte files one for having access to telegram and bolt api's while another for the actual code for controlling the sensor.
Below is the conf.py file having all the configurations as explained just above.I have erased my bolt api key and device id so that no one misuses my account.
Now I have created Another file called telegram_alert.py, containing the code for monitoring the sensor. Below are 3 screenshots for explaining the entire code
Below is the output of the above code sending an alert to my telegram channel about the sensor temperature being raised to the level above than sen manually by me since as soon as I opened my freeze the temperature of the sensor increased and it got surpaased my threhold limit set and hence the result.
Comments
Please log in or sign up to comment.