Group Text Message Button (SMS)




Introduction: Group Text Message Button (SMS)

About: Experience Designer

News Team Assemmmmbbbllle!!!

Hit a button and send a group mass text message. You can have it randomize through different messages and have the recipient's name right in the SMS too.

This tut is a Build, Build, Build style tut... You should have everything you need here to get it to work minus why it is working. To know why it is working the way it is, you'll have to dig deeper.
e.g. The role of the resistor... You won't find that here.

This uses:

  1. Particle - A WiFi Connected Arduino-like microcontroller - $19.00
  2. Parse cloud computing - The brains (Backend as a Service (BaaS)) - FREE (Limited)
  3. Twilio - The SMS sender - FREE (Limited)

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Prep

Prepare because road bumps can hamper your flow...
In this step, you should already have purchased and received your Particle Photon.

Prep. A - Computer tools :: Programs/Software that you'll need

Prep. B - Physical tools :: Bare minimum to get the button functioning

Prep. C - Accounts :: Sign-up/Open these free accounts

Prep. D - Particle smartphone App

Step 2: Get the Keys, Credentials, and Pertinent Info... Keep It Handy.

Get this account info/credentials and paste it into a non-formatted document, we'll call it NOTES.rtf, you'll need this in coding parts coming up later:


API Credentials (Found here: > Settings > Keys)

  1. Application ID
  2. REST API Key


