ESP32 - send a push notification from the Arduino ESP32 device to your phone

Sending a push notification to your phone from an event from an ESP32 is simple.

What you'll need (if you are using a Mac for development):

Arduino IDE

Arduino for ESP32

Serial port simulator for ESP32 to upload your code to the board

Wifi network

IFTTT account

IFTTT app on your phone

Wifi network that your ESP32 board can access


Create an IFTTT applet

This should read something like this:

If Maker Event "notification", then Send a notification from the IFTTT app

Change the notification template

Go to the settings of your new IFTTT applet and change the template to include "Value1", like this:

Get your Webhook endpoint in IFTTT

On your applet, click the triangle looking thing (webhook), then Settings, or simply go to this URL 

Visit the private URL in your browser, replace the trigger name with "notification", so it reads like


and in the Value1 field type in a test message. Click "Test it" and your phone should receive the push.

Code to put on your ESP32 - Arduino

The following code will send a POST request to IFTTT to trigger a message. Replace the values from the previous settings page.

#include <WiFi.h>
#include <HTTPClient.h>

const char* ssid = "YOUR WIFI NETWORK NAME";
const char* password = "YOUR WIFI PASSWORD";

//Your IFTTT webhook private address
const char* serverName = "";

const int BUTTON_PIN = 0;
const int LED_PIN = 2;

void setup() {

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
  Serial.print("Connected to WiFi network with IP Address: ");

void loop() {
  //Send an HTTP POST request on button press
  if (WiFi.status() == WL_CONNECTED) {
    if (digitalRead(BUTTON_PIN) == LOW)
      while (digitalRead(BUTTON_PIN) == LOW)
        ; // Wait for button to be released
      HTTPClient http;


      http.addHeader("Content-Type", "application/json");
      String httpRequestData = "{\"value1\":\"YOUR MESSAGE GOES HERE\"}";
      int httpResponseCode = http.POST(httpRequestData);

      Serial.print("HTTP Response code: ");

  else {
    Serial.println("WiFi Disconnected");
  lastTime = millis();


Popular posts from this blog

MurMurHash3, an ultra fast hash algorithm for C# / .NET

Octoprint as a systemd service - running it with high priority