I’ve been toying a lot recently with LoRaWAN networking, even going so far as to build a full gateway and mounting it on my house. As an alternative, I ordered some GSM shields from AliExpress which connect into your existing GSM providers network. It saves building a gateway, although the running costs will probably be higher.
I had come across SIM900 and SIM800 based boards before, as a SIM900 based board was a central part of my PiPhone project. That had full voice and SMS capability. But for IoT projects, you typically only need some data capability, so something that allowed you to send out an SMS from time to time was more suitable. I found a board on AliExpress, which contains a SIM800L module, plus all the relevant power circuitry and breakout pins to allow it to be used as a simple GSM modem.
The picture below shows the Adafruit FONA (based on a SIM800H) on the left and the SIM800L breakout board on the right. The Fona is fully featured, containing a charging circuit for a LiPo battery, jack socket for voice/headphones, etc. and costs about $40 from Adafruit.com (without antenna). The SIM800L board requires 5V @ 2A supply, has no voice or battery capability, just UART pins to talk to the module with AT commands. On AliExpress, they can be found for as little as $8.40, including an antenna and pigtail.
Here’s a closer look at the top of the board, with the SIM800L. The U.Fl socket has been populated with the pigtail connector. It can be quite tricky to attach, but a good “click” will tell you it’s connected properly. I believe these connectors are only designed for up to 10 make-break actions, so don’t make a habit of regularly connecting and disconnecting the pigtail from the U.Fl socket.
And the underside of the board. with it’s micro-SIM socket. The importance of the small symbol with “SIM CARD” will become more evident later. 🙂
The pinouts are straightforward enough. 5V and GND for the PSU of the SIM800 Module (needs to be 5V @ 2A, as the transmit current spikes up to about 2A during cellular transmit). The rest are the UART pins, VDD for the logic level, I’ve used a 3.3V FTDI cable successfully with this. 3.3V from the FTDI cable goes to Vdd, then TXD, RDX and GND also from the FTDI cable.
Speaking of FTDI cables, here’s a picture of the UART end. The other end of the cable is simply a USB connection.
And as you can see in the bottom of that picture, I’m only using 4 pins, VDD, GND, TXD and RXD.
I use jumper wires to adapt the FTDI connector to the pins on the breakout board, and two separate pins feeding the 5V @2A.
So once I started my terminal program of choice (Putty), I connected to the board on COM3 @ 115200 baud, and was success fully able to issue an AT command, getting the usual OK response (only after swapping the RXD and TXD pins). Funny, I know it’s a 50/50 chance that you’ll get that right if you pick them at random, but I always seem to get the wrong! 🙂
Issuing AT at the terminal, gives me “OK”
at OK
But I found that the “network” LED on the board was still flashing quickly (about every 500mS), which indicated that it had not yet connected to the cellular network.
I queried the operator:
AT+COPS? +COPS: 0 OK
Which means there us no operator associated. Then I queried the list of operators:
AT+COPS=? +COPS: (1,"O2 (Ireland) Ltd","02 -IRL","27202"),(1,"vodafone","voda IE","27201"),(2,"METEOR","METEOR","27203"),,(0-4),(0-2) OK
So, I could see all the operators, including the one I was supposed to be connected to, “O2 (Ireland) Ltd”. They were bought by Three a while back, but the network still shows O2. At this stage, I got out out the FONA. connected it up, inserted the SIM, and sure enough, it connected straight away to the network. Back to the SIM800L board, swapped the SIM, and powered up. Still no joy. I looked at the modes, and various other settings, comparing them to the FONA. Lots of powering up and down of each board, and lots of swapping of SIMS. It was then that I noticed the little diagram on the SIM800L board with the label “SIM CARD”. It was at this stage that I realised that it was not just a lable, it was a diagram telling me WHAT WAY AROUND TO INSERT THE SIM CARD! AAARGH! I’d been getting it wrong all this time. So, I pulled the SIM, inserted with the diagonal notch outwards, and powered up the board.
Sure enough, it associated straight away, and then the query of the operator came back successful.
AT+COPS? +COPS: 0,0,"O2 (Ireland) Ltd" OK
So next was time for an SMS.
AT+CMGF=1 OK AT+CMGS="08x61xxxxx" > This is a test > +CMGS: 8 OK
And the resulting SMS came through a couple of seconds later:
Now to the bit about running costs. I know the board is about $8.40. However that’s all well and good, but what about the running costs? The cost of a SIM card? I have a Three SIM that I top up by €5 every few months. I’m not sure whether I need to top up by €5 every month to be able to send texts. And I tried to get a new SIM yesterday, and was told by a person in Carphone Warehouse that the cheapest package was €12 a month, which I find hard to believe. Surely you can get a SIM and only top it up by €5 each month if that’s all you use? I think €5 is the minimum. I’m looking for a €1 a month plan. That would be ideal. I’d probably be willing to pay €12 a year for a package that allows 1 SMS a day. Then there’s these global SIM providers that I’ve heard about, I’ve not looked into them yet. Feel free to drop a comment below if you have some info on cost effective ways of getting a SIM card for IOT use. 🙂
’till next time…
–EDIT–
I got some good suggestions on cheap SIMs from some readers via email. Hologram & Telit provide IoT SIM cards for $5, with approx 1MB of data per month for approx $1. Also, there may be options for getting a SIM in another European country where monthly costs may be lower, and using it here. Worth looking into.
Hi Dave,
Are you sure you really need ability to send SMS?
I’m using pushbullet to send notifications to my iPhone.
Been using it to send notifications from my homemade (RPi) video doorbell.
In the notification I can include a URL and also an image along with the text.
It’s the closest thing I’ve found to sending an SMS, without any setup fee or subscription, etc.
There was a time when you could send an email to a GSM number@o2.ie (or something like that), and that would be converted to an SMS. I’m on Three and I think they have something like that, but it’s only accessible from their website.
Thanks.
Best regards,
Niall.
Hi Niall,
The SMS was an example of an outbound packet from the IoT device. You could also do a push notification via URL, or other data based notification, as you suggest, but you still need an active SIM in the device to push out data or SMS.
Dave.
Hi Dave,
Sorry, re-reading this and I see now that my suggestion didn’t make much sense
The el-cheapo SIM looks interesting. Could be good for controlling an IOT device remotely (eg a holiday home, or elderly parents home) where there isn’t a local internet connection.
Thanks for your investigations and updates
Best regards,
Niall.
Good feedback from Ric who suggested I take a look at Hologram. They have pay-as-you-go plans for as little as 59c per month with $5 for a SIM. That’s what I’m talking about!
I also came across Telit, same cost for SIMs, slightly more expensive data plans, but cheaper shipping for SIMs ($10 whereas Hologram is $31). I’ll look a bit deeper into the SIM options out there and do a wee blog in the near future.
OK, So I just ordered a developer SIM from Hologram, and 4 SIMs from Telit. MyM2M’s website is crap, and I couldn’t sign up, so didn’t bother with them.