API Credentials (Found here: Getting Started Page - Show API Credentials)

  1. AccountSID
  2. AuthToken


  1. Device Credential (Found here: Device ID (aka coreID)

You have to claim your device before you can get the Device ID this is in the next step =>

Step 3: Particle - 1 of 4 :: Photon to WiFi

The Particle Photon is the IoT device with built-in WiFi. It is like a mini Arduino that connects to the internet and has a web based IDE for writing code into it wirelessly. Claiming your Photon and connecting it to the WiFi can be done with your smartphone very quickly.

The instructions for connecting it and all the troubleshooting already exist. Instead of rewriting it all here, we'll just link you there and wait for you here.

  1. Connecting your Photon instructions (You'll only seed steps 1 and 2 in those instructions)

Now write your Device Credentials into your NOTES.rtf
(Found here: Device ID (aka coreID)

Step 4: Particle - 2 of 4 :: Button Hardware

Put your electronic together using this schematics image above.

Pop your Particle Photon (w/Headers), button, and resistor onto the breadboard as shown on the image. Place your jumper wires as shown. Power it up with your micro USB cable connected to your computer.

Notes: Make sure your momentary push button is connected properly. The button has four header pins but it's really just like a two pin button (see image)

Step 5: Particle - 3 of 4 :: Button Sketch

Your Photon button's light should be "Breathing cyan" indicating that it is connected to the internet.

Now we can use the Particle Build online IDE to upload a sketch to it.
This link is a quick pass at how to 'Flash' your app/sketch

The sketch/app:

static int button1 = A5; // Button signal
int led1 = D7; // Onboard LED for a button press feedback int prevState = 0;

void setup() { pinMode(button1, INPUT); pinMode(led1, OUTPUT);

Serial.begin(9600); }

void loop() { int currState = digitalRead(button1); if (currState == 0 && prevState == 1) { digitalWrite(led1, HIGH);

Serial.println("Photon button pressed!"); Spark.publish("myHook01"); // Calls the webhook living in Particle's cloud to talk to the Parse cloud delay(1000); } digitalWrite(led1, LOW); prevState = currState; }

Note:: Line: "Spark.publish("myHook01")"... myHook01 is case sensitive and will be the name of your webhook. We'll get to this later.

Flash this sketch into your Particle Photon

Step 6: Parse - 1 of 3 :: CLI

BeforeParticle 4 of 4 - Creating a webhookwe need to set up the Parse App

(node.js should be installed at this point)

Using Terminal we need to install the Parse CLI, login, and create an app.

  1. Using Terminal navigate to the directory where you want your project to live
  2. Install the CLI <= Follow these steps to create your app. Name your app SMSbutton
  3. Confirm the files were created in the directory Terminal is pointing to

The directory structure should look like the image. Instead of it saying 'myapp' it should say 'SMSbutton'. Now find the file: cloud > main.js. ...

Step 7: Parse - 2 of 3 :: App/Sketch

You've found the file main.js now delete everything inside of it and replace it with:


var r_text = new Array (); r_text[0] = "Random message text here."; r_text[1] = "Random message text here."; r_text[2] = "Random message text here."; r_text[3] = "Random message text here."; r_text[4] = "Random message text here."; var i = Math.floor(5*Math.random())

// "myHook01_function" is what is triggered by the Particle webhook

Parse.Cloud.define("myHook01", function(request, response) { SMS.sendMessage({ success: function() { response.success("Eureka!"); }, error: function() { response.error("¬°akeruE"); } }); });

// SMS

// make an associative array of people we know, indexed by phone number var people = [ ["+12341234567","Name1"], ["+12341234567","Name2"], ["+12341234567","Name3"], ["+12341234567","Name4"], ["+12341234567","Name5"] ];

var counter = 0;

var SMS = { sendMessage: function(response) {

people.forEach(function(person) { twilio.sms.messages.create({ to: person[0], from: "+12341234567", //Twilio number body: "Hey " + person[1] + "! " + r_text[i] + " #SMSbutton" }, function(error, msg) { if (error) { console.log(error); // callback.error(); } else { counter++; if (counter >= people.length) { response.success(); } } }); }

)} };

Donezo... Let's send it to the cloud.

Step 8: Parse - 3 of 3 :: App/Sketch Upload

Those changes are made locally. Now upload them to the Parse cloud using Terminal.

1. Make sure Terminal is pointing the Parse project directory i.e. SMSbutton that you created in Step 6

2. Run the Terminal command:

$ parse deploy

The Parse App SMSbutton is now waiting in the cloud for the Particle webhook to trigger the function inside of it.

Step 9: Particle - 4 of 4 :: Particle Webhook

Let's make a webhook that will live in the Particle Cloud.

  1. You'll need to install the Particle CLI
$ npm install -g particle-cli
$ particle cloud login

2. With Sublime text make a json file. 'File' > 'New'.

This code will live in there:

"event": "myHook01", "url": "", "coreID": "1a345f24534513833a8", "requestType": "POST", "headers": { "X-Parse-Application-Id" : "ZH4DVsxe60j32tIHCUWpKisrGLHZGPmYW8Asz6SW", "X-Parse-REST-API-Key" : "X2C2DQ8QWRyxR3Ju2snwY10KeLNMptHktNHXYqIn", "Content-Type" : "application/json" }, "query": null, "json": null, "auth": null, "mydevices": true }

'Save As' rename to myHook01.json and save it in your Parse App folder since terminal is already pointing there.

3. If Terminal is pointing to the folder where the file you just created lives it is time to run the command to create the webhook in the Particle Cloud

$ particle webhook create myHook01.json

The JSON file HAS to be in the older your Terminal is pointing to.

Step 10: Twilio

Twilio setup basics

When looking at your admin console this is where you find the things you'll need:

  • Get your first Twilio phone number on the 'Getting Started Page' - Enable SMS/MMS
  • Getting Started Page - Show API Credentials
  • Verified Caller IDs - The numbers you want to send to (Free version requires verification)

Step 11: Hit the Button

Start sending text messages

1 Person Made This Project!


  • Backyard Contest

    Backyard Contest
  • Silly Hats Speed Challenge

    Silly Hats Speed Challenge
  • Finish It Already Speed Challenge

    Finish It Already Speed Challenge

8 Discussions


4 years ago

This is cool, but didn't Parse get shut down?


Reply 4 years ago

Not yet, but it's getting there. Jan. 28th 2017. Then we'll have to adapt this to another service. Meanwhile waiting to see what pops up. Maybe Facebook makes a free version that they host? Maybe another company does?


4 years ago

Very useful Project, I could maybe modify it to make it spontaneously order my favorite pizzas :D


Reply 4 years ago

Oh totally... And also have it simultaneously message your friends for a pizza party.

Idea: Pizza Party Button :D


4 years ago

My first thought on seeing the big red button is that this would be an excellent tool for the elderly or inferm. Program in the numbers for their caretakers and if there was a problem, all of them are sent a message that assistance is needed. If the system could handle it, smaking the button several times would indicate an emergency, but even if it couldn't, getting several text messages in a row could be understood to be an emergency.


Reply 4 years ago

That is a great idea.
This button can be extended to so many cool things.


4 years ago

This really shows what the particle can do. Yesterday I also made an onstructable with the Photon!


Reply 4 years ago

Very cool. I just checked it out. I like :)