Hardware components
  • Arduino UNO & Genuino UNO
  • PHPoC WiFi Shield for Arduino
  • Pushbutton



Demonstration






How It Works

We take advantage of IFTTT's VoIP (Voice Over IP) services to make sound notification on smart phone

When button is pressed, Arduino makes an HTTP request to WebHook of IFTTT, IFTTT makes a VoIP call to IFTTT app installed in smart phone.


Wiring Diagram
Click image for larger version  Name:	20191216_173810.jpg Views:	1 Size:	935.2 KB ID:	1711




How To

1. Login to IFTTT website and Create IFTTT applet (Webhook + VoIP call)
Follow the instruction in gif image
Click image for larger version  Name:	ezgif.com-video-to-gif.gif Views:	2 Size:	779.2 KB ID:	1710

2. Install IFTTT app in smart phone and login with the same account as above



3. Get IFTTT webhook key

Go to https://ifttt.com/maker_webhooks, click "Documentation", you will see the webhook key. Copy the webhook key and put in the Arduino code.

4. Install PHPoC and button library for Arduino

5. Run Arduino code, press button and see the phone call in your phone
Code:
 #include <Phpoc.h>
#include <ezButton.h>

String IFTTT_WEBHOOKS_KEY = "xxxxxxxxxxxxxxxxxxxxxx"; // change your webhooks key here
char server_name[] = "maker.ifttt.com";

PhpocClient client;
ezButton button(7);  // create Button object that attach to pin 7;

void sendNotification()
{
  // connect to web server on port 443:
  if(client.connectSSL(server_name, 443)) {
    // if connected:
    Serial.println("Connected to server");

    // make a HTTP request:
    client.println("GET /trigger/button/with/key/" + IFTTT_WEBHOOKS_KEY + " HTTP/1.1");
    client.println("Host: maker.ifttt.com");
    client.println("Connection: close");
    client.println();
  }

  while(client.connected()) {
    if(client.available()) {
      char c = client.read();
      Serial.write(c);
    }
  }

  Serial.println();
  Serial.println("disconnecting from server.");
  client.stop();
}

void setup() {
  Serial.begin(9600);

  // initialize PHPoC [WiFi] Shield:
  Phpoc.begin(PF_LOG_SPI | PF_LOG_NET);

  button.setDebounceTime(100); // set debounce time to 100 milliseconds
}

void loop() {
  button.loop(); // MUST call the loop() function first

  if(button.isPressed()) { 
    Serial.println("sending notification");
    sendNotification();
  }
}