Send text messages (SMS) to any registered mobile number using ESP8266 and IFTTT platform.
This project demonstrates how to send SMS messages from an ESP8266 microcontroller without requiring any additional microcontroller like Arduino or PIC. The ESP8266 is programmed directly using the Arduino IDE and leverages the IFTTT (If This Then That) platform to send text messages to predefined mobile numbers via WiFi connectivity.
Source Tutorial: Sending SMS using ESP8266 - CircuitDigest
- Standalone Operation: No additional microcontroller required
- WiFi Connectivity: Uses ESP8266's built-in WiFi capabilities
- IFTTT Integration: Leverages IFTTT platform for SMS delivery
- Programmable Messages: Send custom text messages
- Easy Configuration: Simple setup process with detailed instructions
The ESP8266 connects to your WiFi router and makes HTTPS requests to IFTTT's Maker Webhooks service. When triggered, IFTTT sends a predefined text message to your registered mobile number through their SMS service.
Concept Flow:
- ESP8266 connects to WiFi network
- Makes HTTPS GET request to IFTTT webhook URL
- IFTTT receives the trigger and executes the SMS action
- Text message is delivered to the registered mobile number
- ESP8266 Development Board (NodeMCU, Wemos D1 Mini, or similar)
- USB cable for programming
- WiFi network access
- Arduino IDE with ESP8266 board package
- IFTTT account (free)
- Mobile phone for receiving SMS
- IFTTT account with SMS applet configured
- Active WiFi internet connection
- Visit www.ifttt.com
- Sign up for a new account or log in to existing account
- Verify your email address
- Search for "SMS" or visit the SMS applet page
- Register your mobile number with country code (format: 00[country_code][mobile_number])
- Example: 00919612365489 (India: 00 + 91 + 9612365489)
- Click "Send Pin" and verify your mobile number
- Search for "Maker Webhooks" or visit this link
- Click "Connect" to enable the service
- Navigate to "My Applets" → "New Applet" or use this link
- Click on "this" (IF THIS part)
- Search and select "Maker Webhooks"
- Choose "Receive a web request" trigger
- Enter event name (e.g., "ESP") - remember this name
- Click "Create Trigger"
- Click on "that" (THEN THAT part)
- Search and select "SMS"
- Choose "Send me an SMS" action
- Enter your custom message text
- Click "Create Action"
- Review and click "Finish"
- Go to Maker Webhooks settings or use this link
- Click "Documentation"
- Note your unique API key (keep it confidential)
- Replace {event} with your event name from Step 4
- Test the URL in browser - you should receive SMS
Example URL format:
https://maker.ifttt.com/trigger/ESP/with/key/YOUR_API_KEY_HERE
- Power: Connect ESP8266 to USB for power and programming
- WiFi: No additional connections needed (built-in)
- Programming: Use USB-to-Serial converter if not using development board
- Install Arduino IDE
- Add ESP8266 board package:
- File → Preferences → Additional Board Manager URLs
- Add:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Install ESP8266 board from Board Manager
- Select your ESP8266 board model
- Select appropriate COM port
Update these lines with your WiFi network details:
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
Update the URL with your event name and API key:
String url = "/trigger/YOUR_EVENT_NAME/with/key/YOUR_API_KEY";
Example:
String url = "/trigger/ESP/with/key/b8h22xlElZvP27lrAXS3ljtBa0092_aAanYN1IXXXXX";
- Connect ESP8266 to computer via USB
- Open Arduino IDE
- Copy and paste the provided code
- Configure WiFi credentials and IFTTT URL
- Select correct board and port
- Click "Upload"
- Open Serial Monitor (115200 baud rate)
- Reset ESP8266 or power cycle
- Monitor connection status:
- WiFi connection confirmation
- IFTTT server connection
- HTTP request status
- Success message: "Congratulations! You've fired the ESP event"
- Check mobile phone for received SMS
connecting to YOUR_WIFI_NAME
....
WiFi connected
IP address: 192.168.1.xxx
connecting to maker.ifttt.com
requesting URL: /trigger/ESP/with/key/YOUR_API_KEY
request sent
headers received
reply was:
==========
Congratulations! You've fired the ESP event
==========
closing connection
- WiFi Connection: Establishes connection to local network
- HTTPS Client: Secure connection to IFTTT servers
- HTTP Request: GET request to trigger webhook
- Response Handling: Processes IFTTT response
- Serial Debugging: Provides status information
setup()
: Initializes WiFi and sends SMS triggerloop()
: Empty (single execution project)
- Create multiple IFTTT applets with different event names
- Modify code to call different URLs based on conditions
- Add sensors to trigger SMS based on environmental conditions
- Integrate with GPIO pins for hardware-based triggers
- Use IFTTT's value1, value2, value3 parameters for dynamic content
- Send sensor readings or status information in messages
- Modify loop() to send messages at specific intervals
- Add timer-based functionality
Connection Failed Error:
- Check WiFi credentials
- Verify network connectivity
- Ensure HTTPS port 443 is not blocked
Invalid Key Error:
- Verify API key from IFTTT documentation page
- Ensure URL format is correct
- Check event name matches IFTTT applet
No SMS Received:
- Verify mobile number registration in IFTTT
- Check IFTTT applet is enabled
- Test webhook URL in browser first
- Check for IFTTT service limits
WiFi Connection Issues:
- Verify SSID and password
- Check WiFi signal strength
- Try different ESP8266 board if persistent
- Always test IFTTT webhook in browser first
- Use Serial Monitor for detailed debugging
- Check IFTTT activity log for triggered events
- Verify mobile number format with country code
- IFTTT Limits: Free accounts have usage restrictions
- Single Message: Current code sends one message per power cycle
- No SMS Reception: Cannot receive or read incoming messages
- Internet Dependency: Requires active WiFi and internet connection
- Add multiple sensor inputs
- Implement message queuing system
- Create web interface for configuration
- Add support for multiple recipient numbers
- Integrate with other IFTTT services (email, notifications)
- JSON payload support for dynamic messages
- Two-way communication using other services
- Integration with home automation systems
- Battery-powered operation with deep sleep
- API Key Security: Keep IFTTT API key confidential
- Network Security: Use secure WiFi networks
- SMS Costs: Be aware of potential SMS charges through IFTTT
- Rate Limiting: Avoid excessive API calls
This project is based on the tutorial from CircuitDigest.
For questions, issues, or contributions:
- Visit the original tutorial for detailed explanations
- Check IFTTT documentation for service-related issues
- Use Arduino community forums for programming help
Note: IFTTT services and APIs may change over time. Please refer to current IFTTT documentation for the most up-to-date information.