Vijayprakash
Newbie level 1
Hello Every one,
Am try to send and Receive SMS from SIM900 with the help of Arduino UNO, I have write a program for that but SIM 900 performing all the function like receiving Message , Calling to Someone, Receving call but not sending SMS
My program as follows:
Please help me out
Thanks
Am try to send and Receive SMS from SIM900 with the help of Arduino UNO, I have write a program for that but SIM 900 performing all the function like receiving Message , Calling to Someone, Receving call but not sending SMS
My program as follows:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 #include <SoftwareSerial.h> SoftwareSerial mySerial(7, 8); char incoming_char=0; void setup() { Serial.begin(9600); mySerial.begin(2400); delay(20000); // give time to log on to network. mySerial.println("ATV1"); delay(100); mySerial.println("ATE0"); delay(100); mySerial.println("AT+CMGF=1"); delay(100); mySerial.println("AT+CMGD=1"); delay(1000); mySerial.println("AT+CNMI=2,2,0,0,0\r"); delay(100); mySerial.println("AT+CMGR=1"); delay(200); } void sendSMS() { mySerial.println("AT+CMGS="+917045610408" "); // recipient's mobile number, in international format delay(100); mySerial.println("Hello"); // message to send delay(100); mySerial.println((char)26); // End AT command with a ^Z, ASCII code 26 delay(100); Serial.println("msg sent"); mySerial.println(); delay(5000); // give module time to send SMS } void callSomeone() { mySerial.println("ATD + +917045610408;"); // dial US (212) 8675309 delay(100); mySerial.println(); Serial.println("GSM Test1"); delay(30000); // wait for 30 seconds... mySerial.println("ATH"); // hang up Serial.println("GSM Test2"); } void loop() { if(mySerial.available() >0) { incoming_char=mySerial.read(); //Get the character from the cellular serial port. Serial.print(incoming_char); //Print the incoming character to the terminal. if(incoming_char=='a') { Serial.println("Coin Acceptor OFF"); callSomeone(); delay(100); sendSMS(); delay(100); } } }
Please help me out
Thanks
Last edited by a moderator: