Imagine you have a chemical industry that manufactures a wide range of products, which deals with a couple of toxic gases.One fine day there may be a gas leakage. You may be in or not in your company. This project alerts you, concerned staff and government officials through SMS, Telegram and Twitter. Taking immediate action can save MANY lives.
Why BOLT as a platform?I have chosen bolt wifi module for this project because I found that of all other platforms bolt made my work easier, smoother and comfortable.I felt it very friendly and easy to implement things.All thanks to bolt...
Project:This is my first project on hackster.io and I am ready to take your further suggestions and feedback.
First things first, let me give you a more insight into working of this project. I have used a MQ 135 sensor that detects harmful gases such as benzene, ammonia, NOx, smoke and CO2. Whenever it detects a gas crossing its threshold value, it switches on the buzzer. Apart from that it also sends a message to your mobile phone, get notified by telegram bot on your channel. Also it creates a tweet "There is gas leak #needhelp" on your twitter account mentioning government officials, police.
Here the Python Script checks the MQ135 Sensor value sent from bolt device to the Bolt Cloud for every 10 sec and if gas concentration crosses threshold then it switches on the BUZZER and put them on for 10 sec and during that time it requests the Twillio API to send message to your phone number. The telegram bot you created sends a message to channel that has your employees. Twitter also creates a tweet and post it automatically(This is done by Integromat) so that your followers and officials know.
Message:Twitter:
Open www.cloud.boltiot.com on your web browser.
you can sign up by filling your details. Then you will be getting the following page.
Step 1: Open the playstore app on your mobile and search for Bolt Iot app and install it.
Step 2: Login using the bolt cloud credentials and Follow the instructions specified by the app, using those instructions Link your Bolt Module to the cloud.
After linking your bolt cloud page would be looking like...
check this video for more details:
4. Creating an account on TwillioTwilio is a third-party SMS functionality provider. It is a cloud communications platform as a service (PaaS) company. Twilio allows software developers to programmatically make and receive phone calls and also send and receive text messages using its web service APIs.
Step 1: Open https://www.twilio.com/ In browser.
Step 2: Sign up, choose language as Python and we are building account notification. After filling the details press next and verify your number.
Step 3: After verifying the number you will be redirected to Twillio home page, then click on products choose programmable sms, click continue give appropriate name for your project. by giving appropriate name.
Step 4: Then you can go to dash board. Create a new number. click on choose this number. Copy the ACCOUNT SID and AUTH TOKEN, FROM_NUMBER to your python conf file.
Telegram is a messaging app similar to Whatsapp. You can send and receive messages along with files also. It is FREE to use. You can access the platform via your Android/iOS/Windows phone and also your PC or Mac.
A)Steps to sign-up for/sign-in to Telegram:1)Go to the Playstore or App Store on your phone and search for Telegram
2)Download and Install the latest version of Telegram app.
3)Signup for a new account or sign in to Telegram by providing your mobile number
4)Telegram will call you OR send you a SMS to verify your mobile number.
5)Get your account verified and approve any permissions if required.
B)Create a telegram channel1)Go to the home screen of the Telegram app.
2)Swipe from the left side to reveal the menu.Click on "New Channel".
3)It will ask you for a Name and Description for your channel. Give a suitable name and description. Adding photo is optional.
4)In the next screen set the channel as Public.
5)On the same screen, it will ask you to enter a permanent link for your channel. You can use lowercase letters and numbers 0-9 to create the channel link
6)Please note that the channel link name is global and you will be able to create a channel link only if the link name is available. The channel link name is something similar to an email address, i.e. only one unique email ID can exist at one time.
- 7)keep a note of this Channel permanent link name. It will be required later on to send messages to this channel. For example, the channel link name is "temperature_alert"
Telegram allows us to create a new bot with the help of a bot called as "BotFather". It is a single bot to create and manage other bots.
1)On the Home screen of the app, click on the search icon on the top right and type in "botfather".
2)In the search results, click on the correct result for "BotFather" as shown below. The correct "BotFather" will have a blue tick mark next to its name. This will take you to a chat window with the "BotFather".
3)Since we need to create a new Bot, go ahead and type in "/newbot" in the window.It will ask you to type in few more details like Bot name and Bot username.
4)This token is used to control your Bot as well as send messages on behalf of it. Please keep this token secure as it will allow anyone to access your Bot.
Click on the Administrators button so that we can add the newly created bot to your channel and then search for bot you created.Select it and add to your channel.
You will be asked to confirm the rights for the bot. Press on the tick mark on the top right to continue adding the bot to the channel. Make sure that the bot has the rights to "Post Messages".
Here Integromat will just identify the updates on Telegram bot and post a tweet on twitter account of yours.
1) Create an account on Integromat by clicking the following link https://www.integromat.com and which may cost around $29 for a standard subscription per month.
2) Create a scenario on Integromat.For that follow these steps.
Click on Create New Scenario..
3)Then add Telegram bot and Twitter by searching in the search bar...and click continue.
4)Select "watch updates" and give then add your bot id there. Later click on show address and copy it to use in python code.
5) Now you will find a small bubble on to right of Telegram bot module(Add Module) click on it and select Twitter module.Then select "create tweet" option. Click on Add connection and authenticate it with your twitter account.
6)In the status field write the content you want to be posted. Then click ok.
7)Then save the scenario by clicking the save option at below.Now After Creating Scenarios go to Scenarios and press ON it would look like..
(You can refer to tutorials of Integromat on how to create scenarios at link https://www.integromat.com/en/kb/tutorials.html if you have any queries. )
Comments
Please log in or sign up to comment.