Eric Ely
Published © LGPL

My Mailbox Can Text!

Get a text when the mail arrives. Simple. Useful. Awesome.

BeginnerFull instructions provided30 minutes2,696
My Mailbox Can Text!

Things used in this project

Hardware components

Bluz DK
Bluz DK
×1
Bluz Battery Shield
×1
Bluz Proto Shield
×1
Bluz Gateway Shield
×1
SparkFun Magnetic Door Switch
×1
Photon
Particle Photon
×1

Software apps and online services

SMS Messaging API
Twilio SMS Messaging API

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematic

Code

Bluz Sketch

C/C++
bool sendSMS;

void publishMail()
{
  sendSMS = true;
}

void setup() {
    sendSMS = false;
    pinMode(D0, INPUT_PULLUP);
    attachInterrupt(D0, publishMail, FALLING);
}

void loop() {
    System.sleep(SLEEP_MODE_CPU);
    if (Particle.connected() && sendSMS) {
      Particle.publish("mailbox_opened");
      sendSMS = false;
    }
}

Webhook

JavaScript
{
  "eventName": "mailbox_opened",
  "url": "https://api.twilio.com/2010-04-01/Accounts/ACCOUNT_SID/Calls",
  "requestType": "POST",
  "auth": {
    "username": "ACCOUNT_SID",
    "password": "AUTH_TOKEN"
  },
  "form": {
    "From" : "FROM_TWILIO_NUMBER",
    "To" : "TO_NUMBER",
    "Body": "Mail Dude!"
  },
  "mydevices": true
}

Credits

Eric Ely

Eric Ely

9 projects • 30 followers
maker, breaker, fixer, and tinkerer. interested in building products that get technology out of the way and actually make your life easier.

Comments