Beruflich Dokumente
Kultur Dokumente
This will be the first of several articles related to the SM5100B GSM shield. [Part two is here] The available documentation for this unit was abysmal, so please be
patient. My goal is to illustrate different ways of interacting using the shield, with which you can then use your existing knowledge to build upon those ways. For this
article I want to get a few things out of the way first, which may sound a little harsh, but are necessary.
Firstly telephone calls and text messages (SMS) can cost real money, so if your sketch goes bonkers and blasts out a few hundred text messages while youre in the
kitchen having tea, you will have to pay for them. It may be prudent to use a prepaid cellular account for testing purposes.
Secondly, the current draw. Sending an SMS (a tiny burst of data) will generally draw around less than 400 mA, which is within our normal Arduino specification. If
you are using your shield to make or receive actual telephone calls, the shield can draw up to two amps of current. The actual current draw will vary depending on the
strength of network reception in your location. For example, I live in direct line-of-sight of a network tower, use a carphone aerial and have full reception. When using
the shield to make a call the current draw is around 420 mA. If in doubt, use the ammeter function of a multimeter to monitor current draw.
However if I was 25km east of Sydney Harbour, the shield would use maximum transmit/receive power and pull the two amps. Therefore if communicating in this way
you cannot run your Arduino and this shield from the USB port or the DC socket. And dont be lazy by trying it anyway.
Instead, power your project with a high-capacity 5V 2 amp power supply to the 5V and GND pins on your shield.
Thirdly, you will need an aerial. These can range from the small rubber ducky types, to full carphone models. If you are using the larger vehicle-style aerial, you
might find that the plug will not fit to the shields connector. For example, consider the following:
On the left is the end of the lead from the carphone aerial, the right is the lead from the GSM shield. Problem! The solution is in the centre: an FME male to SMA male
adaptor. This one came from Farnell/element-14, part number 1826209 (it is a Multicomp R23-014-00-002611000). Furthermore, care needs to be taken with your
GSM shield with regards to the aerial lead-module connection, it is very fragile:
From a software perspective we will need the NewSoftSerial Arduino library, so please download and install that before moving on.
Are you using an Arduino Mega board?
Mega users things will be slightly different for you. Please make sure the TX and RX pins of your GSM shield DO NOT plug into your Mega. Furthermore, run a
jumper wire from GSM shield pin D2 to Mega pin 19, and a jumper from GSM shield pin D3 to Mega pin 18, as shown below:
Finally, the example sketches will be different. Mega will not use the NewSoftSerial library, instead we use the Serial1 port. Please use the following Mega-equivalent
sketches for this article: Example 26.1, 26.2, 26.3 and 26.4.
Now, on with the show
Why would you want to connect your Arduino to the mobile phone network anyway? To send and receive data across the mobile network, and to transmit or receive
instructions or commands. More specifically, within the scope of this article we will do so mainly using text or SMS messages.
When shipped as new, our shield does not include the 6-pin and 8-pin headers (though it should for the price cheapskates). So you will need to source your own and
solder them in by inserting them onto the pins of another shield and drop the shield on top, then solder the shield in nicely.
Initial check does it work?
This may sound like a silly question, but considering the cost of the shield and the variables involved, it is a good idea to check if your setup is functioning correctly
before moving on. From a hardware perspective for this article, you will need your Arduino board, the GSM shield with activated SIM card and an aerial, and a range
of previously used components. Make sure your SIM card is set to not require a PIN when the phone is turned on. You can check and turn this requirement off with
your cellphone. For our initial test, upload the following sketch :
Example 26.1
/* SparkFun Cellular Shield - Pass-Through Sample Sketch
SparkFun Electronics Written by Ryan Owens CC by v3.0 3/8/10
Thanks to Ryan Owens and Sparkfun for sketch */
//Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>
char incoming_char=0;
NewSoftSerial cell(2,3);
void setup()
{
//Initialize serial ports for communication.
Serial.begin(9600);
cell.begin(9600);
Serial.println("Starting SM5100B Communication...");
}
void loop()
{
//If a character comes in from the cellular module...
if(cell.available() >0)
{
incoming_char=cell.read();
Serial.print(incoming_char);
}
//If a character is coming from the terminal to the Arduino...
if(Serial.available() >0)
{
incoming_char=Serial.read();
cell.print(incoming_char);
}
}
Then connect the GSM shield, aerial, insert the SIM card and apply power. Open the serial monitor box in the Arduino IDE and you should be presented with the
following:
It will take around fifteen to thirty seconds for the text above to appear in full. What you are being presented with is a log of the GSM modules actions. But what do
they all mean?
+SIND: 1 means the SIM card has been inserted;
the +SIND: 10 line shows the status of the in-module phone book. Nothing to worry about there for us at the moment;
+SIND: 11 means the module has registered with the cellular network
+SIND: 3 means the module is partially ready to communicate
and +SIND: 4 means the module is registered on the network, and ready to communicate
If your terminal returned a +SIND 8 instead of 4, that is OK, well sort that out in a moment.
From this point on, we will need to use a different terminal program, as the Arduino IDEs serial monitor box isnt made for full two-way communications. You will
need a terminal program that can offer full two-way com port/serial communication. For those running MS Windows, an excellent option is available here. Its free,
however consider donating for the use of it. For other operating systems, people say this works well.
So now lets try it out with the terminal software. Close your Arduino IDE serial monitor box if still open, then run your terminal, set it to look at the same serial port as
the Arduino IDE was. Ensure the settings are 9600, 8, N, 1. Then reset your Arduino and the following should appear:
The next step is to tell the GSM module which network frequency(ies) to use. Please download this document (.pdf), and view page 127. There is a range of frequency
choices that our module can use. If you dont know which one to use, contact the telephone company that your SIM card came from. Australia use option 4. Choose
your option, then enter
AT+SBAND=x
(where X is the value matching your required frequency) into the terminal software and click SEND. Then press reset on the Arduino and watch the terminal display.
You should hopefully be presented with the same text as above, ending with +SIND: 4. If your module returns +SIND: 4, were ready to move forward.
Our next test is to call our shield. So, pick up a phone and call it. Your shield will return data to the terminal window, for example:
As you can see, the module returns what is happening. I let the originating phone ring twice, and the module received the caller ID data (sorry, blacked it out). Some
telephone subscribers accounts dont send caller ID data, so if you dont see your number, no problem. NO CARRIER occurred when I ended the call. +SIND: 6,1
means the call ended and the SIM is ready.
The document (.pdf) we downloaded earlier contains a list of AT commands consider this a guide to the language with which we instruct the GSM module to do
things. Lets try out some more commands before completing our initial test. The first one is:
ATDxxxxxx
which dials a telephone number xxxxxx. For example, to call (212)-8675309 use
ATD2128675309
which hangs up or ends the call. So, lets reach out and touch someone. In the terminal software, enter your ATDxxxxxxxx command, then hit send. Let your phone
ring. Then enter ATH to end the call. If you are experimenting and want to hang up in a hurry, you can also hit reset on the Arduino and it will end the call as well as
resetting the system. So by now you should realise the GSM module is controlled by these AT commands.
To use an AT command in a sketch, we use the function
cell.println()
cell.println("ATD2128675309");
Example 26.2
//Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
void setup()
{
}
void loop()
{
cell.println("ATDxxxxxxxxx"); // dial the phone number xxxxxxxxx
// change xxxxxxx to your desired phone number (with area code)
delay(20000); // wait 20 seconds.
cell.println("ATH"); // end call
do // remove this loop at your peril
{
delay(1);
while (1>0);
}
The sketch in example 26.2 assumes that all is well with regards to the GSM module, that is the SIM card is ok, there is reception, etc. The delay function in void setup()
is used to allow time for the module to wake up and get connected to the network. Later on we will read the messages from the GSM module to allow our sketches to
deal with errors and so on. However, you can see how we can simply dial a telephone. You could now have a home alarm system that can call you upon an event
happening, etc.
Another popular function is the SMS or short message service, or text messaging.
Sending text messages from our Arduino
The AT commands for sending text messages are a little more involved, but nothing to worry about. First, we need to tell the module our SMS will be ASCII text, this is
done with:
AT+CMGF=1
Then we need to give the mobile phone number to send the message to:
AT+CMGS="xxxxxxxxx"
At this stage, there needs to be a small delay, around half a second. Then the module will expect the contents of the message (maximum 160 characters) followed by the
ASCII equivalent of Ctrl-Z. After sending the message, the module needs around fifteen seconds to finalise the procedure, so if sending multiple messages, allow for
this with a delay() function.
Do not use cell.println() on the function that sends the message text. Doing so will lock up your SMS module.
Example 26.3
So lets send a text message. I have tried to simplify the process as much as possible, so the following sketch is my simple Send an SMS example:
/*
void setup()
{
}
void loop()
void loop()
{
cell.println("AT+CMGF=1"); // set SMS mode to text
cell.print("AT+CMGS=");
Now we can consider sending data and a fixed text message. To do so, we need to split the procedure of sending a text message into three parts: the sending data, the
message and any data, and ending the procedure. This is done in the following example. The sketch generates a random number between 0 and 99. Then it counts from
0 to 99, and when the count reaches the random number, it sends the text message containing an initial note and the random number.
Example 26.4
/*
Example 26.4
char mobilenumber[]="xxxxxxxx";
}
void startSMS()
// function to send a text message
{
digitalWrite(13, HIGH);
cell.println("AT+CMGF=1"); // set SMS mode to text
cell.print("AT+CMGS=");
cell.print(34,BYTE); // ASCII equivalent of "
cell.print(mobilenumber);
cell.println(34,BYTE);
void loop()
{
b=random(0, 99);
for (int a=0; a<100; a++)
{
if (a==b)
{
startSMS();
cell.print("The random number is: ");
cell.print(b);
endSMS();
}
}
do
{
delay(1);
} while (1>0);
}
So now you can see the basic procedure for sending mixed data in a text message. For the purpose of the video, and to save my sanity the GSM shields telephone
number is stored as a phone book entry, that is why the sender is shown as Arduino GSM.
Well that is all we have time for in this instalment. Thank you for your patience in awaiting this series of articles. Although getting it together was a little tricky, it was a
lot of fun. I hope you enjoyed reading it as much as I did writing it for you. Now you can move onto GSM and Arduino part two!
Otherwise, have fun, stay safe, be good to each other and make something!
Please share with
others:
Like this:
StumbleUpon
Digg
January 19, 2011 - Posted by John Boxall | arduino, cellphone hacking, cellular, GSM, microcontrollers | 1800, 850, 900, arduino, ATT, call, card, CEL-09607,
cellphone, cellular, control, education, electronics, GPRS, GSM, GSM1800, GSM850, GSM900, guide, guides, hacking, lesson, lessons, message, MHz,
microcontrollers, mobile, monitor, network, optus, PCS, project, projects, remote, shield, SIM, SM5100, SM5100B, SMB5100B, SMS, sparkfun, spreadtrum,
telephone, telstra, text, tutorial, tutorials, VHA, vodafone
124 Comments
1. this is excellent! Although the procedure looked tricky, its quite do-able with your tutorial.
Thanks John!
Thanks John!
Russ
Comment by Russ | January 19, 2011
Hello Russ
Thank you for your comment, I really appreciate it. What drove me to write the article (and the future two) is the complete lack of any usable tutorial
elsewhere. People would post bits of their code, but not a simple, working example. So here you are. Enjoy!
cheers
john
Comment by John Boxall | January 19, 2011
2. Hi John,
This is great, except that I am using an Arduino Mega. I am trying to complete the initial check, and I did every exactly as you described, except I have to
manually connect the shield pins to the Mega. I get the Starting SM5100B Communication line, but I never get the +SIND response. Ive also tried just about
every other way. Could it be that Im using a Mega? I am using an AT&T 3G sim card.
Comment by Peter Li | January 20, 2011
Yes, the Mega is slightly different. I have emailed you directly, and will update the tutorial now.
Thank you for bringing this to my attention
cheers
john
Comment by John Boxall | January 20, 2011
Interesting point about the Mega 1280.
Ive resoldered the jumpers for the Cellular shield so that it uses HW Serial pins 0 and 1 instead of SW pins 2 and 3. For some reason it wont work on the
Mega.
The exact same code works on an Arduino Uno!
But I cannot seem to communicate with the cellular board using Serial0 on the Mega
Ive also tried using Serial1 on the Mega as well, but this doesnt work either. Very strange that this happens on the Mega. I know these serial ports work
because I can communicate to a Uno over serial and I can communicate within the Mega from Serial 0 to Serial 1 for example.
I havent tried using the SW serial on the Mega for the cellular shield.
Is the Mega doing something odd with its serial communication that makes it necessary to use the SW serial?
Comment by staropram | May 26, 2011
Hello
If you have soldered the GSM shield up to force it to use pins d0 and d1 for serial, the Mega should definitely work using Serial.begin(9600) etc for
comms with the GSM shield. Only catch is that if you need to use the terminal window you cant as it requires the first serial i/o (as it is the only one
through the FTDI>USB trail). There is no need to use software serial on the Mega.
Comment by John Boxall | May 27, 2011
3. Thank you so much for sharing your knowledge, this is an awesome tutorial as always.
Im not playing with GSM right now but I keep in mind the possibilities.
The hardest thing for a beginner like me is to find good documentations but fortunately you are here to make things a lot easier. Thank you
Comment by virtualmix | January 22, 2011
4. Hi John,
Many thanks for posting this. Its exactly what Ive been looking for for the past few weeks.
Just one question though, did you have to change the baud rate yourself? My understanding is that the GSM shields originally shipped with the baud rate set to
115200, instead of 9600.
Ive been trying to use the Sparkfun FT232RL breakout board (BOB-00718) to reset mine, but as Im a relative newbie to electronics, I have been unsuccessful.
Any advice or comments you could offer would be greatly appreciated.
Best,
Roki
Comment by Roki | January 25, 2011
Hello
The units should be shipped as being set to 9600, at least for the last six or so months.
Do you have an Arduino Duemilanove/Uno/compatible board? If necessary, you could change the baud rate using USB via the Arduino and the terminal
software.
John
Comment by John Boxall | January 25, 2011
Hi,
Its a compatible board (based on the Duemilanove).
Yes, Ill give that a try. Do I have to remove the ATMega chip for that (perhaps its a dumb question, but Ive seen it listed before)?
Thanks,
Roki
Comment by Roki | January 25, 2011
john
Comment by John Boxall | April 21, 2011
Hello John,
Thanks for quick response. I changed the baud rate on Serial1 to 115200 when it is initialised (the one to which the the shield is connected) but still
nothing happened, ie. I got a bunch of blank characters in the serial monitor after Starting SM5100B Communication. I will try the sparkfun fix,
but I dont see why it would change anything as the serial connections on the mega should be able to run at 115200.
Tanaka
Comment by Tanaka | April 21, 2011
Ok. If you can replicate example 26.1mega exactly both in hardware and software (trying both serial port speeds) and the blank characters still
appear, then you must have a faulty module.
john
Comment by John Boxall | April 22, 2011
19. I am using the code from Example 26.3 and it works. But it cant send the second message consequently. Then after a while it will send message again. This is
my code for sms:
while(c<=3){
Serial1.println("AT+CMGF=1");
Serial1.println("AT+CMGS=\"+6593958587\"");
Serial1.print("Hi?\n");
Serial1.println(26,BYTE);
delay(1000);
Serial.println("\nMsg sent");
delay(15000);
c++;
}
Is there any missing?
Comment by Hao | May 18, 2011
Hello
Yes, change
Serial1.println(26,BYTE);
to
Serial1.print(26,BYTE);
have fun
john
Comment by John Boxall | May 19, 2011
20. Hi John, I tried to interface my Arduino Duemilanove Board and ATMega328P with a SIMCOM SIM300EVB and SIM900BE. I uploaded the example 26.1
and it seems work fine, it get Call Ready, but if i try to send any AT command to the module, it doesnt answer. I tried 26.2 and nothing happens. Have you any
advice?
Thanks
Comment by NicolaG | May 19, 2011
Hello
I dont have access to one of those modules so cannot test it out. However general advice includes ensuring the power supply is correct with regards to
voltage and current, you have an appropriate antenna connected, and your cellular network supports the frequency of your module. Finally, some modules
use different AT commands than that of the SM5100b used in my tutorial, so you would need to find the equivalent in your data sheet and substitute them
in the sketch.
John
Comment by John Boxall | May 19, 2011
21. This is great tutorial John
I have a question, i use wavecom with wismo gsm module inside. This gsm modem have an internal rs232 serial link connection. Should I use additional rs232
circuit before I connect this modem to my arduino kit?
any help will be appreciate
thanks
Comment by mirws | June 6, 2011
No idea. Need a link to your module so I can read about it first.
Comment by John Boxall | June 6, 2011
John, as you wish, this is a documentation about my modem gsm
http://www.ozeki.hu/attachments/588/M1206B_Manual.pdf
Comment by wiro | June 6, 2011
Ah.
You will need an Arduino RS232 interface board. For example http://shieldlist.org/cutedigi/rs232
Please note I dont support this GSM module.
John
Comment by John Boxall | June 6, 2011
Serial.print (message[17]);
Serial.print (message[18]);
Serial.print (message[19]);
Serial.println ("");
Serial.print ("The date was ");
Serial.print (message[45]);
Serial.print (message[46]);
Serial.print (message[44]);
Serial.print (message[42]);
Serial.print (message[43]);
Serial.print (message[41]);
Serial.print (message[40]);
Serial.print (message[39]);
Serial.println ("");
Serial.print ("The time was ");
Serial.print (message[48]);
Serial.print (message[49]);
Serial.print (message[50]);
Serial.print (message[51]);
Serial.print (message[52]);
Serial.print (message[53]);
Serial.print (message[54]);
Serial.print (message[55]);
Serial.println ("");
Serial.println("waiting at end of cell serial available loop");
//cell.println("AT+CMGD=1,4"); // delete all SMS
cell.flush();
delay (3000);
}
}
Comment by Tom Mudd | July 9, 2011
Hi
Two things spring to mind
0) message[i] = cell.read(); to message[i] = char(cell.read()); or
1) Change int i to char i
Im running from memory at the moment as I lent my GSM shield to someone else
cheers
john
Comment by John Boxall | July 10, 2011
25. Im trying to get this to work with an arduino mega.
Ive followed the tutorial a number of times, but when I go into the terminal to start communication, I get this back:
Starting SM5100B Communication
!!
+SIND: 1
+SIND: 10,SM,1,FD,1,LD,1,MC,1,RC,1,ME,1
+SIND: 8
+SIND: 3
+SIND: 4
The three digits of special characters change depending on which AT+SBAND command I use, but nothing changes besides that, and Ive not been able to find
google for any clues as to what, if anything, I can do.
Really stumped.
Comment by David Hendry | July 11, 2011
hi David
+SIND:4 means the module has registered with the network and is ready to go. Can you get it to make a test call? Such as in example 26.2-Mega
(https://sites.google.com/site/tronixstuff/home/arduino-tutorial-series-files/example26p2mega.pde)
Comment by John Boxall | July 11, 2011
I cannot.
it does not seem to want to do anything other than what Ive already described.
Comment by David Hendry | July 11, 2011
Thats really weird, it should be good to go at +SIND: 4. If you like, could you please email me the sketch your are trying, and a description of how
you have the hardware setup, etc? john at tronixstuff dot com.
cheers
john
Comment by John Boxall | July 12, 2011
Any luck figuring out what the problem was. I am using a tmobile account and am having the same problem.
Any luck figuring out what the problem was. I am using a tmobile account and am having the same problem.
Comment by oydshaan | August 16, 2011
26. You know to make a GPRS connection to a server using tcp gprs shield
Comment by lourival | July 18, 2011
Due to time constraints I cannot help with GPRS data projects.
Comment by John Boxall | July 18, 2011
27. Additional info If I use the SIM from my Iphone i get the following:
Starting SM5100B Communication
+SIND: 1
+SIND: 10,SM,1,FD,1,LD,1,MC,1,RC,1,ME,1
+SIND: 3
+SIND: 4
+SIND: 8
Comment by Builder | July 18, 2011
It seems to be making a successful connection, (SIND 3 then 4), but then losing it (SIND 8). Please check all connections to shield, including your antenna
and shield pins are soldered well; check your power supply is capable of delivering up to 2 amps of current; and finally the reception. Finally, AT&T may
have an issue with using GoPhone SIM cards in non-phone devices, it would pay to check with them.
Cheers
John
Comment by John Boxall | July 18, 2011
Does the system need the battery pack just to register and be on the system? Currently I do not have the battery connected becasue the Arduino and
5100B are already powered by the computer and I am not making or receiving any calls. Do I simply disconnnect the power pins on the 5100B
leading to the Arduino and connect to the battery to the 5100B? It would probably cause an issue if I feed a 5v battery to the same power source as
the USB?
Comment by Builder | July 19, 2011
Yes, you need the external supply at all times. I cannot stress this enough. The module communicates with the cellular network even when not in a
call or transceiving data.
Comment by John Boxall | July 19, 2011
28. Im a little confused how to hook up the battery at the same time the GSM Shield is plugged into the Arduino. Do i smply plug the + and of the battery into the
Vin and gnd of the GSM shield while it is connected to the Arduino.. Do I disconnect the shield from the arduino and only connect pins 2&3. The Arduino
already has 5v coming in from the computer. Im concerned about shorting something or sending 10V to the wrong part.
Comment by Builder | July 19, 2011
You need a regulated 5V power supply with the capacity to deliver up to 2 amps of current. + goes to the 5V pin, goes to GND. Its ok to leave the USB
connected.
Comment by John Boxall | July 19, 2011
Ive got a lithium backpack connected as you specified, tightened the antenna a bit I now get:
Starting SM5100B Communication
+SIND: 1
+SIND: 10,SM,1,FD,1,LD,1,MC,1,RC,1,ME,1
+SIND: 3
+SIND: 0
+SIND: 10,SM,0,FD,0,LD,0,MC,0,RC,0,ME,0
+SIND: 7
It looks like SIND: 7 indicates that its ready for an emergency call. This is with the GoPhone Sim
with the Iphone results are:
Starting SM5100B Communication
+SIND: 1
+SIND: 10,SM,1,FD,1,LD,1,MC,1,RC,1,ME,1
+SIND: 3
+SIND: 4
+SIND: 8
+SIND: 8
+SIND: 11
OK
Comment by Builder | July 20, 2011
Your experience with the iPhone SIM shows your hardware is OK. I have some anecdotal evidence that AT+T could be blocking non-handset GSM
from using GoPhone accounts. Call AT+T and check this for yourself.
Comment by John Boxall | July 21, 2011
29. Tried T-mobile SIM and system worked flawlessly. Dont buy AT&T GoPhone
Thanks for your help.
Comment by Builder | July 21, 2011
30. Hello Iam Agung from Bali Indonesia..
I want to ask, Is usb modem is used as a substitute shielt GPRS by using the usb converter ttl? and what coding is the same as in example 3.26?
sorry for my english to bad. I cant speak english well..but I hope you can help me to this problem
Comment by celulux | July 23, 2011
Hello
Good question. I found this on my to-do list:
http://finch.am/projects/arduinogsm/
which may be of interest, however have not tried it myself yet.
have fun
john
Comment by John Boxall | July 23, 2011
yes, Ive read the article. but if I can, I wish not to dismantle the modem. Is converter USB to TTL can be used? and use the coding as an example
26.3 ?
or Is coding example for 26.3 can be used on the application of that article?
Comment by celulux | July 23, 2011
You really need to follow their instructions I have not tried this yet, so will not comment. Please direct your questions to the publisher of the article.
Comment by John Boxall | July 24, 2011
31. Im fairly new to working with the Arduino and GSM modules, so i have kind of a dumb question. I wanted to know, if this module can be used to receive and
display text messages as well, say on an LCD display
Comment by Sagar | July 28, 2011
Yes, that can be done. People use the string functions to extract the SMS data in the serial line from the GSM module.
Comment by John Boxall | July 28, 2011
32. Im new to working with Arduino and Gsm modules so i would like to know how i would end the text message with . I know that the ASCII value of it is 26 but
do i finalise my message with 26 or do i add it?
Please let me know.
Thankyou
Comment by Feda Adel | August 13, 2011
Have a look at example 26.3 sketch in chapter 26 it is self-explanatory. Anyhow, we use
cell.println(26,BYTE); // ASCII equivalent of Ctrl-Z
Comment by John Boxall | August 13, 2011
Yes i understand that, I mean through the terminal program. After i send this command AT+CMGS=xxxxxxxxxx, i get this prompt > .. do i just
put the text there dont i need to finalise it with the equivalent of too? If so how do i do it? I have been trying yet it aint giving me any error responses
nothing.
Comment by Feda Adel | August 14, 2011
Yes, enter the text and finish it with Ctrl-Z
Comment by John Boxall | August 15, 2011
33. Ctrl-Z just undoes what i just wrote .. tried it not working. Do i end it with its ASCII equivalent like the sketch 26.3? OR > Its a beautiful day today i press ctrlz right after it without pressing enter and nothing happens. Just undoes the command i had to the previous doesnt really end the text i send . Am i missing
something?
Comment by Feda Adel | August 15, 2011
Which terminal software are you using?
Comment by John Boxall | August 15, 2011
34. The same on you used in this tutorial, i downloaded it and i managed to make calls but i cant get the texting working ..
34. The same on you used in this tutorial, i downloaded it and i managed to make calls but i cant get the texting working ..
Comment by Feda Adel | August 15, 2011
Can you run example 26.3 successfully?
Comment by John Boxall | August 16, 2011
35. For any one interested, I have used the cellular shield with an Arduino for DIY gate access control:
http://dinofizz.wordpress.com/projects/diy-gsm-enabled-gate-access-control-system/
Comment by dinofizz | August 19, 2011
Congratulations, very well done
Comment by John Boxall | August 19, 2011
36. Im thinking of creating something like this for my senior project! Is it totaly fine for you to use some of the codes you posted here? Also if there is any trouble
can i contact you?
Comment by Besmir | August 31, 2011
Have fun with your project. I am happy to answer general questions about basic operation but cannot delve into the depths of custom sketches with you.
cheers
john
Comment by John Boxall | September 1, 2011
37. I did manage to find some help at local Radio Shack this afternoon. They sold me an ac-to-dc power adapter for 3/5/6/6.5/7/7.5 VDC, 2A, and an adapter pigtail
that gives me bare wires I can plug into my Arduino. I checked its output with my multimeter, and its 5.24V (which I guess is close enough?). I plug the wires
into the GND and VIN pins on the shield. The red LED on the shield lights up nice and bright. I have a correctly provisioned SIM (AT&T). I have an antenna.
When I power everything up, I still only get Starting SM5100B Communication in the terminal. With my multimeter, Im not reading any amperage readings,
but Im not surprised because I dont think my chip is doing any work.
I guess my biggest question is still about the power supply. Am I dont the correct thing by plugging it into VIN and GND? Should I buy and adapter to it that
will allow me to plug it into the DC socket on my Arduino instead? Or perhaps Im completely off base and should be doing something entirely different.
Any other suggestions for how I can troubleshoot this? Im learning a lot (which is awesome, thanks again for the great tutorial!), but Im scratching my head.
Thanks!
Comment by Greg | September 7, 2011
As stated in article, please use the 5V and GND pins, not Vin. Do not plug into Arduino DC socket.
Comment by John Boxall | September 7, 2011
Thanks for the continuing responses to your great tutorial. I think I am doing everything as described, but am continuing to have no luck with the
example. Im using an Arduino Uno, the SparkFun shield, a Radio Shack power supply rated 2 amps, set to 5V, plugged into the 5V and GND pins
on the shield. I have a working SIM and an antenna. I have tried with 2 different GSM chips one that came with the cellular shield, and one
purchased separately. I have tried 2 different SIM chips an AT&T postpaid and a newly activated TracFone prepaid. I have soldered the long
Arduino headers to the shield and inserted the shield in the Arduino. There are no other connections between the shield and Arduino, or the shield
and anything else. I have the USB cable between the Arduino and the computer to monitor the Serial traffic. My serial monitor is set to 9600. I copypasted the code from the tutorial, cleaned up formatting that was lost in the copy-paste, and uploaded it to the Arduino.
When I start up everything, the LED on the cellular shield glows bright red, the LED on the Arduino glows bright green. In the serial monitor, I get
Starting SM5100B Communication, followed by a newline, followed by whitespace, followed by unprintable characters. (!!Ra!!!!).
I have tried adjusting the speed in the Serial Monitor. The behavior I described above is what happens at the following speeds:28800, 14400, 9600.
At the other speeds (115200, 57600, 38400, 19200, 4800, 2400, 1200, 300), the Serial Monitor displays a string of unprintable characters. When
doing these tests at different speeds, I did *not* change the code in the Arduino sketch to match the speed in the serial monitor for every
combination. (Should I?) I tried changing Serial.begin() to 14400 and got unprintable characters for every speed setting in the Serial Monitor.
I note that other comments indicate the suggestion of a faulty module after receiving results like I am finding. Are there any further software tests I
can perform that would be helpful for troubleshooting? Are there hardware tests I can perform on the cellular shield independent of the Arduino that I
can perform that would help verify that the module is either functioning correctly or is faulty?
Comment by Greg | September 11, 2011
Kudos for the trouble shooting, but yes sounds like a dead shield.
Comment by John Boxall | September 12, 2011
Interim update: If I go into the NewSoftSerial.cpp and change the interrupt timings for our 16MHz chip to the following I get about 27 characters per
chunk before it loses synchronization. Thats enough to send the AT command to the SM5100B to change its baud rate to something more
manageable. But just in case anyone else runs into this problem, here are the timing values (using NewSoftSerial library version 10):
#if F_CPU == 16000000
static const DELAY_TABLE PROGMEM table[] =
{
// baud rxcenter rxintra rxstop tx
{ 115200, 1, 16, 16, 12, },
( and so on)
Comment by Jens | September 18, 2011
tell NewSoftSerial to try this baudrate it approximately lines up but not quite. Roughly every 10th to 50th bit is not properly aligned, I can manually move the
bits around and see the five occurrances of the +SIND: sequence from the screenshot above. From the NewSoftSerial source code (.library_version() = 10) I
see that it registers interrupts and listens to individual pins. The tricky part will be to set the default baud rate to something more comfortable, using the
AT+IPR=9600! command for example, while its currently not communicating . Ill tinker around some and will post here what I came up with. It would be
great to have a software solution, of course. I already see hardware hooks in the compiler directives in the NewSoftSerial code, maybe we can update the library
for our hardware (ATMEGA328P-PU at 16MHz).
Comment by Jens | September 18, 2011
42. hello sir, i want to connect Arduino with wavecom modem. question, is the code same with code in example 26.3 ? If yes, am I need to use rs232-ttl converter?
thanks before ..sorry for my english too bad :)
Comment by agung arjaya | September 21, 2011
Sorry, no idea dont have that modem.
Comment by John Boxall | September 21, 2011
43. Hi John,
First of all thanks for your tutorial. Im using an Arduino Uno with the shield to send and receive SMS messages for a project, however when I run the first
sketch, I only get Starting SM5100B Communication.
Ive tried different baud rates, but still get nothing. I have a rubber ducky antenna that I got from Sparkfun and am pretty sure the Sim card works as it is the one I
use from my regular phone. I really want to get this to work an it has been three days. Is there something I might be missing?
Ive also tried this example included with the NewSoftSerial library (if thats worth anything):
#include
NewSoftSerial mySerial(2, 3);
void setup()
{
Serial.begin(57600);
Serial.println(Goodnight moon!);
// set the data rate for the NewSoftSerial port
mySerial.begin(4800);
mySerial.println(Hello, world?);
}
void loop() // run over and over again
{
if (mySerial.available()) {
Serial.print((char)mySerial.read());
}
if (Serial.available()) {
mySerial.print((char)Serial.read());
}
}
It only prints Goodnight moon!, but then again Im really not sure how it is supposed to behave. I really hope that in my naivety Im doing something wrong
and that my module isnt faulty. Any help will be greatly appreciated. Thanks,
Manu
Comment by Manu | October 2, 2011
If you upload example 26.1, connect the antenna, 5V 2A power supply and set the serial monitor box to 9600 (or 115200) and nothing comes up, you have
a faulty shield.
cheers
john
Comment by John Boxall | October 3, 2011
Monthly Competition
Enter now for a chance to win great prizes!
YouTube
Visit tronixstuff on YouTube for our range of videos
Arduino Tutorials
Click for Detailed Chapter Index
Chapters 0 1 2 3 4
Chapters 5 6 6a 7 8
Chapters 9 10 11 12 13
Chapter 14 - XBee
Chapter 15 - RFID
Chapter 16 - Ethernet
Chapter 17 - GPS part I
Chapter 18 - RGB matrix
Chapter 19 - GPS part II
Chapter 20 - I2C bus part I
Chapter 21 - I2C bus part II
Chapter 22 - AREF pin
Chapter 23 - Touch screen
Chapter 24 - Monochrome LCD
Chapter 25 - Analog buttons
Chapter 26 - GSM mobile - part I
Chapter 27 - GSM mobile - part II
Chapter 28 - Colour LCD
Chapter 29 - TFT LCD
Chapter 30 - Arduino + twitter
Chapter 31 - Inbuilt EEPROM
Chapter 32 - Infra-red control
Chapter 33 - Control AC via SMS
Chapter 34 - SPI bus part I
Chapter 35 - Video-out
Chapter 36 - SPI bus part II
Chapter 37 - Timing with millis()
Chapter 38 - Thermal Printer
Chapter 39 - NXP SAA1064
Chapter 40 - Push wheel switches
Chapter 40a - Multiple wheel switches
Chapter 41 - More digital I/O
Chapter 42 - Numeric keypads
Search
Search
RSS Feeds
Subscribe in a reader
Subscribe!
Categories
Select Category
Previous posts
January 2011
M T W T F S S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Dec
Feb
Archives
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
Contact information
Feel free to contact me anytime:
email - john at tronixstuff dot com
Google Group
Why not join our discussion group? Fun and learning with electronics!
Creative Commons
All the original material in this website, unless noted otherwise, is covered under a Creative Commons Attribution-Non Commercial-Share Alike v3.0 license.
Please email me if you see any mis-attributions or would like to use my content in different circumstances.
EEWeb Community
Read my interview on the EEWeb Electrical Engineering Community website.
on twitter
If for some reason you use Microsoft Visual Studio, you can program an Arduino with it... http://t.co/tgKxjwzO 7 hours ago
@AltronicsAU @PerthArtifact Arduino! Yes - what are you waiting for? 11 hours ago
@andrewjand True, but wouldn't work anymore. Why do so many Jaycar staff have beards? 12 hours ago
Pile of Arduinos hooked up in Rube Goldeberg-esque chain reaction (video) http://t.co/BvWTIyBY 13 hours ago
@Uncl_Vernon @alangarf Or the "choke a chicken" toy. 22 hours ago
Flickr Photos
More Photos
Find me on
element 14
facebook
flickr
friendfeed
Google+
posterous
tumblr
Twitter
vimeo
Whirlpool
Youtube
Interesting Sites
Interesting Sites
David L. Jones' eev blog
Freetronics Arduino Geniuses!
Little Bird Electronics Service Powered Electronics!
Silicon Chip magazine Always a great read!
Amazing Arduino Shield Directory
The Amp Hour podcast
EEWeb Elec Engineering Forum
Superhouse.tv High-tech home renovation
Mr Dick Smith OA
Site info
tronixstuff
Theme: Andreas04 by Andreas Viklund. Blog at WordPress.com.