Getting iPhone push notifications from objects in your physical world is possible using an Arduino with an Ethernet Shield, a PHP-enabled web server and an iPhone app called Prowl. In this video, I show how to set up a mailbox so that it pings your phone when snail mail is delivered, but it’s very easy to adapt this project to whatever suits your needs.

Prowl is an iPhone app with the sole purpose of delivering push notifications to you from your computer via Growl or from online services with the API. In order to connect the Arduino to Prowl’s API, we need a PHP proxy server. This is because Prowl’s API requires an SSL connection, which the Arduino isn’t capable of making. Luckily, setting up the server is easy because all of the hard work has already been done by the fine people behind the ProwlPHP class. All you need to do is paste your Prowl API key into the example code and change the example text to the alert that you want to send. When your Arduino requests the URL of that example script from your web server, the alert is pushed to your phone almost instantaneously.

For the code on the Arduino, I simply adapted the WebClient example that’s included with the Arduino IDE. I changed the server address, the URL, and the basic structure of the code so that it requested our ProwlPHP script’s URL when it sensed a “high” signal from the switch. I also added serial output for debugging. You can check out the code I used for this project on Google Code or just download the Zip file.

There are a lot of great uses for this project. You could have push alerts delivered to your iPhone when you leave your garage door open, when someone opens your front gate, when the temperature drops below freezing, or when your home power usage exceeds a certain level. Whatever kind of switch or sensor you can hook up to your microprocessor can trigger a push alert. I’m eager to see how you decide to implement iPhone push alerts into your projects.

Subscribe to the MAKE Podcast in iTunes, download the m4v video directly, or watch it on YouTube and Vimeo.

More:

Ask MAKE: Pull-up resistor

In the Maker Shed:

Makershedsmall

Arduino Family

Make: Arduino

Matt Richardson

Matt Richardson

