Professional Documents
Culture Documents
In today’s post, I
am going to share GSM Library for Proteus. Yeah you have read absolutely fine,
today I am gonna share the most awaited and most
Note:
Other Proteus Libraries are as follows:
First of all, download the GSM Library for Proteus by clicking the below button:
Download GSM Library
When you download it, you will get three files in it which are:
o GSMLibraryTEP.IDX
o GSMLibraryTEP.LIB
o GSMLibraryTEP.HEX
Place all these files in the Libraries folder of your Proteus software.
Note:
If you are new to Proteus 7 or 8 Professional, then you should have a look
at How to add new Library in Proteus 8 Professional.
Now, open your Proteus software or restart it if its already open and in
components list search for SIM900D and you will get three results for it.
Place all of them in your Proteus workspace and they will look like as shown in
below figure:
Now, you can see in the above figure that we have three GSM Modules in
our Proteussoftware.
These three GSM modules are exactly same in functionality as you can see
they all have two pins on them which are TX and RX and they are only differ in
color but they all work on Serial Port.
One is in light blue color which is kind of our theme color, next one is in green
color while the last one is in red color.
So, now let’s have a look at how you can use it in your Proteus simulations.
Double click any of them and in the program file section, browse to the
GSMLibraryTEP.HEX file and upload it in SIM900D module as shown in below
figure:
AS you can see in the above figure that I have uploaded the
GSMLibraryTEP.HEX file in the Program file section.
Now click OK and interface a Virtual Terminal with SIM900D, as shown in
below figure:
Now, I am gonna run my simulation and will send it AT commands we will
Now these are some basic commands, which are rite now supported by this
version of GSM Module.
It won’t be able to send or receive SMS rite now because these functionalities
are not added yet but they are coming soon, as I am still working on it.
Note:
Here’s the complete list of commands currently supported by this Sim900D
module:
AT
AT+CPIN?
AT+CSQ
AT+CGMI
AT+COPS?
AT+CGMM
AT+CGSN
AT+CNUM
ATA
ATH
AT+COLP
AT+CLIP
AT+VTS=1
AT+CSMP?
AT+CSCS?
AT+CSCS=”HEX”
AT+CSMP
AT+CNMI=1,2,0,0,0
AT+CMGF=1
AT+CMGD=1
So, these are the commands which are currently supported by this Version 1.0
I have upgraded this GSM Library for Proteus and have added a new feature
in it which is SMS sending.
Now you can easily send SMS using this GSM Module.
For details on How to do it with Arduino, you should read Send SMS with
Sim900D in Proteus ISIS.
You should also have a look at How to Receive SMS with AT Commands
using SIM900D and Arduino.
If you are working on PIC Microcontroller then here’s how you can receive
SMS using SIM900D and PIC Microcontroller.
That’s all for today, I hope you are gonna enjoy this GSM Module. Must write
your experience in the below comments which will work as a boost for me and I
will design it even faster. So, till next tutorial, take care and have fun !!!
Connections
3. Initially blinking rate of network LED will be high. After sometime observe the
blinking rate of ‘network LED’ (GSM module will take some time to establish
connection with mobile network)
4. Once the connection is established successfully, the network LED will blink
continuously for every 3 seconds.
5. Even we can check the connection establishment of GSM module with mobile by
making a call to the number of the SIM. If we hear a ring back, the GSM module has
successfully established network connection.
Software
Code
void setup(){
Serial.begin(9600);
pinMode(Input1, INPUT);
}
void loop()
{
State1= digitalRead(Input1);
if(State1 == HIGH)
{
sendsms();
delay(2000);
}
}
void sendsms()
{
Serial.println("AT\r");
delay(1000);
Serial.println("AT+CMGF=1\r");
delay(1000);
Serial.println("AT+CMGS=\"XXXXXXXXXX\"\r");
delay(1000);
Serial.println("MESSAGE 1");
delay(1000);
Serial.println((char)26);
delay(100);
}
Code Explanation
Input1 is a constant integer type, constants won’t change and it is set to pin number
8 of Arduino. State1 is a variable, variables will change and it is assigned with 0
value.
void setup(){
Serial.begin(9600);
pinMode(Input1, INPUT);
}
Put your main code in void loop() function to run repeatedly. Read the state of the
State1 variable value and check if the switch is pressed which is connected pin
number 8 of arduino. If it is, then it will call GSM function to send SMS to the
programmed mobile number.
void loop(){
State1= digitalRead(Input1);
if(State1 == HIGH)
{
sendsms();
delay(2000);
}
}
void sendsms()
{
Serial.println("AT\r"); //AT is the abbreviation of Attention. Checking
communication.
delay(1000);
Serial.println("AT+CMGF=1\r"); // To set the modem in SMS sending mode.
delay(1000);
Serial.println("AT+CMGS=\"XXXXXXXXXX\"\r"); // For sending SMS to a number.
delay(1000);
Serial.println("MESSAGE 1"); // Message to send
delay(1000);
Serial.println((char)26); // End command for SMS a^Z, ASCII code 26.
delay(100);
}
Practical Implementation
Working
The switch will be connected digital pin 8 of arduino as an input. Whenever we
press the switch, the arduino will communicate with GSM module by using AT
commands and sends “MESSAGE” to the programmed mobile number. AT+CMGS at
command is used to send SMS.