GSM MODULE

TINKS041

  1. GSM stands for Global System for mobile communication.
  2. GSM is a mobile communication modem, that can be either a mobile phone or a modem device which can be used to make a computer or any other processor communicate over a network.
Features:-
  1. Improved spectrum efficiency
  2. International roaming
  3. Compatibility with integrated services digital network (ISDN)
  4. Support for new services.
  5. SIM phonebook management
  6. Fixed dialling number (FDN)
  7. Real-time clock with alarm management
  8. High-quality speech
  9. Uses encryption to make phone calls more secure
  10. Short message service (SMS).
  11. Power supply:- 3.7v
Applications:-
  1. Mobility
  2. Easy availability.
  3. High uptime.
  4. Access control devices.
  5. Supply chain management.

    

#include <SoftwareSerial.h>
SoftwareSerial sim(9, 10);
int _timeout;
String _buffer;
String number = "+917014260232";// change with your number
void setup() {
delay(7000); //delay for 7 seconds to make sure the modules get the signal
Serial.begin(9600);
_buffer.reserve(50);
Serial.println("System Started...");
sim.begin(9600);
delay(1000);
}
void loop() {
SendMessage();
delay(10000);
}
void SendMessage()
{
Serial.println ("Sending Message");
sim.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000);
//Serial.println ("Set SMS Number");
sim.println("AT+CMGS=\"" + number + "\"\r"); //Mobile phone number to send message
delay(1000);
String SMS = "hello how are you?..GSM_TESTING-done ";
sim.println(SMS);
delay(100);
sim.println((char)26);// ASCII code of CTRL+Z
delay(1000);
_buffer = _readSerial();
}
String _readSerial() {
_timeout = 0;
while (!sim.available() && _timeout < 12000 )
{
delay(13);
_timeout++;
}
if (sim.available()) {
return sim.readString();
}
}