Introduction: GSM IFTTT Button
We've seen Amazon's Dash button and similar ESP8266 powered WiFi buttons that trigger things when pressed.
The downside to these buttons are that they don't work on the go, and are tied to a single network. If you want to take these outside the range of your WiFi network, they don't work.
Alternatively you could use Bluetooth enabled button like the Flic button that connects to a smart phone. However, this relies on being in within Bluetooth range and a powered phone, so it's not always useful in an emergency or in a situation where it's likely to be used by many different people, like in an outdoor installation.
We're going to create a device can trigger IFTTT by itself by sending an SMS to Twilio that then gets parsed by a PHP script that then triggers IFTTT.
This means it works anywhere where there is a phone signal is available and doesn't need to be paired with any device to work!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Parts Needed
Adafruit Fona 808 + GSM Antenna
2G Compatible SIM card
Pololu Pushbutton Power Switch LV
3.7v LiPo Battery
Soldering Iron and bits
Unfortunately the Fona, Huzzah and the Powerswitch headers come unsoldered, so you'll have to solder them yourself. This tutorial on soldering headers onto the Huzzah was super useful, and can be applied to the others.
Step 2: Create an IFTTT Account
Create an IFTTT account at ifttt.com
Connect the Maker Channel (https://ifttt.com/maker) to your account and make note of the key.
We'll come back to IFTTT later to make a recipe.
Step 3: Upload PHP Script
We are going to receive messages from Twilio and trigger IFTTT events using this PHP script.
Change the $IFTTTkey variable to your maker channel key.
You'll then need to upload it your server.
Step 4: Set Up Twilio
Create an Account
Create an account with Twilio. You'll need to create a trial account.
Once your signed in, click the 'Get your first Twilio Phone Number' button to get a phone number we can text. Once you've chosen one, go to manage numbers, and click your number to edit it.
Set Messaging URL
Scroll down to where you can change the Messaging request URL and set it to your PHP file. Now when the number receives an SMS message, it will forward it to our PHP script to handle and then call our IFTTT event.
Step 5: Assemble Device
The headers for the FONA, Huzzah and power switch module don't come pre soldered, so you'll have to do that yourself. Adafruit have a useful guide here [a link to a guide] to help you.
This version of the power switch module has awkward pins in the middle, which make placing it on a breadboard difficult. Either solder a header facing up or solder a wire directly onto it. The newer revised version has a more sensible pin layout though.
FONA (GND) -> Powerswitch (top right)
FONA (Bat) -> Powerswitch (bottom right)
Powerswitch (bottom left) -> Huzzah (VBat)
Powerswitch (top left) -> Huzzah (GND)
Powerswitch (top) -> Button
Powerswitch (top right) -> Button
Huzzah (12) -> FONA (TX)
Huzzah (14) -> FONA (RX)
Huzzah (3V) -> FONA (Vio)
Huzzah (13) -> FONA (Key)
The photos show a wire from the Huzzah GND pin to FONA Key pin but use pin 13 instead.
Huzzah (16) -> Powerswitch (left middle)
Plug in battery
Step 6: Program the Device
First of all, you'll need to set up the Huzzah for use with the Arduino IDE, using this tutorial.
Change the 'twilioNumber' variable at the top to your number from Twilio.
Write that to the Huzzah, and when it's done disconnect it from the computer
Step 7: Create an IFTTT Recipe
A good one to try first would be sending an email when pressed.
The remaining battery percent is value1.
Try experimenting with different recipes. If you are feeling adventurous, then try adding sensors and other additional inputs, reading and outputting the message into the SMSPayload.
I'll be writing a follow Instructable soon detailing how you can add location values to your events!