HOW TO SEND AN SMS USING GSM MODEM CONNECTED TO ARDUINO

Home Forums ARDUINO PROJECTS HOW TO SEND AN SMS USING GSM MODEM CONNECTED TO ARDUINO

This topic contains 1 reply, has 2 voices, and was last updated by  siladityaa 1 year ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1333

    Admin
    Moderator

    Components Required:

    1. Arduino Board
    2. GSM/GPRS Modem (In this I have used SIM900 Module)
    3. PC/Laptop
    4. Connecting wires and USB cable for connecting Arduino to PC.

    1. FOR CODE WITHOUT USING LIBRARY FILES:
    `void setup()
    {
    Serial.begin(2400); //Baud rate of the GSM/GPRS Module
    Serial.print(“\r”);
    delay(1000);
    Serial.print(“AT+CMGF=1\r”);
    delay(1000);
    Serial.print(“AT+CMGS=\”+9185300xxxx9\”\r”); //Number to which you want to send the sms
    delay(1000);
    Serial.print(“iFuture Technology\r”); //The text of the message to be sent
    delay(1000);
    Serial.write(0x1A);
    delay(1000);
    }
    void loop()
    {
    }`

    2. FOR CODE WITH USING LIBRARY FILES:

    `#include “SIM900.h”

    #include <SoftwareSerial.h>

    #include “sms.h”

    SMSGSM sms;

    void setup()
    {
    Serial.begin(9600);
    Serial.println(“GSM Testing to send SMS”);
    if (gsm.begin(2400)){
    Serial.println(“\nstatus=READY”);
    started=true;
    }
    else Serial.println(“\nstatus=IDLE”);

    if(started){
    if (sms.SendSMS(“+9185300xxxx9”, “Arduino SMS”))// number to which you want to send the sms and the sms text//
    Serial.println(“\nSMS sent OK”);
    }
    };
    void loop()
    {
    };`

    #2799

    siladityaa
    Member

    Hi,

    your code helped me a lot but can you please tell me a way of sending the values in a variable as an sms. Please revert back ASAP.

    `void sendsms()
    {
    Serial.begin(2400); //Baud rate of the GSM/GPRS Module
    Serial.print(“\r”);
    delay(1000);
    Serial.print(“AT+CMGF=1\r”);
    delay(1000);
    Serial.print(“AT+CMGS=\”+91XXXXXXXXXX\”\r”); //Number to which you want to send the sms
    delay(1000);
    Serial.print(“The reading at which the irrigation stopped is”+sensor_value); //The text of the message to be sent
    delay(1000);
    Serial.write(0x1A);
    delay(1000);
    }’
    Thanks in advance

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.