Sending out SMS with the Arduino and SMSPI

smsfWe recently found a free SMS gateway called SMS PI – this service allows you to send up to 500 SMS messages to any phone numbers within the UK; the actual servers that send out the messages are also hosted on a Raspberry Pi.

We decided to give this a go and hook it up to our Arduino and Ethernet shield and then see how it performs..


You’ll be needing:

Once you have all of the above; it’s as simple as running the sketch below. We made a handy function that sends out a POST request to the SMS Pi servers, all you have to do is pass in the phone no, your account hash and a messageĀ as parameters.

The sketch will delay for 5 minutes before re-sending the message; giving you plenty of time to either upload a new sketch or turn off the Arduino. The below code is only meant for testing the actual SMS service; it does nothing other than connect to your network via the Ethernet shield and send a test SMS.

The sketch:

smsAfter you’ve entered your details in the sketch above. Run it and wait a few seconds (you should see some serial output in the console) and then you should receive your SMS message to the phone number you specified.

That’s all there is to it, there are hundreds of uses for a free SMS gateway, especially when you’re playing with sensors and other inputs on the Arduino.

Let us know in the comments below if you’ve used this for anything!

It is also worth mentioning that SMS Pi doesn’t currently make any money out of the service; so if you use this service a lot then give them a donation to help improve the website and services, after all it’s completely free of charge.

Have fun!


Email this to someoneShare on Google+Pin on PinterestTweet about this on TwitterShare on RedditShare on Facebook

3 thoughts on “Sending out SMS with the Arduino and SMSPI

  1. can it work outside the UK? i’m currently working on a Motion Detection project with the Arduino board with the aim of sending sms alert once the sensor is triggered. please advise

  2. Hi,
    Great post and research. I have tried the script on my Arduino but it seems that since you posted, SMSPI have possibly changed the way their site works.
    Line 33 in your code needs to be changed from “POST /send/index.php …” to “POST /api/send.php …”

    Great info and site though.


Leave a Reply to Andre Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">