You are on page 1of 12

ello friends, hope you all are fine and having fun with your lives.

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

demanded ProteusLibrary.   Till now, I have received hundreds of


suggestions and requests about this Library and I have always told them that its
under designing process and I will post it real soon. So finally the wait is over and
we have our new GSM Library for Proteus, ready to download and simulate in
Proteus. Using this GSM library for Proteus, now you can easily simulate your

GSM module in Proteus and can test your code. 


As its the first version of our GSM Library so its not complete or perfect. It is
really the basic model of GSM Library and rite now it will only support some
commands, which I will post below. I am still working on it and I will soon update
these files and will add more commands in it but till then you have to use these
commands only. Moreover, this Library contains only one module in it which is
SIM900D module. I will add more soon like SIM900A and Sim300 etc. real soon.
I will also interface it with different Microcontrollers like Arduino or PIC
Microcontroller etc. and will share their tutorials. So. let’s get started with GSM
Library for Proteus:

Note:
Other Proteus Libraries are as follows:

 Arduino Library for Proteus.


 Genuino Library for Proteus.
 GPS Library for Proteus.
 XBee Library for Proteus.
 Ultrasonic Sensor Library for Proteus.
 PIR Library for Proteus.
 Bluetooth Library for Proteus.

GSM Library for Proteus

 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

check the response of this GSM module. 

 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

of our SIM900D GSM Module. I am gonna add more soon. 


 Now, here’s a quick video in which I have shown its working, which will give
you the better idea of this GSM Module.

Upgrade # 1: Send SMS with Sim900D

 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

 Connect TX pin of GSM Module to RX pin of Arduino Uno.


 Connect RX pin of GSM Module to TX pin of Arduino Uno.

 Connect GND pin of GSM Module to GND pin of Arduino Uno.

Steps to boot GSM module

1. Power ON the GSM module by providing 5V and GND.

2. Insert the SIM card to GSM module and lock it.

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

const int Input1=8;


int State1=0;

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.

const int Input1=8;


int State1=0;
Put your setup or configuration code in the setup function, it will only run once
during the startup. Initialize the Input1 pin as an input. Set the Baudrate of Serial
communication as 9600.

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);
}
}

This function is to used establish communication between arduino and GSM


module by AT commands to send SMS to the provided mobile number.

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

Interfacing GSM Modem with Arduino – 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.

You might also like