Built on Bolt : Smart Alerts Via Social Media Using Proximity Sensor
1267 Views, 5 Favorites, 0 Comments
Built on Bolt : Smart Alerts Via Social Media Using Proximity Sensor
![logom.png](/proxy/?url=https://content.instructables.com/FR9/R7NI/J4SQED57/FR9R7NIJ4SQED57.png&filename=logom.png)
This project is made on the BOLT IOT (Internet of Things) platform .
Wont it be amazing if all our day to day things like a door or a chair could send us notifications about some event taking place ?
This may sound absurd but it is possible !
For this project we will need the BOLT IOT kit and an account in the IFTTT site (https://ifttt.com).
IFTTT is a free web-based service that people use to create chains of simple conditional statements, called applets. An applet is triggered by changes that occur within other web services such as Gmail, Facebook.
We will make use of the proximity sensor that is available in the bolt iot kit. We will connect it to our bolt board and whenever we move our hand over the sensor we would receive a notification in our mail.
Uses : - It can be used as a thief detector ! The proximity sensor can be replaced by some other sensor and we can then use it for some other purpose.
To execute this we need to follow some steps.
Configure BOLT
![WP_20170710_001 (2).jpg](/proxy/?url=https://content.instructables.com/FHC/GN4V/J4SQEGFV/FHCGN4VJ4SQEGFV.jpg&filename=WP_20170710_001 (2).jpg)
![wifi.png](/proxy/?url=https://content.instructables.com/FQW/XXS4/J4SQENSQ/FQWXXS4J4SQENSQ.png&filename=wifi.png)
BOLT Hotspot
First connect the BOLT to a Wi-Fi network.
- The BOLT creates its own hotspot when you power it on for the first time using a 5V USB power adapter.
- The name of the hotspot is BOLT followed by its ID.
- Download NetPlug App from playstore.
- Now switch on your BOLT.
- First time it will create its own Wi-Fi hotspot.
- Connect your mobile Wi-Fi to BOLT hotspot.
- Open NetPlug app and click on the BOLT icon.
- Then click on configure button and it will take you to the BOLT setting page where u have to put the details of the Wi-Fi network to which you want to connect your BOLT.
- Click on save and restart.
- Now BOLT will restart and try to connect to the Wi-Fi network.
- If BOLT is properly connected then the blue light will stop blinking and it becomes stable.
- Now we have to find the IP address of the BOLT.
- Advanced IP Scanner can be used to do that.
Setting Up Proximity Sensor
![app1.png](/proxy/?url=https://content.instructables.com/F2M/H2NU/J44FS9FI/F2MH2NUJ44FS9FI.png&filename=app1.png)
![WP_20170710_013.jpg](/proxy/?url=https://content.instructables.com/FI3/OFWF/J4SQGLMR/FI3OFWFJ4SQGLMR.jpg&filename=WP_20170710_013.jpg)
![WP_20170710_014.jpg](/proxy/?url=https://content.instructables.com/FOK/X1PN/J4SQGLZJ/FOKX1PNJ4SQGLZJ.jpg&filename=WP_20170710_014.jpg)
Interfacing Proximity Sensor (IR Sensor)
A proximity sensor is used to detect whether an obstacle is present in front of it.
The sensor emits IR light and gives a signal when it detects the reflected light. An IR sensor consists of an emitter, detector, and associated circuitry.
The circuit required making an IR sensor consists of two parts: the emitter circuit and the receiver circuit.
The emitter is simply an IR LED (Light Emitting Diode) and the detector is simply an IR photodiode which is sensitive to IR light of the same wavelength as that emitted by the IR LED.
When IR light falls on the photodiode, its resistance and correspondingly, its output voltage, change in proportion to the magnitude of the IR light received.
This is the underlying principle of working of the IR sensor. It provides HIGH(5V), which is represented as logical 1 when there is no obstacle in front of it and it provides LOW(0V), which is represented as logical 0 when there is an obstacle in front of it.
The sensor has three pins:
1.Vcc Pin
2.Output Pin
3.GND Pin
Vcc and GND pins are used to provide power to the sensor.
The output pin is the pin which provides the sensor output.
Steps for connection : -
- Connect Vcc of the sensor to 5V Pin
- Connect GND to GND pin of BOLT.
- Connect output pin to the GPIO on which you monitor to sensor data
- Let us connect output pin to GPIO-4.
- Now if you take your hand near the sensor you will see a red light glowing up indicating obstacle detected.
BOLT With IFTTT
![app1.png](/proxy/?url=https://content.instructables.com/FL1/1XV1/J44FQ53I/FL11XV1J44FQ53I.png&filename=app1.png)
![app2.png](/proxy/?url=https://content.instructables.com/F4Y/AUFY/J44FQ5AH/F4YAUFYJ44FQ5AH.png&filename=app2.png)
![app3.png](/proxy/?url=https://content.instructables.com/FAW/W41X/J44FQ5AJ/FAWW41XJ44FQ5AJ.png&filename=app3.png)
![app4.png](/proxy/?url=https://content.instructables.com/F7G/2EE9/J44FQ5PH/F7G2EE9J44FQ5PH.png&filename=app4.png)
![app5.png](/proxy/?url=https://content.instructables.com/FOA/38RI/J44FQ5PP/FOA38RIJ44FQ5PP.png&filename=app5.png)
![app6.png](/proxy/?url=https://content.instructables.com/F83/HVNC/J44FQ71P/F83HVNCJ44FQ71P.png&filename=app6.png)
![app2.png](/proxy/?url=https://content.instructables.com/F72/3LEJ/J44FSCY5/F723LEJJ44FSCY5.png&filename=app2.png)
Make an account in the IFTTT site (https://ifttt.com/).
- Create a new applet. After clicking on new applet Click on 'this ' icon for choosing input.
- Now search for maker and after getting search results , click on Maker icon. Images has been uploaded for reference.
- Next step is to choose and create the Trigger.
- After that we have to choose the output. Click on that for choosing the output of the event ! The output is nothing but the action that will take place.
- Here we have to select Action Service which could be either Facebook , Gmail , Twitter etc.
- We will be using Gmail for this project . After clicking on Gmail we need to specify the action .
- For the Action part we have to enter the gmail address where we want the mail to be sent .
- Next job is to find our key !
- Go back to the home page of the IFTTT site and click on search and search for maker channel again.
- After finding the maker channel click on Documentation where you will find your unique key.
- Copy this key in some place because we are going to need it later.
Code and Execute !
![logo1.png](/proxy/?url=https://content.instructables.com/FOV/IAAF/J4SQEGTE/FOVIAAFJ4SQEGTE.png&filename=logo1.png)
![file.png](/proxy/?url=https://content.instructables.com/FM3/Y0Q7/J4SQEP3W/FM3Y0Q7J4SQEP3W.png&filename=file.png)
After connecting the proximity sensor we have to write the necessary code and upload it on BOLT .
The next step is to write HTML code.
- Open notepad, type the code that I have attached (indexpage.txt) here and upload it on BOLT.
- Save the filename as "index.htm".
- Now its time to test it !
- For this purpose we have to use the key that we have got through the IFTTT site .
- If you have not copied the key then you can again open you IFTTT account and then go to the maker service and click on DOCUMENTATION where you can find the key .
- Once you have done this , the next thing that you need to do is to simply fill up the boxes of your index.htm file .
- You have to use your BOLT IP address to go the index page . Open Chrome web browser and type the IP Address of BOLT that you got from the Advanced IP Scanner .
- Then enter the pin number in which your proximity sensor's output pin is connected which is 4 in our case.
- Then enter the state of the proximity sensor which will trigger the event e.g. 1 is for high and 0 is for low.
- Then finally we have to enable the IFTTT so enter 1 in the last box .
- After all this is done click on the submit button and move your hand over the proximity sensor and check your email and you will see that you have received a mail regarding the event .
Downloads
Check Gmail
![mail.png](/proxy/?url=https://content.instructables.com/FF6/KYS1/J4SQEIRV/FF6KYS1J4SQEIRV.png&filename=mail.png)
This is the easiest step of all .
Open your Gmail account to see the mail that you have received regarding the event that took place.