PHONE ALERT WITH RASPBERRY PI
In this video i will show you that how you can connect your IFTTT with Raspberry Pi and whenever you bring you hand closer to the IR sensor you get a alert message on your mobile phone.
For this you need to have IFTTT app on your MOBILE PHONE.
For this you need to have IFTTT app on your MOBILE PHONE.
STEPS TO DO IT
First open your IFTTT app:-
- Then click on Make your own applets from scratch
- Click on This
- After that search and click on Webhooks
- Now click on Receive a web request
- Now enter detected in Event Name column
- Now click on That
- Search and click on Notification
- Click on Send a notification from the IFTTT app
- Now write Alert then click on insert ingredients box located at right then select OccuredAt after that write someone was in front of sensor
- Click Finish
CONNECTIONS
Raspberry Pi
5V = VCC of IR sensor
GND = GND of IR sensor
GPIO 14 = OUT of IR sensor
OPEN PYTHON ON RASPBERRY PI AND WRITE THIS CODE:-
import RPi.GPIO as IO
import requests
import time
IO.setwarnings(False)
IO.setmode(IO.BCM)
def control_lights(state):
requests.post("https://maker.ifttt.com/trigger/"+state+"/with/key/enter_your_key_here")
IO.setup(14,IO.IN)
while True:
if(IO.input(14)==True):
control_lights("nodetect")
if(IO.input(14)==False):
control_lights("detected")
time.sleep(1);
NOTE :- In the place of enter_your_key_here write the unique key you get from webhooks
TO FIND OUT HOW TO GET THE KEY FOLLOW THE STEPS BELOW :-
- GO TO THE HOME PAGE OF IFTTT APP
- NOW CLICK ON THE TOP-RIGHT AREA WHERE YOUR E-MAIL IS WRITTEN
- NOW CLICK ON My services
- After that click on Webhooks
- Now on top-right column you will see a setting icon click on it
- Here you will see a url written as user_url you only need to copy the part after use/