Pages: [1]   Go Down
Author Topic: Transmitting SMS from a GSM modem  (Read 571 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Ive got an project going on bout trying to send an text-message from my arduino to my mobile-phone using an GSM. The program im now using is this:
#include <SoftwareSerial.h>

SoftwareSerial cell(2, 3); // RX, TX
char mobilenumber[]="99497322";  // Replace xxxxxxxx with the recipient's mobile number
char textmessage[160]; // used to hold contents of message to send
int b=0;
void setup()
{  //Initialize serial ports for communication.
delay(35000); // give the GSM module time to initialise, locate network etc.
// this delay time varies. Use example 26.1 sketch to measure the amount
// of time from board reset to SIND: 4, then add five seconds just in case
pinMode(13, OUTPUT); // use the LED for status
void startSMS()
// function to send a text message
digitalWrite(13, HIGH);
cell.println("AT+CMGF=1"); // set SMS mode to text
cell.write((byte)34); // ASCII equivalent of "
cell.write((byte)34);  // ASCII equivalent of " HOME MADE.
delay(500); // give the module some thinking time
void endSMS()
cell.write((byte)26);  // ASCII equivalent of Ctrl-Z
delay(15000); // the SMS module needs time to return to OK status
digitalWrite(13, LOW);
void loop()
b=random(0, 99);
for (int a=0; a<100; a++)
if (a==b)
cell.print("The random number is: ");
} while (1>0);
And I got som problem with getting it working, hope that someone maybe would be able to help me smiley-wink

Moderator edit: CODE TAGS
« Last Edit: November 13, 2012, 08:49:08 am by AWOL » Logged

Global Moderator
Offline Offline
Brattain Member
Karma: 309
Posts: 26538
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And I got som problem

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Queens, New York
Offline Offline
Faraday Member
Karma: 106
Posts: 3772
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

does the mobile number need to have 9+ 949-7322, or does it need area code 9+(XXX) 949-7322 ?
your original number: 99497322

What problems are you getting?

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Pages: [1]   Go Up
Jump to: