arduino uno and gps/gprs/gsm module v3.0

want to use arduino uno and gps/gprs/gsm module v3.0 from drfobot for my project. but so far i am unable to receive an sms on the gsm shield, anybody who can give me a working arduino code? thanks.

Replies

  • Harshad Italiya
    Harshad Italiya
    eni
    want to use arduino uno and gps/gprs/gsm module v3.0 from drfobot for my project. but so far i am unable to receive an sms on the gsm shield, anybody who can give me a working arduino code? thanks.
    It would be better if you share your work in which you are facing issue then it might make some sense.
  • eni
    eni
    // Product name: GPS/GPRS/GSM Module V3.0
    // # Product SKU : TEL0051
    // # Description:
    // # The sketch for controling the GSM/GPRS/GPS module via SMS.
    // # Steps:
    // # 1. Turn the S1 switch to the Prog(right side)
    // # 2. Turn the S2 switch to the USB side(left side)
    // # 3. Plug the GSM/GPS jumper caps to the GSM side
    // # 4. Upload the sketch to the Arduino board(Make sure turn off other Serial monitor )
    // # 5. Turn the S1 switch to the comm(left side)
    // # 6. Turn the S2 switch to the Arduino(right side)
    // # 7. RST the board until the START led is on(make sure you have >6V power supply)
    // # 8. Plug the long side of LED into pin 8 and short side into GND
    // # 9. Start sending "LH" and "LL" to your board to turn LED on and off.

    /*
    * created: 2013-11-14
    * by: Grey
    * Version: 0.3
    * Attention: if you send the wrong SMS command to the module, just need to press RST.
    * This version can't watch the module status via the serial monitor, it only display the Arduino command.
    * If you want to watch the status,use the SoftwareSerial or the board with another serial port plese.
    */


    byte gsmDriverPin[3] = {
    3,4,5};//The default digital driver pins for the GSM and GPS mode
    //If you want to change the digital driver pins
    //or you have a conflict with D3~D5 on Arduino board,
    //you can remove the J10~J12 jumpers to reconnect other driver pins for the module!
    int ledpin = 13;
    char inchar;
    void setup()
    {
    //Init the driver pins for GSM function
    for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin,OUTPUT);
    }
    pinMode(ledpin,OUTPUT);
    Serial.begin(9600); //set the baud rate
    digitalWrite(5,HIGH); //Output GSM Timing
    delay(1500);
    digitalWrite(5,LOW);
    digitalWrite(3,LOW); //Enable the GSM mode
    digitalWrite(4,HIGH); //Disable the GPS mode
    delay(2000);
    delay(5000); //call ready
    delay(5000);
    Serial.println("AT+CMGD=1,4"); //Delete all SMS in box
    }

    void loop()
    {
    if(Serial.available()>0)
    {
    inchar=Serial.read();
    if(inchar=='T')
    {
    delay(1000);
    inchar=Serial.read();
    if (inchar=='I') //When the GSM module get the message, it will display the sign '+CMTI "SM", 1' in the serial port
    {
    delay(1000);
    Serial.println("AT+CMGR=1"); //When Arduino read the sign, send the "read" AT command to the module
    delay(1000);
    }
    }
    else if (inchar=='L')
    {
    delay(1000);
    inchar=Serial.read();
    if (inchar=='H') //Thw SMS("LH") was display in the Serial port, and Arduino has recognize it.
    {
    delay(1000);
    digitalWrite(ledpin,HIGH); //Turn on led
    delay(1000);
    Serial.println("AT+CMGD=1,4"); //Delete all message
    delay(1000);
    }
    if (inchar=='L') //Thw SMS("LH") was display in the Serial port, and Arduino has recognize it.
    {
    delay(100);
    digitalWrite(ledpin,LOW); //Turn off led
    delay(1000);
    Serial.println("AT+CMGD=1,4"); //Delete all message
    delay(1000);
    }
    }
    }
    }

    ok. that is the code i am using. the problem is: the led on pin 13 doesnt go on and in the serial monitor the only thing being displayed is: AT+CMGD=1,4
    please help. thanks

You are reading an archived discussion.

Related Posts

Hi CEans, was just curious to know if there's anyone here who is familiar with BATCH file programming?
Hi CEans, Its a happy news for the Masculine bike lovers. Yes its the news that has been rounding that Royal Enfield would be switching from its old Logo to...
Gionee Communication Equipment Co. Ltd, the Chinese smartphone and tablet brand has launched yet another Android smartphone in the Indian market with Gionee P2S. Running on a Dual-core 1.3 GHz...
Dear Friends: Do you have research results, scientific opinions or review papers to be published? Myself editor of ijsrms journal invites you to contribute your research contributions.Let us join hands...
Hi CEans! I was just browsing and found this quiz interesting, so thought to share with you all. Test What career you should actually have? https://stuffhappens.us/quiz-what-career-should-you-actually-have-12282/ Here's mine : Post...