Matt Richardson is a San Francisco-based creative technologist and Contributing Editor at MAKE. He’s the co-author of Getting Started with Raspberry Pi and the author of Getting Started with BeagleBone.


  • rolandojones

    I think this is an awesome project, but it needs Wi-Fi. It’s not very realistic to string CAT-5 across your lawn to connect the Arduino to the Internet.

    I haven’t tried it yet, but a YellowJacket Wi-Fi shield sounds like a good solution.

    How come there aren’t more/easier WiFi arduino shields out there?

    • Collin Cunningham

      good question – I remember reading something about the chip on the WiShield requiring some special proprietary/closed code to be DLed/installed from the manufacturer’s site – might be discouraging for open source oriented devs (?)

    • Marc de Vinck
    • Matt Richardson

      Certainly for some people running cable from the mailbox to the home isn’t practical. But I recommend keeping the Arduino in the home and just running some two conductor insulated wire from the mailbox switch into the house. A wireless solution like Xbee or Wifi would be awesome, but would require power somehow.

    • bld

      For mine I am using a commercial product to do the wireless stuff.

      I did a search on ebay, and found a few that should be possible to hack into http://shop.ebay.co.uk/i.html?_nkw=mailbox+alert

      I am using something like that for mine too http://bld.is-a-geek.com/2011/01/02/snail-mail-notifier/ and using a 2N2222 transistor to ‘press’ the reset button. And was able to find a 5V pulse for the LED that flashes when the transmitter in the mailbox is activated.

    • Kevin

      HI! I have found a page that you can buy a mail alerter kit you build your self, check it out onhttp://diymail.webs.com

  • buddyhollyclone

    i’ve got a similar setup for my doorbell, except my arduino+ethernet sends a twitter direct message (through NeoCat’s twitter library) which is pushed to me via the iPhone app “Chirpy” within about 5 seconds. the benefit of this approach is that i don’t need my own php server, just twitter’s service.

    • Matt Richardson

      What a great idea to use Twitter. I was trying to find a way to make it “cross platform” by using an SMS gateway, but most charged services an arm and a leg for access to their SMS API. A twitter DM triggers an SMS to me, so that would have been a great way to do it. Thanks for the suggestion!

      • Marc de Vinck

        I did something very similar with my Kitty Twitty project. (basically a switch that Twitters)

        http://makezine.com/22/kittytwitty/

        There are a few issues using Twitter (and the new authentication) but there are ways to work around it.

        FYI – Great job on the video, and build, looking forward to many more!!!

  • Collin Cunningham

    forgot to say – great vid, Matt!

    • Matt Richardson

      Thank you! And thank you for the awesome music!

  • Pete Prodoehl

    Notifo may be another alternative to Prowl. Their iPhone app is free, and you can use their API for free as well (within limits which are high enough for any personal projects.)

    supertweet.net is another site to check out, since their tagline is “helping things that tweet” and you can use HTTP rather than HTTPS.

    • Matt Richardson

      Hey Pete! Thanks for the info about Notifio. Their site says that Android and Blackberry versions of their client are in development, which would be great for making this project useful for people with those types of phones. If only the API didn’t require SSL, it would be perfect!

      Supertweet.net is great too. For a project I’m working on now, I thought I was going to have to “roll my own” twitter API proxy server, but I think this will help me out a lot.

  • bld

    Hi, I found this great video, and wanted to do something similar to my new mailbox before putting it up.

    Only downside is that my mailbox would require around 30m of wire, to reach out to the switch.

    Instead I took one of the already made wireless mail notifier, and hacked into it instead.

    So now I got the wireless notifier connected to my arduino, and my snail mail notifier is wireless :)

    Here is how I did it: http://bld.is-a-geek.com/2011/01/02/snail-mail-notifier/

    • bld

      Just updated the arduino sketch for my project.

      Added debounce, so it will only send maximum one message pr. 30th second, and using interrupt instead of the loop checking if the ping is HIGH.

      • Matt Richardson

        I’m glad you liked the project, and thank you for sharing how you’ve extended it!

  • DIDAMEDIA

    Sorry I paid more attention to the video quality than the content. Really nice video was it shot on a DSLR? Possibly a Canon 5D Mk2 or 7D?

    Cheers,

    Frank
    DIDA MEDIA
    http://www.didamedia.com/

    • Matt Richardson

      Thank you! Yep, you’re absolutely right: I shot this video on a 5D Mark II.

  • 3leftturns

    This is very cool, but what is the mailman going to think when there are wires and circuit boards all over the mailbox? This project may go the right way for having the bomb squad blow up your MB and consequently, your project.

  • one2one

    1 – Thanks for the post
    2- You can setup and wireless network with cheap RF modules. ($5 receiver an sender)
    3 – with the sensor network your can scale the sensor network easier
    4 – use an online platform/service to set policies and the respective matching action

    I did a similar experience before :
    http://middlewaresensing.wordpress.com/2010/05/12/intelligent-mail-box/

    Here is the platform i use:
    http://dev.hci.uma.pt/sawa/
    http://hci.uma.pt/wiki/index.php/File:Services.png

  • bld

    I have just “finished” a project where you can send messages to multiple platforms.

    With just one call to an url, you can send a free push message to iPhone and Android phones, send an email, or send a message to growl.

    I am working on getting the twitter to work with OAuth too, and when it is stable, it will go into the system too.

    It is possible to select what you want to send the message to, and even create multiple messages with different content in, and individual selection of how you want to get notified.

    And even better, my system can be called directly from an arduino, because it doesn’t use https, the arduino just calls a normal http url, and my server then takes care of the https with the different services you want to use for notification.

    The project is still in beta, and I am looking for some beta testers. :)

    And best of all… It is totally free to use. :)

    If you are interested, please send me an email http://captain-slow.dk/contact-me/

  • Anonymous

    Any way to do this with an android phone?

    • http://mattrichardson.com/ Matt Richardson

      You could use a text messaging gateway such as Twilio.

  • Anonymous

    hey is there any code out there that just sends an email from the arduino an am not really an expert in programming yet but am looking to the the same thing only send an email unless it is easier to send a text. just looking for some help

  • http://twitter.com/danst0 danst0

    I just finished a wireless version of this project (German: http://danst0.com, Google Translate: http://translate.google.de/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=de&tl=en&u=http%3A%2F%2Fdanst0.com ). Using a wireless doorbell, Arduino Mini, Growl and Prowl.

  • http://myfreeweb.ru/ MyFreeWeb

    Why PHP? Try Node.js. And the Prowl API doesn’t require SSL anymore. You can remove the proxy part and notify directly from the Arduino.

    • http://www.facebook.com/StevenTisseyre Steven Tisseyre

      Do you have an example of this you can share please.

      Many thanks.

  • http://profiles.google.com/stevediraddo Steve DiRaddo

    awesome work. i’ve adapted your code to give me notifications from my website (which runs an older version of PHP) based on the username, and it works great! thanks for helping me figure this push thing out!

  • Anonymous

    Hi Matt, thanks for this cool intro project to Arduino. I almost have this going but I’m not able to connect from the Arduino, connection failed.

    I know my php script is working correctly because I can call it from a browser and get the push alert. I’ve also been able successfully telnet into the shield.

    I’m using Xport Direct Plus if that makes a difference.

    What can I try next to debug this?

    Thanks

  • http://www.facebook.com/profile.php?id=726520052 Noah STampfli

    Hi, id like to do that! But is there a way to do everything Wireless also the “ethernet” part? if so, can u help me to find what i need for it? (im new to that stuff, so please be kind ;))

    Edit:
    I Already found a WiFi Shild for Arduino for 55$ (http://asynclabs.com/store?page=shop.product_details&flypage=flypage.tpl&product_id=26&category_id=6)

  • Kevin

    HI found a page where they sell mail alerter kit works great, bought last week check it out if you want to build your own or have your own! diymail.webs.com

  • http://www.michaelkorsonlineoutlets.us www.michaelkorsonlineoutlets.us

    Started in 2003, the may be building up some sort of network involving minority limits in airline carriers across the world to be able to accelerate it is growth,. [url=http://www.michaelkorsonlineoutlets.us]michael kors handbags outlet[/url]
    Kid, who advised the competition in which his original desire ended up being go into the particular automatic robot enterprise, claimed Pepper may be set to browse the thoughts of men and women close to that by means of spotting words and tone of voice shades. [url=http://www.michaelkorsonlineoutlets.us]michael kors outlet[/url]
    He / she was taken up UnityPoint-St. Luke’s for remedy, a launch from the Sioux Area Police Department said. [url=http://www.michaelkorsonlineoutlets.us]www.michaelkorsonlineoutlets.us[/url]
    These are the basic work of the future which will be the employment that individuals, being a town, have to funnel. [url=http://www.michaelkorsonlineoutlets.us]michael kors[/url]
    The charges contrary to the authorities came from your quest in which have six neighborhoods prior to finishing with Bogota, where Baksh apparently dismissed a couple of images in a suspect which was not attack. [url=http://www.michaelkorsonlineoutlets.us]michael kors outlet[/url]
    End-of-service benefits contain leave salary, gratuity [url=http://www.michaelkorsonlineoutlets.us]michael kors outlet[/url]
    Your lifting with the curfew will increase earnings for your region within Koh Samui area of Surat Thani land, this individual additional. [url=http://www.michaelkorsonlineoutlets.us]michael kors online outlet[/url]
    It s been recently a protracted wait for a around 8,1,000 residents regarding Hailey, that wait for your pet to get better last but not least return home. [url=http://www.michaelkorsonlineoutlets.us]michael kors bags outlet[/url]
    “Mr Andrews offers spent the past two years as an absolute wrecker,Inch Dr Napthine mentioned.

  • http://www.uggsboots.us.com cheap uggs

    Jaywalking, loitering and also theft are the criminal offenses that can resulted in two-year Teenager Failure to spend Forfeiture headgear, good directory the actual MNNS website. [url=http://www.uggsboots.us.com]ugg outlet[/url]
    the video way up you wish to watchRoku – $99; minimum well-known nevertheless been common a long; stream One particular,000+ channelsAmazon Hearth TV- $99; it offers speech get; search a new person’s identify; Declare ‘Brad Pitt’ and the titles of films glaring Mr brad pitt can look [url=http://www.uggsboots.us.com]uggs outlet[/url]
    While all currently have decent requirements, Reynolds’ experience, aboard expertise and also institutional expertise in the institution process produce the woman’s the most effective prospect this time around. [url=http://www.uggsboots.us.com]cheap uggs boots outlet[/url]
    Weekend, June 21, 2014 Case options: Intend to lower financial assistance postponed in safety government bodies [url=http://www.uggsboots.us.com]ugg boots[/url]
    By BRADLEY KLAPPER, Associated Press; DONNA CASSATA, Associated Push

  • http://www.michaelkorsonlineoutlets.us michael kors bags outlet

    The particular You.Azines. official informed the actual Elp which Bergdahl utes moms and dads happen to be harassed in addition to in danger, including death risks. [url=http://www.michaelkorsonlineoutlets.us]michael kors online store[/url]
    A great deal of any additional function Milne-Jones done for extra breaks ended on his own, claimed Capricorn Dougherty, one among the professors. [url=http://www.michaelkorsonlineoutlets.us]michael kors[/url]
    Administrators statement a new drainage culvert folded away in addition to got the particular gas key. Workers swiftly shut down and also collateralized it. [url=http://www.michaelkorsonlineoutlets.us]michael kors handbags outlet[/url]
    Nate Ulrich can be telephoned in . See the Browns blog site on . Comply with your pet in Twitter in and about Fb . [url=http://www.michaelkorsonlineoutlets.us]http://www.michaelkorsonlineoutlets.us[/url]
    Logana provided as being the crew skipper in addition to starting up defense for many online games in her Combating Owl occupation. The woman won 5 desired goals and two facilitates even though major they with Twenty five caused turnovers and also ranking minute along with 27 groundballs. [url=http://www.michaelkorsonlineoutlets.us]http://www.michaelkorsonlineoutlets.us[/url]
    Currently will come lead artist Hamilton Leithauser, whoever higher wailing croon — along with white preppy matches — lent the group it is rakish bluster.