Imagine you were not at home and your door was locked suddenly some intruder comes and tries to open the door and enters the room, then he just takes away everything from the house, how would it be if you are informed about someone entering the room immediately, then you can alert immediately and take necessary precautions.
Why Chosen Bolt as a Platform ?
I have chosen bolt wifi module for this project because I found that out of all the iot platforms we have bolt iot platform has made work very easier and its easy to implement things . I really felt using bolt iot platform its very easy to implement my task .Thank you , Bolt .
This is my first project on Hackster.io so would love to know your feedback and suggestions about this project.
This project is based on the Bolt IoT Platform. You can get a Bolt WiFi Module and Cloud with Lifetime Access on Amazon.
Before we go on to what to do to accomplish this project, I would like to tell You what this Project does...
If an intruder enters the room, our body as it produces some sort of IR radiations, the PIR sensor being sensitive to this radiations outputs 1 indicates some intruder entered your house, then this output 1 glows up The LED and switches on the buzzer for 10 sec and then The owner of the house will get notified through a message and Email and also it will be posted to twitter that "Some intruder has entered the room at TIME " and also to Facebook the same post will be posted so that our family members can also be informed about the intruder's entry into the home.
Here the Python Script checks the output of PIR Sensor sent to the Bolt device from the Bolt Cloud for every 5 sec and if The PIR Sensor outputs 1 then it switches on The LED and BUZZER and put them on for 5 sec and during that time it requests the Twillio API to send message to your phone number and requests the MailGun API to send notification that some intruder entered your room to your E-mail and also posts a tweet on Twitter and post on facebook(this is done by Integromat) notifying our family members about Intruder entrance into the room.
Led and Buzzer:
All the above actions have been taken place after I take my hand above the pir sensor which detects some motion and outputs 1 to the bolt wifi module.
This is the working video..
(Here we can inform even the Police about intruder entrance by replacing the TO_NUMBER with police number in python Script).
Doesn't it sound Interesting ????.....Now Let's know step by step what to do to accomplish our project:
1.Creating an account on the IOT cloud service(if you already have an account you can just skip to the next step)
Step 1: Open www.cloud.boltiot.com on your web browser
Step 2: Click on "SignUp” and Enter your details and press register
Step 3: You will be receiving a confirmation mail, confirm your mail by opening your mail and clicking on confirm mail button.
Step 4: After finishing Step-4 you can login to your cloud account and it will be showing the below page.(On clicking Get Started)
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...
After linking your bolt device to cloud your bolt app page would be looking like,
Step 1: Take the PIR Sensor and connect its 3 pins to Jumping wires, I will show the circuit how to connect and later also show how will it look after connecting.
Connect the output of PIR sensor to the pin '0' of the bolt iot module.
and connect the VCC of PIR Sensor to 5V supply of bolt iot module.
and connect the GND of PIR Sensor to GND of bolt iot module.
Step 2: Take the LED and Buzzer and give them appropriate connections as shown in the figure so that they get switched on when volatge at pin '1' is HIGH and get switched off when voltage at pin '2' is LOW.
The total Circuitry connection is given in the Hardware Connections
(Due to lack of proper resources I drew the circuit connection)
Step-1: Create an account on twitter.
Step-2: Apply for the developer access at https://developer.twitter.com/en/apply-for-access.html and Fill in the details with the proper requirement why do you want to create the Twitter account and for what purpose you are going to use it.
Step-3: After getting access to developer, Then on the top right corner you can find your user handle of twitter, click on it and click on App, Create an App, give the details appropriately and in the website url give https://boltiot.com/ and in description give how this app will be helpful for you for us in our project this app help in.. tweeting to our account timeline every time the pir sensor has detected the intruder. Then After entering the details click on Create an App. Then the page will display as...
Go to Keys and tokens and copy all the credential details of API Key, API Secret Key, Access token and Access Secret Token which will be utilized later.
Twilio 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 product as SMS, 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, phone numbers by ticking on the radio buttons
create a project by giving appropriate name
Then after creation of project you can go to dash board
Click on project info
Copy the ACCOUNT SID and AUTH TOKEN to your notepad
Then From the drop-down menu
You can follow the images below and understand clearly.
choose "Programmable SMS". Now click on Get Started
Then click on Get a Number button to generate phone number. Save that phone number for later use. It is YOUR_NUMBER
Similarly create an account on mailgun at https://www.mailgun.com/
(Mailgun is an Email automation service. It has a very powerful set of inbuilt functions for sending emails. Developers can process their email with the help of Mailgun API)
After the verification of mobile number
go to domains
press Add Recipients
then press Invite New Recipients
press the email id and authenticate it
After verification click on the domain name you will be redirected to the following page..
save the credentials like MAILGUN_API_KEY, SANDBOX_URL, remember in coding sender mail has to be written as test@SANDBOX_URL.
Here Integromat will just identify the tweets on Twitter and post the same on to a Facebook page.
Step-1: Create an account on Integromat by clcking the following link https://www.integromat.com and which may cost around $29 for a standard subscription per month.
Step-2: Create scenario on Integromat that detects any tweet on twitter and posts on facebook. For this follow the below steps:
Click on Create New Scenario..
Then add Facebook Pages and Twitter by searching in the search bar...and click continue
Click on the question mark and select twitter..
Then you get displayed the following:
Select Watch Tweet, Click on Add connection and authenticate it with your twitter account then click ok then
click To start From Now on and click ok.
You can find a small bubble on to right of Twitter Module (Add Module) click it and select Facebook pages and select Create a post.It displays the following:
Then click on add and authenticate with your facebook account and on page select the page that you have created on Facebook and on message click the Text as shown in below figure
After Selecting Text click OK and 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. )
After creation of Scenario it would look like..here you have to select the modules as twitter and Facebook.Please refer the tutorials page to know how to create scenario if you have any queries. (Here you have to create a Facebook page and link it to the Facebook module in the scenario you created )(In this page the intruder notification occurs)
Then save it and go to your scenarios and find your scenario and switch it on.
Step-1: Go to cloud.boltiot.com and sign in into your account
Go to Devices option in Left Vertical Menu Bar...and copy your device id..
Left side you can find the API on the vertical menu bar. Select it you will be redirected to..
Click on Enable
Then Click on the copy Button so as to get your API KEY save it to notepad for later use.
That's it now we are just away by one step to complete our project we have to write the python code..
Save your python code by name proj.py
Run it ...(Before Running it you have to switch on the BOLT wifi module)
That's it your Intruder Notification System is Ready. Now Switch on your Bolt Wifi module by powering it up and you can get notified if some intruder enters your room when you are not at home.