Tuesday, 3 May 2016

Interfacing SIM900 with arduino uno

In this post, we will learn how to interface SIM900 with arduino uno.

First of all, insert sim in sim socket of GSM module. Power it up by 12V 2A dc adapter.

Now, we have to make connections as follows:

Arduino Side                       GSM module
Tx                =====>          Rx
Rx                =====>          Tx
GND            =====>          GND

The source code is given below:

    boolean bOK = HIGH;

    void setup()
    {
    Serial.begin(4800);
    delay(1200);
    }
    void loop()
    {
 
    if(bOK==1)
    {
    Serial.println("AT+CMGF=1"); // sets the SMS mode to text
    delay(1500);
    Serial.print("AT+CMGS=\""); // send the SMS number
    Serial.print("+9199XXXXXXXX"); // +91 for india
    Serial.println("\"");
    delay(1000);
    Serial.print("Hello World "); // SMS body
    delay(500);

    Serial.write(0x1A);
    Serial.write(0x0D);
    Serial.write(0x0A);
    bOK=LOW;
    }
    }

The source code is self-explanatory.

Thanks for visiting this blog.

Stay tuned for more projects !!

No comments:

Post a Comment