Arduino GSM Shield Tutorial (on Rogers Network)

The Arduino GSM Shield using the M10 GSM/GPRS modem can connect your Arduino to the internet using the GSM or GPRS wireless network. In this tutorial, we’ll walk you through how to do that (using a Rogers SIM card in Canada). Once you are connected, you can make/receive voice calls (you will need an external speaker and microphone circuit) and send/receive SMS as well as internet data.

GSM_02
(Left) Arduino GSM Shield 2 (Right) Arduino GSM shield with connector and duck antenna.

The datasheet for the Quectel M10 modem can be found here.

This tutorial assumes you have some basic understanding of Arduino.

GSM_01
Here, we have a Arduino Uno sitting on our Arduino and breadboard holder. It’s always nice to have a base to work with.

Step 1: Acquire a SIM card that have GSM/GPRS service

In Canada, only a few wireless providers have GSM/GPRS (2G) network. From our research, those wireless providers are Rogers, Ice Wireless, and Keewaytinook Mobile. Please check with the wireless provider for GSM/GPRS (2G) coverage.

Types-of-sim-card-engineerslive

Ensure you have a SIM card that give you service on at least the following band: GSM850MHz and PCS1900MHz. Most GSM compatible SIM card should but it doesn’t hurt to make sure. A standard size SIM card is what you want but a smaller SIM card will work too given you have a SIM card holder or you know where to position it.

Step 2: Test the SIM card

Before doing anything with the Arduino, test your SIM card on your phone first. Ensure that you can at least send and receive SMS message on the GSM network.

Step 3: Mount your GSM shield onto the Arduino and your SIM card into the GSM shield

Use a SIM card holder if have a small SIM card.

If you don't have a standard size SIM card (like us), use a SIM card holder.
If you don’t have a standard size SIM card (like us), use a SIM card holder.
Slide the SIM card into the SIM slot as shown. SIM cards are directional. Don't put it in backward.
Slide the SIM card into the SIM slot as shown. SIM cards are directional. Don’t put it in backward.
Lock the SIM card in place.
Lock the SIM card in place.

Step 4: Power Up the Arduino and the GSM Sheild

Plug the USB cable into your Arduino board to provide power for the Arduino and the GSM shield. Keep in mind, you’ll need to use an external power supply if you are using the M10 modem heavily.

Step 5: Band Management

Open the Arduino IDE and load File > Example > GSM > Tools > BandManagement

GSM_07

Load the code onto your Arduino board and open the serial monitor.

Once the code is loaded, turn on the M10 modem by holding down the power button for a few second until the “STATUS” led is on and the “NET” led is blinking. We’ve found that if you turned on the M10 before the Arduino reset after uploading the code, the Arduino might not be able to talk to the M10 modem.

GSM_07A
Press and hold the power button to turn on/off the M10 modem. When the modem is on, the “STATUS” led will turn on.

In here, you should see your current band setting and a list of other band setting to choose from.

GSM_08

Choose option 5 for GSM(850+PCS(1900) then press Enter. Option 6 for GSM(850)+E-GSM(900)+DCS(1800)+PCS(1900) should work as well but we haven’t tried it yet.

GSM_09

If the band setting is successful, it will show success. If not, turn off the modem, reset the Arduino and try again. Sometime it does that.

If you don’t see your current band setting and got some kind of error reading/changing the modem setting, it usually means your modem has not been not turned on. Turn it on by holding the power button until the “STATUS” led is on.

Turn off the modem once you are done! (Hold down the power button). We found this important for the next step.

Step 6: Scan for Network

Ensure the modem is off. If not, this might not work.

Open File > Example > GSM > Tools > GsmScanNetworks

GSM_10

What is important here is the SIM card’s PIN number. You’ll need to know that and put it in the Arduino code at the beginning. You’ll see a line that says #define PINNUMBER. Put your SIM card’s PIN inside the quote. The default PIN is usually “1234”.

Load the code onto your Arduino board and open the serial monitor. Turn on the modem (Hold down the power button) then open the serial monitor. If you let the modem stayed on from step 5, sometime the Arduino will have difficulty connecting to it.

Open up serial monitor and once the Arduino is talking to the M10 modem, you’ll see the modem’s IMEI number. Afterward, the modem will start scanning for GSM network. When a GSM network is found, either the carrier name or the carrier code will show up along with the signal strength. If GSM network is not found, make sure your antenna is connected and in good condition.

GSM_11

In this case, carrier code 302720 is Rogers.

If you get “Not Connected” repeated for 10+ time, it mean the Arduino is not talking to the M10 Modem, try turning the modem off by holding down the power button until the “STATUS” led is off and turn it back on again, the “NET” led should be blinking afterward.

If it’s still not working, turn off the modem, restart the Arduino, and start from the beginning of this step again.

Step 7: Sending SMS

Now that you Arduino and GSM shield combo can see the desired GSM network, let’s try sending a SMS.

Ensure your modem off first by holding the power button until the “STATUS” led is off to be safe.

Open File > Example > GSM > SendSMS

GSM_12

Put your SIM card’s PIN into the code then load the code.

Turn the modem back on once the code is loaded and you should be asked to provide a mobile number in the serial monitor. After you put in the mobile number to send your text to, you can enter you message.

GSM_13
Sending ourselves a SMS. You can try texting us but our phone number is a landline so we most likely won’t reply.
GSM_14
“Hello World from GSM shield.”

Once your SMS got sent, it will say “COMPLETE!”

GSM_15

We got the SMS!

GSM_16
We got the SMS! Note: We used a cellphone to receive this, not the landline.

Receiving SMS and other function are very similar to sending SMS. Now go write your code and start playing with the GSM shield.

That’s it.

Note: We found that sometime the Arduino have difficulty talking to the M10 modem after a reset while the M10 stayed on. Maybe there’s a way around this other than physically pressing the power button but we haven’t played with the shield much to figure it out yet.

7 thoughts on “Arduino GSM Shield Tutorial (on Rogers Network)

  1. I did every steps here and works one time in 4 days. Don’t know if i could do something with it. i use the same hardware as the tutorial. Thanks to help me with this.

    1. Are you getting good GSM reception? The sequence in getting the Arduino to talk to the M10 modem is tricky. I found that you have to start the Arduino program first then turn the M10 modem on.

      1. Yes i have a good gsm reception. My signal strength is between 20-30. Band management sketch works fine. Its when i try to initialize the GSM in the SMS sender sketch that nothing happen. My program stuck in the While loop where i try to connect it. The only thing i see on the monitor is “SMS sender messages” .
        Last thing, i dont have any pin number on my sim card (Rogers 2G)……..

  2. I did every step untill ‘Step 6: Scan for Network’.
    But even after a number of turning off/on the modem it still doesn’t work.
    I use an a Mega 2560 and a GSM Shield 2 (integrated antenna).

    Who could help me?

    1. Unfortunately, we won’t be providing such tutorial at this time. You can search on google or the Arduino forum to see if anyone else did a similar project.

Leave a Reply

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