to receive sms on SIM300 using arduino uno

Discussion in 'The Projects Forum' started by project_quest, Aug 31, 2013.

  1. project_quest

    Thread Starter New Member

    Aug 31, 2013
    1
    0
    Hey Everyone,
    I'm working on sending and receiving texts on SIM300 interfacing it with an arduino uno.The sending bit and the subsequent display on an LCD screen has been performed sucessfully.However,I'm facing issues with the receiving bit while communicating with the GSM modem using an arduino. Meaning,I'm able to read the received texts by typing in AT commands on the hyperTermminal window but not so on the serial monitor.On the serial monitor i see a meaningless display of numbers and symbols.
    My code and screen shots of my serial monitor window for receiving sms onto the SIM300 are enclosed here.
    Code ( (Unknown Language)):
    1.  
    2. #include <SoftwareSerial.h>
    3. SoftwareSerial mySerial(9,10);
    4. char incomingByte=0;
    5. void setup()
    6. {
    7.        Serial.begin(9600);  
    8.       mySerial.begin(9600);  
    9.       pinMode(13, OUTPUT);
    10.       mySerial.println("AT");
    11.       delay(2000);
    12.       mySerial.println("AT+CMGF=1");
    13.       delay(2000);  
    14.       mySerial.println("AT+CSMP=17,167,0,0");
    15.       //mySerial.println("AT+CNMI=3,3,0,0");
    16.       delay(2000);
    17.      
    18.      }
    19.  
    20. void loop()
    21.  
    22. {  
    23. mySerial.write("AT+CMGL=");
    24. mySerial.write(34);
    25. mySerial.write("ALL");
    26. mySerial.write(34);
    27. mySerial.write(13);
    28. mySerial.write(10);
    29.  
    30.  
    31.         while (mySerial.available() > 0)
    32.         {      
    33.                incomingByte = mySerial.read();
    34.                if(incomingByte!='/n')
    35.                {
    36.                Serial.print(incomingByte);
    37.                }
    38.                
    39.                if(incomingByte=='/n')
    40.                {
    41.                  Serial.println(incomingByte);
    42.                }
    43.          
    44.      
    45.  
    46.         }
    47. }
    48.        
    49.        
    50.  
    51.  
    52.  
    http://s1284.photobucket.com/user/sandycook9211/media/Screenshot9_zps68f9539d.png.html


    Kindly assist me in this project! :)
     
Loading...