We 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:
- 1x Arduino
- 1x Ethernet Shield
- An account at http://www.smspi.co.uk
- Our code below.
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.
After 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.