Going Cellular With Your Arduino Projects

You can add a huge measure of extensibiltiy to a project by using a cellular connection. Anywhere the device can get service you can interact with it. In the past this has been a pretty deep slog through datasheets to get everything working, but this tutorial will show the basics of interacting with phone calls and text messages. It’s the 26th installment of what is becoming and mammoth Arduino series, and the first one in a set that works with the SM5100B cellular shield.

We love the words of warning at the top of the article which mention that a bit of bad code in your sketch could end up sending out a barrage of text messages, potentially costing you a bundle. But there’s plenty of details and if you follow along each step of the way we think you’ll come out fairly confident that you know what you’re doing. Just promise us that you won’t go out and steal SIM cards to use with your next project. Find part two of the tutorial here and keep your eyes open for future installments.

44 thoughts on “Going Cellular With Your Arduino Projects

  1. It was only a matter of time before Hackaday spotted John’s amazing resource on the Arduino. Before one of the haters points out its not a hack can I say well done John.

    Anyone remotely interested in the Arduino might want to pour themselves the beverage of their choice and book themselves some “me” time to digest some of his many tutorials…

  2. A hundred bucks for the module though. Way too pricey. Just use an old crappy mobile phone.
    As long as you’ve got the AT commands for the phone, which are pretty standard/easy to get hold of, you’re golden.
    True, things get a little more complicated if the phone uses PDU for sms, but it well documented and lots of examples out there.

  3. Lol @ the Simpsons dialer. It did come to mind!

    This is awesome. You could text home to have your lights turned on or even start your dinner! I expect to see a lot of useful hacks / creations using this kind of add on and this code.

  4. @The Cageybee

    One warning about crappy mobile phones is that some of them have such bad firmware that they’re unable to stay on for extended periods of time without crashing. I tried to make a SMS gateway using some old SE T68i phones but they would always hang or reboot after a week. Back then most phones couldn’t have the firmware user upgraded either.

  5. This would be a MUCH better hack if it used a cheap, walmart-type, $30, pay-as-you-go phone.

    Does anyone know of any phones sold today that will have a serial port that you can send AT commands to that is pay-as-you-go?

  6. Does anyone know if a SIM like this one:
    http://www.skymall.com/shopping/detail.htm?pid=203635840&c=10200
    (unlimited inbound SMS and calls in the US for $35/year)
    is some sort of a trap, or would it be ideal for a project like this?

    @David: actually, since your home likely already has internet to send messages over, that would not be the best application of this sort of thing.
    I’d rather see it in a car, doing a range of things, from remote starting it on a snowy day, to unlocking it if you lock your keys inside, or having it respond back with GPS data if it’s stolen (or being able to remotely kill the car if it’s stolen)

  7. I own both the Sparkfun SM5100B and hwkitchen’s GSM Playground. Hands down, no contest, the GSM Playground is a better device. To sum it up, Hello World with the SF unit is entering a command to send yourself a text. Hello World with the GSM Playground is sending it a text containing “Temp?” and getting texted back with the measured temperature.
    Compare: Sparkfun’s offering is essentially a breakout board for the Spreadtrum radio. Hwkitchen’s offering is a fully populated shield with things like a mic, a lipo connector, a rtc, dtmf converter, gpio addressing via the Telit radio, a far sturdier antenna connection, switchable power to the radio, a thermometer, and more.
    Sparkfun offers 1 sketch, a basic serial pass-through. Hwkitchen offers over 1500 lines of code in a library, and 5 sketches detailing usage possibilities.

    I bought the SM5100B first, and soon after found the GSM Playground. I was pretty successful with rewriting the library to work with the SM5100B, AT commands are mostly created equal. What I couldn’t resist was the additional hardware, neatly packaged on the shield. Now that I’ve used it for about a week, I can say it was worth buying a second GSM shield.

    A note about SIM cards. T-Mobile and AT&T offer prepaid, but only AT&T will let you use GPRS without buying a package. T-Mobile requires that you buy a $2 24hr “unlimited” data pass. AT&T charges $0.01/Kb.
    A note about AT&T: If you plan on buying a $20 to-go phone from Walmart for its SIM, do not activate your service with the to-go phone. If you do, the SIM will be locked to that device for 6 months. In fact, skip the to-go phone idea altogether, AT&T locations should be able to sell you a SIM for $25, which includes $15 in airtime.

    I’m finalizing some functions for the GSM Playground library that should make service activation on AT&T easy, if anyone is interested I’ll update here when I’m done.

    1. Hi Mike,

      If you’re still following this thread, I would love to see what you’ve done with porting the GSM playground library for the SM5100b. I am in the middle of a project where this could be very helpful. Have you posted that code anywhere? Thanks!

      Kenny

      1. Sorry, I ended up using long range xbee’s and an Ethernet connection.

        What’s the problem you’re having?

        HWKitchen’s library isn’t all that complex, have you tried pulling out the relevant code for use with SF’s shield?

        1. Thanks Mike,

          I actually haven’t gotten far enough into it to find out what my problems are yet :) I plan to do what you suggest and harvesting the relevant code from their library. I just figured I could pick up where you left off if you had already done it. Thanks.

          Kenny

  8. @Bill D. Nothing is stopping you from using a pre-paid SIM with the GSM Shield.
    To answer your question, the $20 Nokia 2320 to-go phone at Walmart has a F-bus interface, below the SIM slot. If properly connected, you should be able to issue AT commands. The shield will always do a better job though, as you’d design the system to perform only the tasks you want.

  9. @piercedgeek Skymall is reputable. The SIM card looks legitimate, but why would you want it? The page says you can only receive calls and texts for free, outbound communication isn’t free, and the price per unit of GPRS isn’t listed. If you plan on making international calls, $0.15/minute is probably a good deal, but that’s about it.

  10. FCC regulations/registration requirements (and/or other applicable laws/regulations) not withstanding, it’d be an interesting experiment to use this to in conjunction with OpenBTS.
    It’d at least give you some way to limit
    the access (cell phone rf taps not withstanding)
    to the “phone based” controls.

    OpenBTS : http://openbts.sourceforge.net/
    OpenBTS experiment issues : http://openbts.sourceforge.net/FieldTest/index.html
    relates OpenBTS stuff: http://openbts.blogspot.com/ ;
    http://lwn.net/Articles/320163/

  11. WTF, people have been doing this with regular MCU’s and cellphones forever. Why does this site keep posting old knowledge as if it’s hot off of the press?

    You DON’T need an “arduino” to do any of this. Seriously, just learn to use an MCU and build your own stuff. There is no skill in plugging an “arduino” into some pre-built cellular module and following step by step directions to make it work.

    It is amazing how many kids I have encountered in the EE program at my school that don’t have the first clue how to use a microcontroller on its own, yet show their step-by-step assembled and programmed “arduino project” as if they know even the first thing about how it really workds.

    Damn it. I am sick of hearing about “arduino” >:-|

  12. “There is no skill in plugging an “arduino” into some pre-built cellular module and following step by step directions to make it work.”

    Isnt it great that everyone can learn electronics like Jake and never have a middle step. The joy of just going, I like electronics, and then knowing how to handle micro-controllers automatically is great!

  13. @Jake Cry moar.
    Far more offensive than an article about hardware designed to be easily accessible to anyone are the comments from the snot-nosed, holier than thou types like you. Is a functional Arduino based device inherently worth less than an identically functioning device based on traditional hardware approaches? No. Only an elitist would think that.

    If you’re really in an EE program, and you haven’t realized the importance of projects like Arduino, you’ve learned nothing. Which makes sense, given your proclivity to intentionally upset yourself.

    You’d hear about Arduino a heck of a lot less if you’d stop reading articles about it.

  14. nothing new here.. i had my first gsm phone hocked up with AT codes back in 99 and even back then i followed a step by step guide!…

    defintly no need for an expensive shield.
    any midrange nokia phone has atleast internal
    access pads for this!.

  15. @Stevie, i hope you’re trolling, because thats some pretty dumb comments.

    Try this: Get yourself a cellphone, pull it apart, and find the little vibrator/motor. cut off the motor, and replace those pins with wires. OMG you have a remote device that could trigger a bomb now…. 20 year old technology!

  16. ** davo1111 exactly!

    didn’t some guy blow himself up in Russia the other week when he accidently received one of those “courtesy messages”

    welcome to moscow *BOOM*

    im pretty sure a real teorists wouldent be
    caught dead with an arduino

    LOL

  17. @Mike
    For projects I mentioned in my post, remotely unlocking your car, starting it, killing it, would all be receive only for the device, and if it’s stolen, I’m sure you’d be MORE then happy to pay whatever the outbound SMS price is for the device to reply back with GPS loc. And all for $3/month? Please tell me if you find a better plan :)

    1. It would if you built in an overriding remote control, on board camera and door locking mechanisms. now you’r car thief is at your mercy. >:D drive him right over to the police station.

  18. Everyone is bashing each other for costs, level of skills and such. Fact is… You need something to plug your arduino to the phone network ? You have a hundred bucks and like investing in your hobbies ? Buy it. Your a real hardware specialist ? You only build stuff out of The oldest and cheapest

  19. Pieces you can find ? Just dont buy it. While this guy learn new things, you simply demonstrate that you dont know that much. And for most of the projects in the comments, a Google voice account with anything hooked up to The internet and your all set

  20. @piercedgeek I’d ask skymall what the charges are, as the cheapest yearly prepaid on Att and Tmo is $100 just to keep the number active for a year. And if it’s being used in the US, Att and Tmo are the only real gsm providers.
    If you’re only going to be sending it a couple texts a day, and aren’t interested in receiving confirmation from the device, the plan you found would probably be cheapest.

    @geez2, The ideas in the comments are not the only use cases for a gsm radio. GV+(anything)+Internet does what, exactly? How are you going to use that to remotely start your car?

    This “us vs them” crap is old. A device build with arduino is not inherently worth less than identically functioning device built without. If you think otherwise, you’ve probably wasted your time complaining to strangers on the internet about it. How smart is that?

  21. @Mike

    I’m sorry, pal, but you are dead wrong. There are 3 seniors in the program working on a design project right now. They were in the lab yesterday, talking about how it needed ethernet, stepper motor control, etc.

    Two of them had “arduinos” sitting on the desk, they were talking about how awesome it was, and how all they needed was to spend 50 bucks on an “ethernet shield” and another 50 or so for the right “arduino”, download someone’s code for controlling it all, piece it together, and have their final project.

    I looked over and said “Oh, you guys working with atmel processors?”

    Their response: “Huh?”

    We proceeded to talk about the “arduino”. They didn’t even understand that the microcontroller on board had nothing to do with “arduino”. Furthermore, their senior project is going to consist of a bunch of pre-assembled boards, plugged in to each other, running from code that they copied off of the internet and pieced together.

    If you want to learn how to program a microcontroller, and want to do it on an “arduino”, good for you. Just don’t call yourself an electrical engineer. If you want to use it in a project, good for you, just understand that you didn’t build it. You just plugged it in.

    If you want to be a REAL hobbyist or engineer, build your own damn board. THIS requires skill, and you will learn so much doing it!

    So, I say once again, “arduino” stifles skill building, and I scoff at the word “arduino”. I work part time with an engineering firm. Any potential intern that we interview who mentiones “arduino” is going to be questioned extensively on what an “arduino” is and how it works. 1000 bucks says he doesn’t really know, and won’t get hired as a result.

  22. Jake, I know almost nothing about electronics. I do have an arduino. If not for the arduino I would have never made the leap. I am now struggling but between some google and kind guidance. So yes, they can be a shortcut for some. However they bring some new folks to the hobby that would have never got started.

  23. Jake, I’m sorry you’ve confused the comments section of HaD with the Dean of your program. I do not, nor does anyone on this site, give a crap about your feelings towards your classmates.
    The article is about someone writing about their experience with an arduino and gsm radio shield. The author, afaik, is not purporting to be an EE student; Your rant has absolutely nothing to do with the topic.
    What have I gotten wrong? That your comments are more offensive than the article? Nope, that’s true. That a device built with an arduino is not inherently worth less than an identical device built without? Nope, that too is true. That only an elitist would think otherwise? Maybe elitist isn’t the right word. That you’ve learned nothing in your EE program because you don’t understand the importance of arduino? That’s arguable, as you’ve probably learned enough to fancy yourself as better than those who use arduino. Which makes elitist the right word. You’ve got a proclivity to upset yourself, you proved it by reading and commenting on an article you knew you wouldn’t like. And there’s no arguing that if you avoid articles that have a picture of an arduino you’d hear about it less.

    That said, there are certainly times when the use of an arduino isn’t warranted. If you’re in EE, using an arduino in your final project is probably taking the easy way out. If you want to be an electrical engineer an arduino isn’t going to cut it. That should be self evident.
    But here’s the thing: You’ve got your emotions for your classmates, and the Internet, mixed up. The vast majority of arduino users are not in EE, and most of them do not care about what happens after they click compile, so long as the actions they’ve written occur. And that is 100% OK! Arduino lets people easily interface with hardware that was previously unreachable.
    That’s why it is important. Anyone, not just people who’ve done extensive studying, can work with hardware. That’s huge. It exposes many people to things they would otherwise never know. Like coding, debugging, and soldering.
    They aren’t fake hobbyists, what they’re doing isn’t not learning, they simply have no interest in learning two tons of crap before getting started. It’s a good thing, accept it, move on.

  24. “The vast majority of arduino users are not in EE”

    Really? Then why does this site continue to post “arduino” related topics and refer to the builder as some sort of electrical engineer? Don’t ask me to quote this, I’m not going to dig through the archives, but it happens pretty regularly.

    YES, the “arduino” and any other third party MCU board with loads of open source code is intended for a hobbyist that does not want/need to understand how it really works. THAT is why it is BAD in an EE program – and THAT is why they are looked down upon by the REAL engineers in my program.

    You sound bitter. I assure you that I don’t have emotions for my classmates, I simply have a distaste for laziness. Deal with it ;)

Leave a Reply to JakeCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.