In this guide, we’ll show you seven different ways to send notifications with the ESP32. We’ll cover sending SMS, emails, WhatsApp messages, and Telegram messages. We’ll show you different options for each notification type.
Table of Contents
In this tutorial, we’ll cover the following notification methods:
- 1 – ESP32: Send emails using an SMTP server
- 2 – ESP32: Send emails with IFTTT
- 3 – ESP32: Send emails using a PHP server
- 4 – ESP32: Send Telegram messages (using Telegram API)
- 5 – ESP32: Send WhatsApp messages (using callmebot API)
- 6 – ESP32: Send SMS using a modem (SIM800L and SIM7000G)
- 7 – ESP32: Send SMS using Twilio API
Send Emails with the ESP32
There are different methods to send emails with the ESP32.
Our preferred method is using an SMTP server. SMTP means Simple Mail Transfer Protocol and it is an internet standard for email transmission. To send emails using an ESP32, you can connect it to an SMTP Server.
Check the following tutorial to learn how to send emails with the ESP32 using an SMTP server:
We also have a similar tutorial using MicroPython firmware:
Another alternative method is using IFTTT (If this then that). You can create an applet on IFTTT that will send you an email when you make a request to the webhooks service. If you want to experiment with this method, check the following tutorial:
You can create a PHP server that will send you emails upon an ESP32 request. You can use a cloud server or a local server on a Raspberry Pi, for example. Check the tutorial below:
Send Messages to Telegram with the ESP32
Telegram Messenger is a cloud-based instant messaging and voice-over IP service. You can easily install it on your smartphone (Android and iPhone) or computer (PC, Mac, and Linux). It is free and without any ads. Telegram allows you to create bots that you can interact with.
“Bots are third-party applications that run inside Telegram. Users can interact with bots by sending them messages, commands, and inline requests. You control your bots using HTTPS requests to Telegram Bot API“.
So, you just need to make some HTTP requests with the ESP32 to be able to send messages to your Telegram account. The ESP32 can also listen to messages that you send to your bot. So, you can also control your boards by sending messages via Telegram.
We have several tutorials showing how to use the Telegram API for different purposes:
- Telegram: ESP32 Motion Detection with Notifications
- Telegram: Control ESP32 Outputs
- Telegram Group: Control ESP32 Outputs
- ESP32 Door Status Monitor with Telegram Notifications
- Telegram: ESP32-CAM Take and Send Photo
Send Messages to WhatsApp with the ESP32
“WhatsApp Messenger, or simply WhatsApp, is an internationally available American freeware, cross-platform centralized instant messaging and voice-over-IP service owned by Meta Platforms.” It allows you to send messages using your phone’s internet connection, so you can avoid SMS fees.
There are different ways to send messages to WhatsApp using the ESP32. We’ve experimented with the callmebot API and it worked pretty well. You can check our tutorial that explains how to send messages to WhatsApp with the ESP32:
We also have an example using MicroPython firmware:
Send an SMS with the ESP32
To send SMS with the ESP32, you can connect it to a modem and use a SIM card or use a third-party service.
There are several modules for the ESP32 that allow you to connect a SIM card. There are also ESP32 development boards that come with a built-in modem like the SIM800L or SIM7000G. To send SMS with these modules, you need a SIM card with an SMS plan or credit.
We have tutorials showing how to send SMS with the ESP32 SIM800L and ESP32 SIM7000G. Check them below:
- ESP32 SIM800L: Send Text Messages (SMS Alert) with Sensor Readings
- LILYGO T-SIM7000G ESP32: Send SMS
Another alternative is to use a third-party service that will send the SMS for you. You just need to make HTTP requests to their API to use their services. We have a tutorial showing how to send SMS with the ESP32 using Twilio services (these are not free, but they provide you with some credit so that you can experiment with the service).
In this article, we’ve shown you different ways to send notifications with the ESP32. We’ve covered sending emails, messages to Telegram, messages to WhatsApp, and SMS.
Sending notifications with the ESP32 is a very useful feature. For example, to send an alert when motion is detected, when a sensor is above or below a certain threshold value, or to send you messages periodically with sensor values or GPIO states.
We hope you’ve found this compilation useful.
Learn more about the ESP32 with our resources:
- Learn ESP32 with Arduino IDE
- Build Web Servers with ESP32 and ESP8266
- Firebase Web App with ESP32 and ESP8266
- Free ESP32 Projects and Tutorials
Thanks for reading.