Title: Interface GSM Module SIM900A with Arduino Uno
This post is for progresses made on the week 10 of completing this project. In this week, we have to buy a new GSM Module which is SIM900A. Because SIM800L before that was damage.
A new GSM Module SIM900A that we buy and SIM800L |
SIM900A is one of the products GSM / GPRS SIMCOM Serial Modem from which we can use as well Arduino microcontroller to feature SMS, Phone or data GPRS. This is a specifications Chip Module SIM900A brief: Features: -Quad-Band 850/900/1800/1900 MHz - Can be used on any GSM network in various countries. -GPRS Multi-slot class 10/8 -GPRS Mobile station class B Compliant to GSM phase 2/2 + -Class 4 (2 W (AT) 850/900 MHz) -Class 1 (1 W (AT) 1800 / 1900MHz) -Instruction Using AT Command - Standard Commands: GSM 07:07 & 07:05 | Enhanced Commands: SIMCOM AT Commands. Short Message-Service (SMS) - Embedded TCP / UDP stack - can upload data to the web server -Support RTC -Selection Serial Port (3.3V and 5V Level) -There Speaker and headphone jack (type specific breakout board) -assume Low power - 1.5m (sleep mode) -Working Temperature - -40C to +85 C
GSM SIM900A Datasheet Click here.
Wiring connection between SIM900A and Arduino UNO.
SIM900A <--> Arduino Uno
GND <---> GND
VCC <---> 5V
TXD 5V <---> D2 (digital PIN 2)
RXD 5V <---> D3 (digital PIN 3)
The code that we use in Arduino IDE Software to interface GSM Module SIM900A
#include <SoftwareSerial.h>
SoftwareSerial sim900a(2,3);
int data;
void setup()
{
Serial.begin(9600);
sim900a.begin(9600);
Serial.println("Enter");
Serial.println("1 - Manufacturer identification");
Serial.println("2 - Model identification");
Serial.println("3 - Software version");
Serial.println("4 - IMEI number");
Serial.println("5 - Calling");
Serial.println("6 - Hang Up");
Serial.println("7 - Send message");
Serial.println("8 - Read message");
Serial.println("9 - Delete message");
}
void loop()
{
if(Serial.available()>0)
{
data=Serial.read();
if (data=='1')
{
sim900a.print("AT+CGMI\r"); //Manufacturer identification
}
if (data=='2')
{
sim900a.print("AT+CGMM\r"); //Model identification
}
if (data=='3')
{
sim900a.print("AT+CGMR\r"); //Software version
}
if (data=='4')
{
sim900a.print("AT+CGSN\r"); //IMEI number
}
if (data=='5')
{
sim900a.print("ATD+60136289844;\r"); //Calling
}
if (data=='6')
{
sim900a.print("ATH\r"); //Hang Up
}
if (data=='7')
{
sim900a.print("AT+CMGF=1\r"); //Set text mode
delay(1000);
sim900a.print("AT+CMGS=\"+60136289844\"\r"); //Send message
delay(1000);
sim900a.print("Hai, I'm SIM900A");//Text message
sim900a.println((char)0x1A); //Ctrl+Z
}
if (data=='8')
{
sim900a.print("AT+CMGR=1\r"); //Read message
}
if (data=='9')
{
sim900a.print("AT+CMGD=1,0\r"); //Delete message
}
}
if(sim900a.available()>0)
{
while(sim900a.available())
{
data=sim900a.read();
Serial.write(data);
}
}
}
No comments:
Post a Comment