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.
The datasheet for the Quectel M10 modem can be found here.
This tutorial assumes you have some basic understanding of Arduino.
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.
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.
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
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.
In here, you should see your current band setting and a list of other band setting to choose from.
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.
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
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.
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
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.
Once your SMS got sent, it will say “COMPLETE!”
We got the SMS!
Receiving SMS and other function are very similar to sending SMS. Now go write your code and start playing with the GSM shield.
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.