Professional Documents
Culture Documents
we use the GSM900 module using the Arduino Mega GSM-Global System For Mobile. The GSM
Module supports communication in 900MHZ band. In India most of the mobile network providers
operate in 900MHZ band. In the majority of the United States the band width provider is around
(850-1900MHZ).
Requirements
Arduino Mega
Bread Board
GSM900 Module
Led
Some Jumper Wires
Step 3: Wait for some seconds and see the blinking rate of status LED once the connection is
established the led will blink continously every three seconds.
Connection
We start with softwareserial.h library in to the program in the next line create the constructor for the
serial port such as RX and the TX. In the Arduino Mega board 15 pin act as RX pin and 16 pin act as
the TX pin while using the Arduino Uno "0" pin as TX "1st" pin as RX .void setup() In the setup()
function we want to set the baud rate for the GSM because we want to communicate with the device
to the Serial Monitor so we want to set the BaudRate as (9600) and set the delay time as 1000 i,e
1Sec and Now let's move to actual program void loop() is the one type of the condition function
based upon our condition our GSM will work first we check the availablity of the serial ports.
Serial.available().
1. if(Serial.available()>0)
To check the any data that are coming to the serial port of the Arduino if it is available means the led
will be on, else it will not be on Serial.read().
It is the one type of the function we created in the Arduino Mega to send the SMS. First we want to
set the GSM to the text mode; this can done through the "AT" commands AT means Attention we
can send the sms through the serial port while writing ("AT+CMGF") and
("AT+CMGS=\"XXXXXXXXXX"\"\r") and set some delay time then upload the program to the Arduino
mega board and open the serial monitor windows type "Hello C# Corner Iam Sending SMS Through
GSM" and click send button. The SMS will send to the concert mobile number that you have been
given in the code.
1. firstSerial.println("AT+CMGF=1");
2. delay(1000);
3. firstSerial.println("AT+CMGS=\"+xxxxxxxxxx\"\r");
4. delay(1000);
5. firstSerial.println("Hello C# Corner Iam Sending SMS Through GSM");
6. delay(100);
7. firstSerial.println((char)23);
8. delay(1000);
AT Command
AT Command is used to check the connection between the module and the computer.
E.g: ("AT+CMGF=<mode>" )
CMGS: The Command is used to send the sms from module to the device.
E.g: ("AT+CMGS=\"<mode>\">
Syntax: AT<Command name>=?
Syntax: AT<Command name>?
Syntax: AT<Command name>=value1...value N
Execution command
Syntax: AT<Command name>=parameter1,....parameterN